Perpendicular Line Calculator

Enter a line in slope-intercept form (y = m₁x + b₁) and a point, and this tool finds the perpendicular slope, the equation of the perpendicular line through that point, the foot of the perpendicular, and the distance from the point to the line.

Quick Facts

Negative reciprocal rule
m₂ = -1 / m₁
Two non-vertical lines are perpendicular exactly when m₁ × m₂ = -1.
Point-slope form
y - y₀ = m₂(x - x₀)
Gives the equation of the perpendicular line through a chosen point.
Point-to-line distance
d = |m₁x₀ - y₀ + b₁| / √(m₁² + 1)
The shortest distance from the point to the line, measured along the perpendicular.

Your Results

Calculated
Perpendicular Slope (m₂)
-
m₂ = -1 / m₁
Perpendicular Line Equation
-
Through (x₀, y₀)
Foot of Perpendicular
-
Intersection with the original line
Distance to Line
-
Shortest distance from (x₀, y₀)

Ready

Enter a line (m₁, b₁) and a point (x₀, y₀), then press Calculate.

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.

Frequently Asked Questions

How do you find the slope of a line perpendicular to another line?
Take the negative reciprocal of the original slope: m₂ = -1/m₁. Two non-vertical lines are perpendicular exactly when the product of their slopes equals -1 (m₁ × m₂ = -1). If the original line is horizontal (m₁ = 0), the perpendicular line is vertical, and vice versa.
How do I write the equation of a line perpendicular to y = mx + b through a given point?
Compute the perpendicular slope m₂ = -1/m₁, then use point-slope form with the given point (x₀, y₀): y - y₀ = m₂(x - x₀), which rearranges to y = m₂x + (y₀ - m₂x₀).
What is the foot of the perpendicular?
The foot of the perpendicular is the point where the perpendicular line through (x₀, y₀) meets the original line. It is found by solving the two line equations simultaneously, and it is also the closest point on the original line to (x₀, y₀).
How do you calculate the distance from a point to a line?
For a line written as m₁x - y + b₁ = 0, the shortest (perpendicular) distance from a point (x₀, y₀) to that line is d = |m₁x₀ - y₀ + b₁| / √(m₁² + 1). This distance is measured along the perpendicular line connecting the point to the foot of the perpendicular.