What this calculator does
This tool finds the shortest (perpendicular) distance from a point (x₀, y₀) to a straight line written in general form \(Ax + By + C = 0\) in the two-dimensional plane. It is a pure-geometry calculator, so it applies everywhere with no country- or unit-specific assumptions — the answer is in whatever units your coordinates use.
How to use it
Write your line in the form \(Ax + By + C = 0\). For example, the line \(y = 2x + 1\) becomes \(2x - y + 1 = 0\), so \(A = 2\), \(B = -1\), \(C = 1\). Enter A, B and C, then enter the coordinates of your point. The calculator returns the perpendicular distance, the signed distance, and the normalizing factor \(\sqrt{A^2 + B^2}\).
The formula explained
The distance is given by $$d = \dfrac{|A x_0 + B y_0 + C|}{\sqrt{A^2 + B^2}}.$$ The numerator measures how far the point is from satisfying the line equation, and dividing by the length of the normal vector \((A, B)\) converts that into a true geometric distance. Dropping the absolute value gives the signed distance: a positive sign means the point is on one side of the line, negative on the other.
Worked example
Take the line \(3x + 4y - 5 = 0\) and the point \((2, 3)\). The numerator is \(|3 \cdot 2 + 4 \cdot 3 - 5| = |6 + 12 - 5| = 13\). The denominator is \(\sqrt{3^2 + 4^2} = \sqrt{25} = 5\). So $$d = \frac{13}{5} = 2.6 \text{ units.}$$
FAQ
How do I convert \(y = mx + b\) into \(Ax + By + C = 0\)? Rearrange to \(mx - y + b = 0\), giving \(A = m\), \(B = -1\), \(C = b\).
What if A and B are both zero? Then \(Ax + By + C = 0\) is not a valid line and the distance is undefined; the calculator returns 0 to avoid dividing by zero.
What does the signed distance tell me? Its sign indicates which side of the line the point lies on, which is useful for half-plane tests and orientation checks.