Foot of the perpendicular from (x₁, y₁) to the line ax + by + c = 0.
Given point P(x1,y1) and line L:ax+by+c=0.
The perpendicular from P to L has direction (a,b) (the normal to L). Parametric equations of this perpendicular:
x=x1+at,y=y1+bt
The foot N is where this meets L:
a(x1+at)+b(y1+bt)+c=0
(ax1+by1+c)+t(a2+b2)=0
t=−a2+b2ax1+by1+c
Substituting back gives the foot:
ax−x1=by−y1=−a2+b2ax1+by1+c
The coordinates of N explicitly:
N=(x1−a2+b2a(ax1+by1+c),y1−a2+b2b(ax1+by1+c))