How to use this calculator
Find the perpendicular foot of point P on the infinite line through distinct points A and B.
- Enter Line point A x, Line point A y, Line point B x, Line point B y, then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
How Point projection onto line calculator works
Find the perpendicular foot of point P on the infinite line through distinct points A and B.
Inputs and units
- Line point A x: Line endpoint A x-coordinate.
- Line point A y: Line endpoint A y-coordinate.
- Line point B x: Line endpoint B x-coordinate; together with A defines the direction.
- Line point B y: Line endpoint B y-coordinate.
- Point P x: Point P x-coordinate.
- Point P y: Point P y-coordinate.
Formula and method
Q=A+[((P−A)·(B−A))/|B−A|²](B−A)
Worked example
For A=(0,0), B=(4,0), and P=(2,3), the perpendicular projection is Q=(2,0).
Interpreting the result
The perpendicular distance from P to the line is the shortest Euclidean distance; the along-line parameter is not clamped to segment AB.
Assumptions and limits
A and B must differ. Coordinates share a Cartesian system and units; projecting onto a segment instead would clamp the parameter to [0,1].
Frequently asked questions
Is the result restricted to the segment from A to B?
No. The calculator projects onto the infinite line, so the result may lie beyond either endpoint.
Why must A and B differ?
Two identical endpoints do not define a line direction.
How do I use the Point projection onto line calculator?
Enter Line point A x, Line point A y, Line point B x, Line point B y, then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Point projection onto line?
For A=(0,0), B=(4,0), and P=(2,3), the perpendicular projection is Q=(2,0).
What does the Point projection onto line calculator calculate?
Find the perpendicular foot of point P on the infinite line through distinct points A and B.