# maths - sin between vectors

This topic is 4327 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

whats the easiest way to get the sin of the angle between two vectors? i could only think of doing sin(acos(dot(x,y)), (is that even right?) but thought there is probably a simpler way.

##### Share on other sites
|| A x B || = ||A|| ||B|| sin(angle)

##### Share on other sites
WhardieJones, hi dude - do you mean || A dot B || = ||A|| ||B|| sin(angle) ?

I use something like Angle = ArcSin ( (A•B) / (|A|*|B|) )

##### Share on other sites
Quote:
 Original post by WhardieJones|| A x B || = ||A|| ||B|| sin(angle)

The formula is not correct.
A.B = |A||B| cos(angle)
A perpendicular to B gives A.B = 0 and sin(pi/2) = 1 AFAIK.

Together with sin*sin+cos*cos = 1 you end up with
                    A.Bsin(a) = sqrt(1 - (------)2)                   |A||B|

'.' beeing the dot product, of course.

This is another solution to your problem. I guess you'll find many more (playing with sin, cos and tan is rather fun :)) be aware that you are limited to values of sin(a) that are in [0,1] - ie a in[0,pi]. In fact, the formula dont' allow you to know if you are in [0,pi] or in [pi,pi*2] (because of the sqrt)

Regards,

##### Share on other sites
Quote:
Original post by Emmanuel Deloget
Quote:
 Original post by WhardieJones|| A x B || = ||A|| ||B|| sin(angle)

The formula is not correct.
A.B = |A||B| cos(angle)
I think he means for x to be the cross product, in which case the formula is correct.

##### Share on other sites
||A x B|| = ||A|| ||B|| sin(angle) - cross product
||A . B|| = ||A|| ||B|| cos(angle) - dot product

##### Share on other sites
Quote:
 || A x B || = ||A|| ||B|| sin(angle)

Quote:
 Original post by Emmanuel Deloget'.' beeing the dot product, of course.

'x' being the cross product, of course.

##### Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
 || A x B || = ||A|| ||B|| sin(angle)

Quote:
 Original post by Emmanuel Deloget'.' beeing the dot product, of course.

'x' being the cross product, of course.

Thanks for the clarification, mister anonymous poster [razz]

Since it was not very clear that the OP needed to have a 3D formula, I incorrectly assumed that cross product wouldn't be used. Thus, in my mind, the answer was "dot product" and I thought the formula was wrong.

I praise you, dear AP, to allow me to apologize for this horrible, terrible, deadly mistake.

##### Share on other sites
Quote:
 Original post by Emmanuel DelogetI praise you, dear AP, to allow me to apologize for this horrible, terrible, deadly mistake.

In the name of Euclid, the Pythagoreans, and Euler, your sines are forgiven you. May Gauss have mercy on your soul!