Need some help/direction, haven't had trig in several decades.
On a 2 dimensional grid, I have two line segments.
The first line Segment always starts at the origin $(0,0)$, and extends to $(1,0)$ along the $X$-axis.
The second line Segment intersects the first at the origin, and can extend to potentially anywhere within $(-1,-1)$ to $(1,1)$.
I need to always calculate the angle to the right of the first segment...
If this is already addressed in another post, please comment me the link.
UPDATE
I will have a single input of $(x,y)$ for the end of the 2nd segment...
so segment $A$ would be $(0,0)$ →$ (1,0)$ and segment $B$ would be $(0,0)$ → $(x,y)$ where $(x,y)$ can be anywhere inside $(-1,-1)$ and $(1,1)$ assuming that the scale is $0.1$.
Let me know If I can provide any additional information that will help.
UPDATE
OK... assuming that the first segment is running along the $Y$-axis... $A(0,0)$ and $B(0,1)$
And the second segment is running from $A(0,0)$ to $C(.4,.4)$ with a scale of .2....
$$\theta= \tan^{-1}{\dfrac{.4}{.4}}= 45$$
If I change C to $C(.4,-.4)$ I get.
$$\theta= \tan^{-1}{\dfrac{.4}{-.4}}= -45$$
Do I have to manually compensate for the quadrant because this seems to calculate based specifically on the axis... I would expect the 2nd one to come up as 135 degrees from the positive Y Axis...
What am I missing?
Just for posterity...
If I had $C(-0.4,-0.1)$ I would expect the result for the angle from the positive Y axis to this line segment to be roughly 255 degrees...
$$\theta= \tan^{-1}{\dfrac{.4}{-.1}}= 75.9637$$
Plus 180 from starting at the positive Y axis....
