Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Line Equation
y = 0.75 x + 3
slope-intercept form (y = mx + b)
Slope (m = -b/a) 0.75
Y-intercept (b) 3
Inclination angle θ 36.869898 °

What this calculator does

This tool builds the equation of a straight line when you know only its two axis intercepts: the x-intercept a (where the line crosses the horizontal axis, point (a, 0)) and the y-intercept b (where it crosses the vertical axis, point (0, b)). From these two numbers it derives the slope-intercept equation \(y = mx + b\) and the line's inclination angle. It is pure coordinate geometry, so it works the same everywhere.

How to use it

Enter the x-axis intercept a and the y-axis intercept b. Neither value may be zero: if \(a = 0\) the line is vertical and the slope is undefined, and if \(b = 0\) the line passes through the origin so the intercept form breaks down. Choose whether you want the output angle in degrees or radians, then read off the equation, slope, intercept and angle.

The formula explained

The intercept form of a line is \(\frac{x}{a} + \frac{y}{b} = 1\). Multiplying through by \(b\) and isolating \(y\) gives \(y = \left(-\frac{b}{a}\right)x + b\). So the slope is \(m = -\frac{b}{a}\) and the constant term is simply \(b\). The angle (inclination) the line makes with the positive x-axis is the arctangent of the slope:

$$\theta = \arctan\!\left(-\frac{b}{a}\right)$$

Since \(\arctan\) returns a value between \(-90\) and \(+90\) degrees, a line with a negative slope produces a negative angle.

Line showing inclination angle theta measured from the positive x-axis
The inclination angle θ is the slope's arctangent, measured from the x-axis.
Straight line crossing the x-axis at point a and y-axis at point b on a coordinate plane
A line is fully defined by its x-intercept a and y-intercept b.

Worked example

Take \(a = -4\) and \(b = 3\). The slope is

$$m = -\frac{b}{a} = -\frac{3}{-4} = 0.75$$

The equation is therefore \(y = 0.75x + 3\). The angle is

$$\theta = \arctan(0.75) = 0.643501 \text{ rad}$$

which is \(0.643501 \times \frac{180}{\pi} = 36.8699\) degrees.

FAQ

Why can't a or b be zero? If \(a = 0\) the line is vertical (\(x = \text{constant}\)) and has no defined slope; if \(b = 0\) the line goes through the origin and the symmetric intercept form \(\frac{x}{a} + \frac{y}{b} = 1\) cannot hold.

Why is my angle negative? The angle equals \(\arctan(\text{slope})\). When the slope is negative the line falls left-to-right, so its inclination is reported as a negative angle between \(0\) and \(-90\) degrees, which is the standard convention.

Is the slope always -b/a? Yes. With intercepts (a, 0) and (0, b), the rise over run between those two points is \(\frac{b - 0}{0 - a} = -\frac{b}{a}\).

Last updated: