Hi there,
I realize there must be a misunderstanding on my part in the maths behind how angles are calculated between vectors so I thought I’d ask here.
Before I begin: this is a 2d problem:
I have an origin (8.9,2.3)
and three points
- (4,2)
- (-11.5,0)
- (4,1.6)
my goal is to find which points are struck first when sweeping a ray counterclockwise from the origin.
In the visual example provided, you can see that (4,2) should be struck first, followed by (4, 1.6) and finally (-11.5,0) - but I am getting counter intuitive results using Vector3.Angle to find the angle between these points
According to all sources I’ve used, (-11.5, 0) lies on a ray 2.9 degrees ccw from (4.2) and (4,1.6) lies on a ray 4.62 degrees ccw from 4.2 (using (8.9,2.3) as our origin)
- WolframAlpha query:
VectorAngle[{4-8.9,2-2.3},{4-8.9,1.6-2.3}]
in degrees
4.627 deg
- WolframAlpha query:
VectorAngle[{4-8.9,2-2.3},{-11.5-8.9,0-2.3}]
in degrees
2.929 deg
My question is this: Why?
Based on the visual example provided I would have expected different results.