Computer Science Canada Trig angle detection |
Author: | Mayb123 [ Tue Oct 02, 2007 5:25 pm ] |
Post subject: | Trig angle detection |
as the subject line says, and how, in relation to a set coordinate do i make the angle correspond to the mouse? For example, if i have one point and then i want a line to extend through the mouse cursor, how do i use angles to draw the line directly to the cursor? |
Author: | Cervantes [ Tue Oct 02, 2007 10:10 pm ] | ||
Post subject: | RE:Trig angle detection | ||
Your example doesn't require that you know the angle. You could just do
But if you want to find the angle, you have to do little more than take the inverse tangent (arctan) of opposite over adjacent, plus some quadrant work. |