Slope & Line Equation Calculator
Two points, a point and slope, or an equation — every form of the line, with steps.
The line
This is the last result worked out. Fix the input above to update it.
Equation of the line in every form
Point P and the second line
Table of values
| x | y |
|---|
Step by step
About the Slope & Line Equation Calculator
Give two points, a point and a slope (or the angle the line makes with the x-axis), or an equation in any form — y = 2x + 3, 3x − 4y + 12 = 0, y − 2 = 3(x + 1) — and get the slope, the angle of inclination, both intercepts and the line written in every standard form, with the working shown. Fractions and roots stay exact: the line through (1, 2) and (4, 6) has slope 4/3, not 1.3333.
Add a point P to get the parallel and perpendicular lines through it, its distance from the line, the foot of the perpendicular and P’s mirror image. Add a second line to find where the two meet and the angle between them, or how far apart they are when they are parallel. Everything is drawn on one graph with the same scale on both axes, so perpendicular lines look perpendicular.
How to use it
- Choose how you know the line: two points, a point and a slope, or an equation.
- Type the values. Coordinates and slopes can be fractions (3/4), decimals or roots (√3); type “undefined” as the slope of a vertical line, or switch to the angle of inclination.
- Optionally add a point P and a second line.
- Read the slope, intercepts and forms, follow the steps and the graph, and copy or download the result.
Examples
(1, 2) and (4, 6)
m = 4/3, y = (4/3)x + 2/3
Rise 6 − 2 = 4 over run 4 − 1 = 3. Standard form 4x − 3y = −2.
(2, −1), m = −3
y = −3x + 5
y + 1 = −3(x − 2). The angle of inclination is 180° − 71.57° = 108.43°.
3x − 4y + 12 = 0
m = 3/4, x-intercept −4, y-intercept 3
Intercept form x/(−4) + y/3 = 1.
3x + 4y − 10 = 0 and P(0, 0)
d = 2
|3·0 + 4·0 − 10| / √(3² + 4²) = 10/5. The foot of the perpendicular is (6/5, 8/5).
y = 2x + 1 and x + 2y = 7
they meet at (1, 3) at 90°
The slopes 2 and −1/2 multiply to −1, so the lines are perpendicular.
Common uses
- Homework on coordinate geometry: slopes, intercepts and converting between the forms of a line.
- Checking a ramp, roof or road gradient as rise over run, as an angle, or as a percentage (slope × 100).
- Finding where two straight-line trends cross — a break-even point, or where two routes meet.
- Working out the shortest distance from a point to a straight edge, wall or path.
Slope and angle of inclination
The slope m = (y₂ − y₁)/(x₂ − x₁) is the rise over the run: how much y changes when x increases by 1. The angle of inclination θ is the angle from the positive x-axis to the line, measured anticlockwise, with 0° ≤ θ < 180°, and m = tan θ. A horizontal line has slope 0; a vertical line has an undefined slope and θ = 90°. Parallel lines have equal slopes, and perpendicular lines have slopes that multiply to −1 (unless one of them is vertical).
The forms of a line
- Slope-intercept: y = mx + b, where b is the y-intercept.
- Point-slope: y − y₁ = m(x − x₁) through a known point (x₁, y₁).
- Standard: Ax + By = C, here with whole numbers that have no common factor and A ≥ 0 when the coefficients are rational.
- General: Ax + By + C = 0.
- Intercept: x/a + y/b = 1, only when the line crosses both axes away from the origin.
- Normal: x cos ω + y sin ω = p, where p ≥ 0 is the line’s distance from the origin and ω is the angle of the perpendicular from the origin.
- Parametric: x = x₁ + t·d₁, y = y₁ + t·d₂, with direction vector (d₁, d₂) = (B, −A).
Distances, angles and intersections
The distance from P(x₀, y₀) to Ax + By + C = 0 is |Ax₀ + By₀ + C| / √(A² + B²). Two parallel lines Ax + By + C₁ = 0 and Ax + By + C₂ = 0 are |C₁ − C₂| / √(A² + B²) apart. The acute angle φ between lines with slopes m₁ and m₂ satisfies tan φ = |(m₁ − m₂)/(1 + m₁m₂)|; when a line is vertical, the tool uses cos φ = |A₁A₂ + B₁B₂| / (√(A₁² + B₁²) · √(A₂² + B₂²)). The point where two lines meet is found with Cramer’s rule.
Limitations
- Straight lines in the plane only — for curves use the graphing calculator.
- Exact fractions and roots are kept while they stay short; otherwise results are decimals (double precision, about 15 significant digits).
- Equations must be linear in x and y. A fraction with x or y in the denominator, such as (y − 2)/(x − 1) = 3, is not read — multiply both sides first: y − 2 = 3(x − 1).
- The standard and general forms use whole-number coefficients only when every coefficient is rational.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
How do I find the slope from two points?
Subtract the y-values and divide by the difference of the x-values, in the same order: m = (y₂ − y₁)/(x₂ − x₁). For (1, 2) and (4, 6), m = (6 − 2)/(4 − 1) = 4/3. If x₂ = x₁, the line is vertical and the slope is undefined.
How do I convert standard form to slope-intercept form?
Solve for y. For 3x − 4y + 12 = 0: −4y = −3x − 12, so y = (3/4)x + 3 — slope 3/4, y-intercept 3. In general, Ax + By + C = 0 has slope −A/B and y-intercept −C/B.
What is the slope of a perpendicular line?
The negative reciprocal: if a line has slope m, a perpendicular has slope −1/m. For y = 2x + 1, every perpendicular has slope −1/2. A perpendicular to a horizontal line is vertical, and the other way round.
What does an undefined slope mean?
The line is vertical (x = a constant): the run x₂ − x₁ is 0, and dividing by 0 is not defined. Its angle of inclination is 90°. It has an x-intercept but no y-intercept, unless it is the y-axis itself.
How do I find the angle between two lines?
Use tan φ = |(m₁ − m₂)/(1 + m₁m₂)|. For y = x and y = 2x, tan φ = |(1 − 2)/(1 + 2)| = 1/3, so φ ≈ 18.43°; the other angle where they cross is 180° − φ. If 1 + m₁m₂ = 0, the lines are perpendicular.
What is the normal form of a line?
x cos ω + y sin ω = p, where p is the distance from the origin to the line and ω is the angle that the perpendicular from the origin makes with the x-axis. For x + y = 2, dividing by √(1² + 1²) = √2 gives x cos 45° + y sin 45° = √2.