Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Equation of the line
y = 2x + 1
slope-intercept form
Slope (m) 2
Y-intercept (b) 1

What this calculator does

This tool finds the equation of a straight line that is either parallel or perpendicular to a line of known slope m and that passes through a specified point (x₁, y₁). It returns the answer in the familiar slope-intercept form, \(y = mx + b\), along with the computed slope and y-intercept.

How to use it

Enter the slope of the reference line, the coordinates of the point your new line must pass through, and choose whether you want a parallel or perpendicular line. The calculator instantly returns the new slope, the y-intercept, and the full equation.

The formula explained

Two non-vertical lines are parallel when they share the same slope, so the new slope equals m. They are perpendicular when the product of their slopes is -1, so the new slope is the negative reciprocal, \(-1/m\). Starting from the point-slope form $$y - \text{y}_1 = \text{m}_{\text{new}}\left(x - \text{x}_1\right)$$ we expand to slope-intercept form where \(b = \text{y}_1 - \text{m}_{\text{new}} \cdot \text{x}_1\). If the original line is horizontal (\(m = 0\)), a perpendicular line is vertical and is written as \(x = \text{x}_1\).

Coordinate plane showing a reference line with two new lines through a point, one parallel and one perpendicular
A parallel line shares the same slope; a perpendicular line's slope is the negative reciprocal.

Worked example

Find the line perpendicular to \(y = 2x + 5\) through the point (4, 1). The negative reciprocal of 2 is \(-1/2\), so \(\text{m}_{\text{new}} = -0.5\). Then $$b = 1 - (-0.5)(4) = 1 + 2 = 3.$$ The equation is \(y = -0.5x + 3\).

Coordinate plane illustrating a line passing through a given point with slope triangle showing rise over run
The point-slope form uses one known point and the slope to build the equation.

FAQ

What if the slope is zero? A parallel line stays horizontal (\(y = \text{constant}\)); a perpendicular line becomes vertical and is shown as \(x = \text{x}_1\) because its slope is undefined.

Does the point have to be on the original line? No. The point only defines where the new line passes; it can be anywhere in the plane.

Why negative reciprocal for perpendicular? Because two perpendicular slopes multiply to -1, so \(\text{m}_{\text{new}} = -1/m\).

Last updated: