Enter two vector lines using points and directions. Get distance, closest points, and case classification. Export results, inspect formulas, and verify geometry clearly today.
| Line 1 Point | Line 1 Direction | Line 2 Point | Line 2 Direction | Expected Case | Expected Distance |
|---|---|---|---|---|---|
| (1, 0, 1) | (2, 1, -1) | (0, 2, 3) | (1, -1, 2) | Skew | 2.8735 |
This sample shows two skew lines. Use the example button to load the same values into the calculator.
Let the lines be written as:
Line 1: r = P1 + λd1
Line 2: r = P2 + μd2
For non-parallel lines, the shortest distance is:
Distance = |(P2 - P1) · (d1 × d2)| / |d1 × d2|
For parallel lines, the shortest distance is:
Distance = |(P2 - P1) × d1| / |d1|
The calculator also solves for the closest-point parameters λ and μ using dot-product equations. Those parameters locate the exact nearest point on each vector line.
Enter one known point on the first line. Then enter its direction vector.
Enter one known point on the second line. Then enter its direction vector.
Set the decimal precision if you need more or fewer displayed digits.
Adjust the graph span multiplier to extend the displayed lines in the 3D graph.
Press Calculate. The result appears above the form, including the distance, line relationship, closest points, parameters, and graph.
Use the export buttons to save the calculated result as CSV or PDF.
You need one point and one direction vector for each line. That means twelve numeric values in total for the two 3D vector lines.
Skew lines are lines in 3D that do not intersect and are not parallel. The calculator identifies this case and returns their shortest connecting distance.
It switches to the parallel-line distance formula. That formula uses a cross product between the point difference and a direction vector, then divides by the direction magnitude.
Yes. When the computed shortest distance is effectively zero, the calculator marks the lines as intersecting. For coincident parallel lines, it marks them as coincident.
These parameters show where the closest points lie along each line. They help verify the geometry and are useful in algebra, graphics, and engineering problems.
The distance uses the same units as your coordinate system. If your coordinates are in meters, the shortest distance is also in meters.
No. Scaling a direction vector changes the line parameter values, but not the actual line. The shortest distance remains the same.
Floating-point arithmetic can introduce very small numerical differences. That is normal in geometry calculations, especially when lines nearly intersect or are almost parallel.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.