First, the straight line equation is transformed into a symmetric form, and its direction vector n1=(a1, b1, c1), n2=(a2, b2, c2) is obtained.
Multiply the two vectors to obtain the common vertical vector N=(x, y, z), and select the points A and B (arbitrary) on the two lines to obtain the vector AB. The projection of the vector AB in the vector N direction is two. The distance between the different lines (that is, the shortest distance), know how to ask?
d=|vector N* vector AB|/|vector N| (the above is the product of the two vectors, the following is the modulo), let the intersection point be C, D, bring into the symmetry of the vertical perpendicular N, and because C , D two points respectively satisfy the beginning of the line equation, so get two equations about C (or D), respectively, just solve it.
Formula:
Point A straight line through A(a1,b1,c1), parallel to Vector V1(p1,q1,r1)
Point A(1,3,2)
Vector V1(1,1,1)
Point A straight line through B(a2,b2,c2), parallel to Vector V1(p2,q2,r2)
Point B ( 1,2,3)
Vector V2 (1,1,1)
Click "calculate" to output the result
The shortest distance between two straight lines(d): 1.414213562373095
Powered by TorCMS (https://github.com/bukun/TorCMS).