I assume that you are familiar with vector and cross product in three dimension.
A line is defined by two points x_1, x_2:
x==x_1+(x_2-x_1)*s
where s is a variable.
The normal vector of skew lines l_1 (x_1,x_2) and l_2 (x_3,x_4) is the cross product of vectors (x_2-x_1) and (x_4-x_3)
N==(x_2-x_1)x(x_4-x_3)
and normalize it, we get
n==(x_2-x_1)x(x_4-x_3)/|(x_2-x_1)x(x_4-x_3)|
so the distance between line l_1 and line l_2 is
d==n.(x_3-x_1)
Easy? For more informations about vector and geometry, please refer to
http://mathworld.wolfram.com/topics/Geometry.html
No comments:
Post a Comment
Please post your comment here. ;)