Advertisement

Line equation from two points calculator

Enter two distinct points in 2D or 3D to find the line through them. Additional modes convert known line forms and evaluate coordinates.

Calculator

Standard coefficient A
6.00000000
Standard coefficient B
-3.00000000
Standard constant C
0.00000000
Standard equation Ax + By = C
(6)x + (-3)y = 0
Slope m
2.00000000
y intercept b
-0.00000000
x intercept
0.00000000
Point-slope equation
y - (0) = (2)(x - 0)
Line angle in (-90, 90] degrees
63.4349
Grade
200.000000%
Rise
6.00000000
Run
3.00000000
Distance between supplied points
6.70820393

Advertisement

How this calculator works

A line in a plane can be written as Ax + By = C. When B is nonzero, isolating y gives slope -A/B and intercept C/B. Subtracting the supplied points gives the line direction, rise, run and segment length. Both points satisfy the resulting equation, which extends beyond the finite segment in either direction. A vertical line is retained in standard form and has no slope or y intercept. Spatial points instead define P + t(Q - P), which works even when individual direction components are zero. Form conversion, point-slope, grade and rise/run tasks share these relations on this page.

Formula

m = rise/run; grade = 100m percent; theta = atan(m). Standard to slope form: m = -A/B, b = C/B. Point-slope: y - y0 = m(x - x0). Spatial line: R(t) = P + t(Q-P).

Worked example

Points (1, 3) and (3, 7) give rise 4 and run 2, so m = 2 and b = 1. The equation is y = 2x + 1, or 2x - y = -1. A 50% grade has slope 0.5 and angle about 26.565051 degrees.

Advertisement

Frequently asked questions

Can this represent vertical lines?

Yes. Use two points or standard form. A vertical line has B = 0, so its slope and grade outputs are omitted.

Is 100% grade a right angle?

No. It means rise equals run, giving slope 1 and an angle of 45 degrees.

Why does a 3D line use a parameter?

A single equation in x, y and z usually describes a plane. A parametric line specifies all three coordinates with one real parameter.

Does this draw a graph?

It returns numeric properties and equations. No graph is rendered.

Sources

Advertisement