[Tutor] Maths: getting degrees from radians (or am I wrong?)
kent37 at tds.net
Wed Sep 21 00:30:11 CEST 2005
Bernard Lebel wrote:
> I have this little math problem. I have this formula from wich I get a
> dot product between two vectors.
> cos(ß) = A.B / |A|.|B| = -0.0634
> So this would give me radians, right?
No, it's the cosine of ß, which has no units (a cosine is a ratio of two lengths)
> Then if I use
> math.degrees( -0.0634 )
> This gives me a value of -3.6325524211294193.
> However I have a book in front of me who says I should get a value of
> 93.635 degrees. mmmmm
> Btw, in the book, the equation is written
> ß = cos-1(-0.0634) = 93.635, where -1 is actually an exponent. Maybe
> I'm just interpreting this wrong?
The -1 means inverse. You have cos(ß) = -0.0634 - you want to find the angle whose cosine is -0.0634, i.e. (inverse cosine)(-0.0634). Another name for cos-1 is arccosine. In Python it is math.acos():
>>> import math
> Tutor maillist - Tutor at python.org
More information about the Tutor