I have been doing some work to analyze sets of 5 points in the general configuration.
[![5 points in 3 space]] : https://i.stack.imgur.com/ln51Z.jpg
One question I am addressing is whether or not points A, B, E, and D are in the same plane. I am calculating this by the following method.
- I have vectors vBA, vBD, and vBE already calculated.
- vectors vBA and vBD form the plane pABD
- vectors vBA and vBE form the plane pABE
- planes pABD and pABE intersect along the vector vBA
I can calculate the angle at which pABD and pABE intersect along vBA by taking the vector rejection of vBD against vBA and the vector rejection of vBE against vBA and then calculating the angle between the rejection vectors.
Sine the rejection of vBD against vBA lies in the plane pABD and is perpendicular to vBA, the rejection of vBE against vBA lies in the plane pABE and is perpendicular to vBA, and both rejection vectors have their tail at the point B, the angle between these rejection vectors should be the angle at which the planes intersect.
I also calculate the plane intersection angles of pABE & pDBE along vBE and pEBA & pDBA along vBD. If all three of these plane intersection angles are equal to pi, then the points B,A,D,E are all in the same plane.
I originally tried this by calculating the cross products of the the vector combinations BAxBD, BAxBE, and BExBD. I then took that angles between each pair of cross product vectors and if the angles were equal to pi or 0, then the points were all in the same plane.
In programming, the concept of "equal to" is imprecise. It is difficult to evaluate if a real number is equal to 0, let alone pi. Realistically, you can say if it falls in some range around a number. At the moment, I am using 1x10^-9 as a tolerance, meaning that I call a value equal to pi if the value falls in the range of pi +/- 1x10^-9 inclusive. I found that with the cross product approach, I had difficulty creating real world examples (not integers) of 4 points in the same plane where all three cross product vectors were equal to pi or 0 given the above tolerance.
By using the plane intersection by vector rejections, there are fewer computational steps. When comparing the plane intersection angles, I am not going the last step to convert to radians but just taking the cosine as the dot product of the two vectors divided by the product of the vector magnitudes. This way I just have to ask if the plane intersection cosine is equal to -1. With this method, my real world examples are within 2x10^-16 of -1.
This is one such example,
id x y z
B -0.394666 -0.0990807 -0.610038
A 1.90877 1.16538 -0.268284
D -0.672164 -0.83449 -1.06511
E -0.707941588 0.02009757 -0.449844072
C -15.359866 -23.1923807 21.479662
ABD_EBD plane intersection cosine = -1 ABE_DBE plane intersection cosine = -1.000000000000000222 EBA_DBA plane intersection cosine = -0.999999999999999889
I have some questions regarding this methodology.
- Is the method of using plane intersection angles valid and supportable?
- Am I right that I can just evaluate if the cosine of the rejection vectors is -1 instead of taking the arc cosine and evaluating if the angle is equal to pi?
- What is a reasonable tolerance to use when evaluating equivalencies given that I am using double precision on a 64-bit operating system? Can someone with experience tell me if 1x10^-9 is too small or too large?
- please let me know if you want me to post any of the formulas I am using to calculate the different steps described above? Also let me know if more pictures are required.
Thanks for the advice,