thanks a lot everyone.
Bernard
9/20/05, Kent Johnson <kent37 (AT) tds (DOT) netwrote:
Bernard Lebel wrote:
Hello,
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
math.acos(-0.0634)
1.6342388771557625
math.degrees(_)
93.634990377223801
Kent
>
>
>
Thanks
Bernard
Tutor maillist - Tutor (AT) python (DOT) org
>
>
>
Tutor maillist - Tutor (AT) python (DOT) org
Tutor maillist - Tutor (AT) python (DOT) org