Reputation: 37
So I'm attempting to calculate if a point is inside of an angle. While researching, I came across many terms I am unfamiliar with. Essentially from a point (A) with a 120° angle protruding from point (A). I want to test if a secondary point (B) would be inside of the angle. All that is known is the degree of the angle and the degree at which the angle is facing and the X and Y values of both points. This will all be done in Java so any and all help is appreciated!
There is a point with two vectors protruding from said point. The angle that is known is the angle that is created by the protrusion of the two vectors.
Upvotes: 2
Views: 608
Reputation: 1819
First of all, an angle is not defined for two points -- only for two lines.
0°
2D-space. For a line, you need a point and a direction.90°
); normalize both your directional and normal vector so that sqrt(x^2+y^2) = 1
.(a/b)
or (b/a)
.You probably wanna take the absolute value of the result as well if you don't care about left and right.
Upvotes: 2