Vectors in 3D
How do I find the angle between two vectors in 3D? Would the result be meaningful?
I know that in 2D, it''s just the inverse cosine of the dotrproduct over the magnitudes of the two vectors, but in 3d...
Eyrian
...project the vectors to the plane in which you are interested and do inverse cosine of the 2D dot product.
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
You still use the dot product. Its still a 2D problem, consider the plane that both vectors lie on.
ECKILLER
ECKILLER
ECKILLER
March 17, 2002 02:22 AM
the dot product of two vectors divided by the product of the lengths of those vectors is equal to the cosine of the angle between the vectors for vectors of any dimension.
quote:
Original post by Anonymous Poster
the dot product of two vectors divided by the product of the lengths of those vectors is equal to the cosine of the angle between the vectors for vectors of any dimension.
Mustn''t the vectors be coplanar?
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
quote:
Original post by Oluseyi
Mustn''t the vectors be coplanar?
Two vectors can be used to define a plane. At least in lighting calculations and the like, the plane you''re interested in is the plane formed by the two vectors. In those cases, you just use the dot product.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
quote:
Original post by Oluseyi Mustn''t the vectors be coplanar?
Any pair of vectors will always be co-planar.
quote:
Original post by sjelkjd
Any pair of vectors will always be co-planar.
For some reason I keep seeing two vectors that are perpendicular but do not act through any common points - are not coincident. I can''t see how they''re coplanar. Of course I see that any coincident vectors are coplanar; that''s trivial. This, though, has me stumped.
(This is why visualization can be a bad thing...)
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
March 18, 2002 11:05 AM
quote:
Original post by Oluseyi This is why visualization can be a bad thing...
Maybe you''re visualizing lines (with two endpoints each) instead of vectors...?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement