Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to verify if vectors are in the same plane [closed]

Tags:

math

I have a collection of 3D vectors. How do I verify if these Vectors are in the same plane

like image 256
Razack Avatar asked Jul 12 '11 14:07

Razack


People also ask

How do you know if two points are on the same plane?

Put the coordinates of the given points in the equation of plane and store the values in variables P1 and P2. Check the sign of the obtained values: If P1 and P2 have the same parity, then they are on the same side of the plane. If P1 and P2 have different parity then they lie on the opposite sides of the plane.

How do you know if four vectors lie on the same plane?

Call the four points: P, Q, R, and S. Find the equation of the plane that contains P, Q, and R (see below). Plug S into the equation and check to see if it is a solution. Answer: If S is also a solution to the equation; all four points are on the same plane.


1 Answers

First, you should select one of your N points and subtract its coordinates from all the other N-1 point coordinates. You thus get a collection of N-1 vectors. The question of whether the N points are in the same plane is equivalent to knowing whether the N-1 vectors are in a plane that goes through the origin.

The determinant of any matrix 3x3 made of three vectors is zero if and only if the three vectors are in the same plane. You could set two columns to two fixed, non-colinear vectors from your set (this defines a plane that contains the origin), and then check all the other vectors successively by setting the third column of the matrix to their coordinates, calculating its determinant, and checking that it is zero to some precision. As noted by woodchips, calculating a determinant with a good precision is not completely trivial, so it is best to use a well-tested function, for this (like a function in a matrix package).

Another, computationally faster and more precise approach is to take two of your vectors, make sure that they define a plane (i.e. that they are not colinear), and then calculate their cross product: this gives you a vector normal to the plane. Then, you can make sure that each other vector is in the same plane by performing a dot product with the normal vector: this dot product is zero only if the new vector is in the same plane as your first two vectors.

You can test whether two vectors are colinear or not by calculating the norm of their cross product: if the norm is not zero (to a given precision), then the vectors are not colinear.

like image 126
Eric O Lebigot Avatar answered Sep 30 '22 20:09

Eric O Lebigot