I'd go for what you call algebraic form. A point (x,y,z)
is on a plane (a,b,c,d)
if a*x+b*y+c*z+d=0
.
To intersect that plane with a line spanned by (x1,y1,z1)
and (x2,y2,z2)
, compute s1=a*x1+b*y1+c*z1+d
and s2=a*x2+b*y2+c*z2+d
. Then your point of intersection is defined by
x=(s1*x2-s2*x1)/(s1-s2)
y=(s1*y2-s2*y1)/(s1-s2)
z=(s1*z2-s2*z1)/(s1-s2)
To compute the angle between a line and a plane, simply compute
sin(α)=(a*x+b*y+c*z)/sqrt((a*a+b*b+c*c)*(x*x+y*y+z*z))
where (a,b,c)
represents the normal vector in this representation of the plane, and (x,y,z)
is the direction vector of the line, i.e. (x2-x1,y2-y1,z2-z1)
. The equation is essentially a normalized dot product, and as such is equivalent to the cosine between the two vectors. And since the normal vector is perpendicular to the plane, and sine and cosine differ by 90°, this means that you get the sine of the angle between the line and the plane itself.