Distance from a Point to a Line: Distance Formula
Loading the math board and drawing, please wait…
In collections
Functions, Equations, and Parametric Equations
This applet demonstrates the geometric derivation of the distance formula from a point to a line in the Cartesian plane. The construction begins with a general line expressed in standard form, Ax plus By equals C, and an arbitrary point P located at coordinates x sub 0 comma y sub 0. From point P, a perpendicular segment is drawn to the line, meeting it at the foot of the perpendicular, labeled point H. The length of this segment PH represents the shortest distance from P to the line, which is precisely the value given by the well-known distance formula: the absolute value of Ax sub 0 plus By sub 0 minus C, divided by the square root of A squared plus B squared.
The applet visually guides the viewer through the classical geometric proof. First, two auxiliary points are constructed on the line: one where a horizontal line through P intersects the given line, and another where a vertical line through P intersects the given line. These intersections, together with point H and point P, form a right triangle in which PH is the altitude to the hypotenuse. By invoking the area equivalence of the triangle computed in two ways, or alternatively by using similar triangles formed by the right triangle and its projections, the formula for the length of PH emerges naturally.
Interactive sliders allow the user to adjust the coefficients A, B, and C of the line equation as well as the coordinates of point P. As these parameters change, the line rotates and translates, the point P moves, and the perpendicular segment and all auxiliary constructions update dynamically. The numerical value of the distance is displayed in real time alongside the formula with the current parameter values substituted, letting students verify that the algebraic computation matches the geometric measurement at every step.
Key mathematical concepts highlighted include the relationship between perpendicularity and slope, the role of the normal vector with components A and B, the use of similar triangles in deriving the distance expression, and the connection between the standard form of a linear equation and the geometry of the plane. The applet also reinforces the idea that the distance from a point to a line is invariant under rigid motions and depends only on the relative position encoded by the signed expression Ax sub 0 plus By sub 0 minus C.
Designed for secondary school and early undergraduate mathematics courses, this GeoGebra applet is suitable for classroom instruction, self-study, and interactive exploration. It helps students move beyond memorizing the distance formula by showing where it comes from, how each term in the formula corresponds to a geometric feature, and why the denominator involves the norm of the normal vector. By manipulating the construction live, learners develop a deeper, more intuitive grasp of coordinate geometry and its power in solving classical distance problems.
GeoGebra Commands & Parameters
Intersect(a_1, OrthogonalLine[P, a_1]) → QSegment(P, Q) → distIntersect(a_1, OrthogonalLine[P, y = 0]) → AIntersect(a_1, OrthogonalLine[P, x = 0]) → BPoint(yAxis) → CPolygon(B, P, A) → poly1, a_2, b_1, pAngle(B, P, A) → αAngle(A, Q, P) → βmarkarclength(Q, P, F) → text5, gSegment(A, B) → hLine(P, p) → d
AI Drawing Prompt Reference
Draw a coordinate plane with a given line in standard form. Choose an arbitrary point P(x0, y0) and construct the perpendicular from P to the line, marking the foot of the perpendicular as H; the segment PH represents the shortest distance from the point to the line. Next, form two auxiliary intersections from P: draw the horizontal line through P and let it meet the given line at Q, and draw the vertical line through P and let it meet the given line at A and B. Connect A–P–B to form a polygon and indicate the relevant angles at P formed by the rays toward A and B. Include a visual length/label along PQ (and a mark related to PH) to support the geometric derivation in which PH acts as the altitude of a right-triangle configuration.
The prompt above was compiled from the original drawing commands and is for reference only.