Formula and Method for the Perpendicular Line Calculator
Two lines in a plane are perpendicular when they meet at a right angle (90°). For non-vertical lines written in slope-intercept form, this happens exactly when their slopes are negative reciprocals of each other: if the original line has slope m₁, any line perpendicular to it has slope m₂ = -1 / m₁, so that m₁ × m₂ = -1. This calculator takes a line y = m₁x + b₁ and a point (x₀, y₀), then builds the unique line through that point which is perpendicular to the given line.
How the calculation works
First, the calculator negates and inverts the original slope to get the perpendicular slope: m₂ = -1/m₁ (if m₁ = 0, the original line is horizontal and the perpendicular line is vertical, x = x₀, since a vertical line has no defined slope). Next, it applies point-slope form with the perpendicular slope and the given point: y - y₀ = m₂(x - x₀), which rearranges into slope-intercept form as y = m₂x + (y₀ - m₂x₀). It then finds the foot of the perpendicular — the point where the two lines cross — by solving m₁x + b₁ = m₂x + (y₀ - m₂x₀) for x, then substituting back into either line's equation for y. Finally, it computes the perpendicular distance from (x₀, y₀) to the original line using d = |m₁x₀ - y₀ + b₁| / √(m₁² + 1), which should match the straight-line distance from (x₀, y₀) to the foot of the perpendicular.
Common mistakes
- Using the reciprocal instead of the negative reciprocal: a slope of 2 has a perpendicular slope of -1/2, not 1/2 (that would be the slope of a parallel line scaled incorrectly) or -2.
- Forgetting the vertical/horizontal special case: a horizontal line (slope 0) is perpendicular to a vertical line (undefined slope), which cannot be expressed as m₂ = -1/0 in ordinary arithmetic.
- Mixing up the original point and the foot of the perpendicular: the perpendicular line passes through your given point (x₀, y₀); the foot of the perpendicular is a different point, where that new line actually meets the original line.
Real-world applications
- Construction and carpentry use perpendicular lines to square corners, walls, and foundations before building continues.
- Computer graphics and physics use perpendicular slopes to compute surface normals and reflection angles.
- Navigation and surveying use the point-to-line distance formula to find the shortest path from a location to a road, boundary, or flight path.
- Geometry and calculus problems use this construction to find the shortest distance between a point and a curve's tangent line, or to derive altitude lines in triangles.