How it’s calculated
A straight line can be written three common ways. With slope m and y-intercept b, or through the point (x₁, y₁):
The y-intercept is b (where x = 0) and the x-intercept is −b ÷ m (where y = 0). A line perpendicular to this one has slope −1 ÷ m, and a parallel line has the same slope m.
Example: the points (1, 3) and (3, 7). The slope is (7 − 3) ÷ (3 − 1) = 2, so b = 3 − 2 × 1 = 1 and the line is y = 2x + 1. In point-slope form y − 3 = 2(x − 1); in standard form 2x − y = −1. The x-intercept is −1 ÷ 2 = −0.5 and the perpendicular slope is −0.5.
Special cases: a vertical line (equal x values) is x = constant and has no slope; a horizontal line (slope 0) is y = constant, and its perpendicular is vertical. Standard form is shown with whole-number coefficients (A > 0) when your inputs allow it.
Frequently asked questions
How do I find the equation of a line through two points?
Work out the slope m = (y₂ − y₁)/(x₂ − x₁), then use y − y₁ = m(x − x₁) and rearrange to y = mx + b.
What if the two points have the same x?
The line is vertical: x = that value. It has an undefined slope and no slope-intercept form, and the calculator shows it as x = constant.
How do I get the perpendicular slope?
Take the negative reciprocal of the slope: −1/m. Perpendicular lines have slopes that multiply to −1. A horizontal line has a vertical perpendicular, which has no slope.
What is standard form?
Ax + By = C, usually with whole-number A, B and C and A positive. It is handy for finding intercepts and for solving systems of equations.
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- College Algebra 2e, §4.1 Linear Functions (slope, point-slope and slope-intercept forms, parallel and perpendicular lines) — OpenStax
- College Algebra 2e, §2.1 The Rectangular Coordinate Systems and Graphs (finding x- and y-intercepts) — OpenStax
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator