I have planes in 3D space defined by a normal vector and a center point. I’d like to determine whether these planes are horizontal or perpendicular to the ground floor, or neither. Usually, this can be found by is how it can be found:
a.b = |a||b|cos(t)
where a and b are two 3D vectors.
If a.b = 0, then they are perpendicular to each other; If a.b is equal to the product of lengths of a and b, the cosine of t is 1 and t is 0, so they are parallel
But I don’t have a ground plane!!!!
Many thanks
You will need to identify what you’re calling a ground plane. A couple ways of determining this plane are:
Pick a reference ground plane. For instance if you’re interested in
using the X-Y plane as your ground plane, the normal you would use
is just
<0, 0, 1>.If your situations doesn’t permit easy use of an axially aligned reference
plane, pick three non-colinear points on your reference ground plane,
T,U,V. Then the normal to the plane containing the three pointsis given by
N = +/-[ (U-T) x (V-T) ]wherexis the cross productoperator.