Loading…

Line Equation Solver

Math Geometry • Coordinate Geometry

View all topics

Find the equation of a line from two points, slope + point, slope + intercept, or x/y-intercepts. The graph is interactive: drag to pan, wheel/trackpad to zoom, pinch on touch.

Inputs accept 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.

Inputs

Tip: In Two points mode, slope is \(m=\dfrac{y_2-y_1}{x_2-x_1}\). If \(x_1=x_2\), the line is vertical: \(x=x_1\).

Graph options

The tick spacing is adaptive to the zoom level to keep labels clean (no crowding).

Ready
Choose a mode and click Calculate.
Line diagram (pan/zoom enabled)

Drag to pan • wheel/trackpad to zoom • pinch on touch • “Reset view” fits the geometry.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

How do you find the equation of a line from two points?

Compute the slope m = (y2 - y1)/(x2 - x1) if x1 is not equal to x2, then use y - y1 = m(x - x1) or y = m x + b with b = y1 - m x1. If x1 equals x2, the line is vertical and has equation x = x1.

What is the difference between slope-intercept form and point-slope form?

Slope-intercept form is y = m x + b and is convenient for graphing because b is the y-intercept. Point-slope form is y - y0 = m(x - x0) and is convenient when a point on the line and the slope are known.

What happens if the line is vertical?

A vertical line has undefined slope because x2 - x1 = 0, so the slope formula would divide by zero. The equation is written as x = k, where k is the constant x-value of every point on the line.

How do you write a line equation from x-intercept and y-intercept?

If the line crosses the axes at (a, 0) and (0, b) with a and b not equal to 0, the intercept form is x/a + y/b = 1. This can be rearranged into other equivalent forms if needed.