The angle between two 3D lines

3 replies · 28K views · last reply
somy
Messages
137
Reaction score
0
Can anyone tell me how can I calculate the angle between two lines in 3D. I need in my codings.
I know it has a simple solution. but I really have mixed up!
Thanks.
 
If the two lines actually intersect, then the angle is given by
[tex]cos(\theta)= \frac{u\cdot v}{|u||v|}[/tex] where u and v are any vectors pointing in the direction of each line. You can use the point of intersection and one point on each line to define those vectors.

If the line do not intersect (the "typical" case in 3d) then there is no angle between them.
 
Last edited by a moderator: