Given three 3D points (A,B, & C) how do I calculate the normal vector? The three points define a plane and I want the vector perpendicular to this plane.
Can I get sample C# code that demonstrates this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends on the order of the points. If the points are specified in a counter-clockwise order as seen from a direction opposing the normal, then it’s simple to calculate:
where
xis the cross product.If you’re using OpenTK or XNA (have access to the Vector3 class), then it’s simply a matter of: