p0 is the intersection point of the vector and the plane
p is a point on the plane (any point can be the center point of the plane)
n is the plane normal vector
d is the distance from the starting point of the vector to the intersection point
L is the vector direction
LP is the starting point (any point on the line)
*multiplication
·Click to multiply
Formula 1: (p0-p) n = 0; the vector on the plane is perpendicular to the normal vector
Formula 2: p0=LP+d*L;//Vector starting point + vector direction* (the distance between the intersection point and the starting point is the intersection point)
Derivation:
Substitute Equation 2 into Equation 1 to get
(LP+d*L-P)·n=0;
The dot product satisfies the commutative law
(LP-P)·n+d*L·n=0
0-(p-LP)·n=dL·n
(0-p+LP)·n=dL·n
(p-LP)·n=dL·n
The dot product satisfies the associative law
式3: d=(p-LP)·n/L·n
p known LP known n known L known
Bring in to calculate the distance
Bring the result calculated by formula 3 into formula 2 to get the intersection point