acalculator

Parallel and perpendicular lines?

Give a line by its slope and intercept, two points, or Ax + By = C, then the point the new lines pass through. The parallel and perpendicular line calculator gives both lines in exact fractions, the foot of the perpendicular and the distance from the point to the line.

Your numbers

The line
Parallel; perpendicular
y = 3x − 9; y = −(1/3)x + 1

Through (3, 0): parallel y = 3x − 9; perpendicular y = −(1/3)x + 1.

Parallel line
y = 3x − 9
Parallel line, standard form
3x − y = 9
Perpendicular line
y = −(1/3)x + 1
Perpendicular line, standard form
x + 3y = 3
Given line
y = 3x + 6
Slope of the given line
3
Perpendicular slope
−0.3333333333
Foot of the perpendicular
(−3/2, 3/2)
Distance from the point to the line
4.74341649

Parallel; perpendicular: y = 3x − 9; y = −(1/3)x + 1. Through (3, 0): parallel y = 3x − 9; perpendicular y = −(1/3)x + 1.

How to calculate

Parallel and perpendicular line calculator: the lines through a point that are parallel and perpendicular to a given line, in slope-intercept and standard form, with the foot of the perpendicular and the distance.

Example with the default inputs (The line y = mx + b, Slope (m) 3, y-intercept (b) 6, Point x 3, Point y 0): Through (3, 0): parallel y = 3x − 9; perpendicular y = −(1/3)x + 1.

Method: Given line ax + by = c and point (p, q): parallel ax + by = ap + bq (slope m = −a/b); perpendicular bx − ay = bp − aq (slope −1/m); foot (p − ta, q − tb) with t = (ap + bq − c) ÷ (a² + b²); distance |ap + bq − c| ÷ √(a² + b²).

  • Every number is read exactly as typed: 0.1 is 1/10, so slopes, intercepts and the foot are exact fractions.
  • A vertical line (x = c) has no slope; the line perpendicular to it is horizontal, and the reverse.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. The line y = mx + b, Slope (m) 3, y-intercept (b) 6, Point x 3, Point y 0 gives Parallel line y = 3x − 9, Perpendicular line y = −(1/3)x + 1, Parallel line, standard form 3x − y = 9, Perpendicular line, standard form x + 3y = 3, Slope of the given line 3, Perpendicular slope -0.333333.Source: OpenStax, College Algebra 2e, §4.1 Linear Functions (parallel lines have the same slope; perpendicular slopes are negative reciprocals whose product is −1), https://openstax.org/books/college-algebra-2e/pages/4-1-linear-functions (retrieved 2026-10-18), Example 19: the line parallel to f(x) = 3x + 6 through (3, 0) is g(x) = 3x − 9
  2. The line y = mx + b, Slope (m) 3, y-intercept (b) 1, Point x 1, Point y 7 gives Parallel line y = 3x + 4, Parallel; perpendicular y = 3x + 4; y = −(1/3)x + 22/3.Source: OpenStax, College Algebra 2e, §4.1 Linear Functions (parallel lines have the same slope; perpendicular slopes are negative reciprocals whose product is −1), https://openstax.org/books/college-algebra-2e/pages/4-1-linear-functions (retrieved 2026-10-18), Writing Equations of Parallel Lines: f(x) = 3x + 1 through (1, 7) gives y = 3x + 4
  3. The line y = mx + b, Slope (m) 2, y-intercept (b) 4, Point x 4, Point y 0 gives Perpendicular line y = −(1/2)x + 2, Perpendicular slope -0.5, Foot of the perpendicular (−4/5, 12/5).Source: OpenStax, College Algebra 2e, §4.1 Linear Functions (parallel lines have the same slope; perpendicular slopes are negative reciprocals whose product is −1), https://openstax.org/books/college-algebra-2e/pages/4-1-linear-functions (retrieved 2026-10-18), Writing Equations of Perpendicular Lines: f(x) = 2x + 4 and (4, 0) give y = −(1/2)x + 2
  4. The line Two points, x₁ -2, y₁ 6, x₂ 4, y₂ 5, Point x 4, Point y 5 gives Perpendicular line y = 6x − 19, Given line y = −(1/6)x + 17/3, Parallel line y = −(1/6)x + 17/3, Slope of the given line -0.166667, Perpendicular slope 6, Distance from the point to the line 0.Source: OpenStax, College Algebra 2e, §4.1 Linear Functions (parallel lines have the same slope; perpendicular slopes are negative reciprocals whose product is −1), https://openstax.org/books/college-algebra-2e/pages/4-1-linear-functions (retrieved 2026-10-18), Example 21: slope −1/6, perpendicular slope 6, y = 6x − 19
  5. The line Ax + By = C, A 2, B 3, C 6, Point x 1, Point y 1 gives Parallel line y = −(2/3)x + 5/3, Parallel line, standard form 2x + 3y = 5, Perpendicular line y = (3/2)x − 1/2, Perpendicular line, standard form 3x − 2y = 1, Foot of the perpendicular (15/13, 16/13), Distance from the point to the line 0.27735.Source: OpenStax, College Algebra 2e, §4.1 Linear Functions (parallel lines have the same slope; perpendicular slopes are negative reciprocals whose product is −1), https://openstax.org/books/college-algebra-2e/pages/4-1-linear-functions (retrieved 2026-10-18)
  6. The line Two points, x₁ 2, y₁ 1, x₂ 2, y₂ 5, Point x -1, Point y 3 gives Given line x = 2, Parallel line x = −1, Perpendicular line y = 3, Foot of the perpendicular (2, 3), Distance from the point to the line 3.Source: OpenStax, College Algebra 2e, §4.1 Linear Functions (parallel lines have the same slope; perpendicular slopes are negative reciprocals whose product is −1), https://openstax.org/books/college-algebra-2e/pages/4-1-linear-functions (retrieved 2026-10-18)
  7. The line y = mx + b, Slope (m) 0.5, y-intercept (b) -1.25, Point x 0.1, Point y 0.2 gives Parallel line y = (1/2)x + 3/20, Perpendicular line y = −2x + 2/5, Perpendicular slope -2.Source: OpenStax, College Algebra 2e, §4.1 Linear Functions (parallel lines have the same slope; perpendicular slopes are negative reciprocals whose product is −1), https://openstax.org/books/college-algebra-2e/pages/4-1-linear-functions (retrieved 2026-10-18)

How it works

The page writes the given line as ax + by = c, exactly:

  • y = mx + b becomes mx − y = −b.
  • Two points (x₁, y₁) and (x₂, y₂) give (y₂ − y₁)x − (x₂ − x₁)y = (y₂ − y₁)x₁ − (x₂ − x₁)y₁. The two points must differ.
  • Ax + By = C is used as typed. A and B cannot both be 0.

For the point (p, q):

  • Parallel line: ax + by = ap + bq. It has the same slope m = −a ÷ b.
  • Perpendicular line: bx − ay = bp − aq. Its slope is −1 ÷ m, so the two slopes multiply to −1. When the given line is horizontal (m = 0) the perpendicular line is vertical, and when the given line is vertical (b = 0) the perpendicular line is horizontal.
  • Foot of the perpendicular: where the two lines cross, (p − ta, q − tb) with t = (ap + bq − c) ÷ (a² + b²).
  • Distance from the point to the line: the distance formula from (p, q) to the foot, which is |ap + bq − c| ÷ √(a² + b²). It is 0 when the point is on the line; then the parallel line is the given line itself.

Output format

  • Headline: the parallel line, a semicolon, then the perpendicular line, each in slope-intercept form.
  • Slope-intercept form y = mx + b, or x = c for a vertical line. Fractions are in lowest terms with the true minus sign; a fractional slope is written in brackets, y = −(1/3)x + 1; a slope of 1 or −1 is written x or −x; a zero intercept is left out; a horizontal line reads y = b.
  • Standard form Ax + By = C: whole numbers with no common factor, A positive (or B positive when A = 0); a coefficient of 1 is not written and a zero term is left out (x = 2, y = 3).
  • The foot is written (x, y) with exact fractions. The slopes and the distance show to 10 significant figures; the distance is exact when a² + b² times the square of its top is a square, and a 64-bit float otherwise.
  • Every box takes a whole number, a decimal (0.25), a fraction (1/3) or a mixed number (1 1/2), and reads it exactly: 0.1 is 1/10 and 1/3 stays 1/3. Commas and exponents are not accepted.

Worked examples by hand

Parallel and perpendicular to y = 3x + 6 through (3, 0). Parallel: 0 = 3 × 3 + b gives b = −9, so y = 3x − 9 (3x − y = 9). Perpendicular slope −1/3: 0 = −(1/3) × 3 + b gives b = 1, so y = −(1/3)x + 1 (x + 3y = 3).

y = 3x + 1 through (1, 7). Parallel: 7 = 3 + b, so y = 3x + 4. Perpendicular: 7 = −1/3 + b, so y = −(1/3)x + 22/3.

y = 2x + 4 through (4, 0). Perpendicular slope −1/2: 0 = −2 + b, so y = −(1/2)x + 2. The foot: 2x − y = −4 with t = (8 + 4) ÷ 5 = 12/5 gives (4 − 24/5, 12/5) = (−4/5, 12/5).

The line through (−2, 6) and (4, 5), and the point (4, 5). Slope (5 − 6) ÷ (4 + 2) = −1/6, so the given line is y = −(1/6)x + 17/3; the point is on it, so the parallel line is the same line and the distance is 0. Perpendicular slope 6: 5 = 24 + b, so y = 6x − 19.

2x + 3y = 6 and the point (1, 1). Parallel: 2x + 3y = 2 + 3 = 5, so y = −(2/3)x + 5/3. Perpendicular: 3x − 2y = 3 − 2 = 1, so y = (3/2)x − 1/2. t = (5 − 6) ÷ 13 = −1/13, so the foot is (1 + 2/13, 1 + 3/13) = (15/13, 16/13), and the distance is 1 ÷ √13 = 0.2773500981.

A vertical line. Through (2, 1) and (2, 5): x = 2. For the point (−1, 3): parallel x = −1, perpendicular y = 3, foot (2, 3), distance 3.

Decimals. y = 0.5x − 1.25 and the point (0.1, 0.2): parallel y = (1/2)x + 3/20, since 0.2 − 0.5 × 0.1 = 0.15; perpendicular slope −2, so y = −2x + 2/5, since 0.2 + 2 × 0.1 = 0.4.

Other questions people ask

How do you find a line parallel to a given line through a point?

Keep the slope and solve for the new intercept. For a line parallel to y = 3x + 6 through (3, 0): 0 = 3 × 3 + b, so b = −9 and the line is y = 3x − 9.

How do you find a line perpendicular to a given line through a point?

Use the negative reciprocal of the slope, then solve for the intercept. y = 3x + 6 has slope 3, so a perpendicular line has slope −1/3. Through (3, 0): 0 = −(1/3) × 3 + b, so b = 1 and the line is y = −(1/3)x + 1.

What are the slopes of perpendicular lines?

Their product is −1: each slope is the negative reciprocal of the other. Slopes 6 and −1/6 are perpendicular. A horizontal line (slope 0) is perpendicular to a vertical line, which has no slope.

How can you tell if two lines are parallel?

They have the same slope and different y-intercepts. If the intercepts are also the same, the two equations describe the same line.

What if the given line is vertical?

A vertical line x = c has no slope. A line parallel to it through (p, q) is x = p, and the perpendicular line is the horizontal line y = q.

How do you find the distance from a point to a line?

Find where the perpendicular line through the point crosses the given line (the foot), then use the distance formula. For ax + by = c and the point (p, q) this is |ap + bq − c| ÷ √(a² + b²): from (1, 1) to 2x + 3y = 6 it is 1 ÷ √13 = 0.277.