Find the distance from the point to the line
Set up the cross-product formula. For a line through a point with direction , the distance from is
Here is the origin, so and . Geometrically the numerator is the area of the parallelogram spanned by the two vectors, and dividing by the base leaves the height — which is exactly the distance.
Compute the cross product.
The middle component uses the minus sign built into the determinant expansion, which is where sign errors concentrate.
Take the two lengths.
Divide to get the distance.
Cross-check with the projection method. The foot of the perpendicular is at parameter
giving the foot . The distance from to that point is — the same value by an independent route.
Need to solve a different problem like this? Open the solver →