Finding the Angle of a VectorDate: 05/10/2000 at 08:15:20 From: Patrick de Kruif Subject: Calculating the angle of a vector I can't figure this one out. I need to know the angle (in radians) for a vector (x,y) that originates from O (0,0). I found some formulas on your page to rotate a point around the origin; however, I need it the other way around. Pi/2 (x,y). | \ | \|a Pi -------+------- 0 | | | 3Pi/2 where a is the angle and '.' is the point in space (x,y). I hope you can help me with this. Many thanks, Patrick Date: 05/10/2000 at 08:37:11 From: Doctor Jerry Subject: Re: Calculating the angle of a vector Hi Patrick, If you divide {x,y} by its length sqrt(x^2+y^2), then you have a vector of unit length: {x/sqrt(x^2+y^2),y/sqrt(x^2+y^2)} There is a unique number t between 0 and 2pi (or between 0 and 360) such that: cos(t) = x/sqrt(x^2+y^2) and sin(t) = y/sqrt(x^2+y^2) t is the angle you want. - Doctor Jerry, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/