Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Slope Calculator (Slope of a Line, Distance and Angle)

There are two ways to use it. [From two points] Enter the coordinates of point 1 and point 2 to get the slope, the distance, the angle and the equation of the line. [From one point and a distance] Leave point 2 blank and enter the distance d and the slope m (or the angle θ) to get the coordinates of the point you reach from point 1.

Coordinates, distance and slope can be decimals or negative numbers. When point 2 (X2 and Y2) is filled in, the distance d, slope m and angle θ fields are not used. If you enter both the slope m and the angle θ, the slope m is used.
Result and graph
Enter the coordinates of two points in the fields on the left and press "Calculate". The result will appear here.

What you can do on this page

  • Enter the coordinates of two points and get the slope \(m\) of the line (the rate of change of a linear function) on the spot
  • Along with the slope, it also finds the distance between the two points, the angle of inclination \(\theta\), the equation of the line \(y = mx + b\), the y-intercept and the x-intercept
  • It also works the other way: from one point, a distance to move and a slope (or an angle), it finds the coordinates of the point you reach
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
The slope can be calculated only when the two points have different x-coordinates. A line through two points with the same x-coordinate (a vertical line) has an undefined slope, so "Undefined" is shown. The angle θ is measured counterclockwise from the positive x-axis and shown from 0° up to (but not including) 360°.

What is this calculation used for?

Checking whether a wheelchair ramp meets the rules (building and accessibility)

Under the ADA (Americans with Disabilities Act) standards, a wheelchair ramp can have a slope of at most 1:12 (1 up for every 12 across, a slope of about 0.083). Asking "can I build a 30-foot ramp to a porch that is 30 inches high?" is a slope calculation: \(30 \div 360 = \dfrac{1}{12}\) (30 feet = 360 inches), so it just meets the rule. As an angle, that is about 4.8°.
When remodeling a home or designing a building, you can check with numbers whether a ramp is safe to use.

Reading a "10% grade" road sign (driving and cycling)

A "10%" on a steep-grade sign says "it rises 10 ft for every 100 ft across", a slope of 0.1. As an angle, that is \(\arctan 0.1 \approx 5.7°\). Surprisingly few people know that 10% is not 10°.
Once you can read this, you can judge how steep a hill is in advance, when choosing a gear in a car or planning a bike or running route.

Finding the angle of a roof from its pitch (building and DIY)

In the US, the steepness of a roof is given as a pitch such as "4/12" (it rises 4 inches for every 12 inches across, a slope of 1/3). As an angle, that is \(\arctan \dfrac{4}{12} \approx 18.4°\).
Each roofing material can only be used within a certain range of pitches, so roofers and designers use this conversion every day. It also helps when you build a shed roof yourself.

Estimating how steep a hiking trail is and how far you really walk (hiking and maps)

If a trail climbs 1,000 ft over a horizontal distance of 1 mile (5,280 ft) on the map, its average slope is \(1000 \div 5280 \approx 0.19\) (an angle of about 10.7°), and by the Pythagorean theorem the distance you actually walk on the slope is \(\sqrt{5280^2 + 1000^2} \approx 5374\) ft.
Knowing with numbers that "the real distance is longer than on the map, and the slope decides how tiring it is" makes your hiking plans safer.

Reading how fast data changes from the slope (work and reading graphs)

If monthly sales grew from $40,000 in April to $58,000 in July, the slope is \((58{,}000 - 40{,}000) \div (7 - 4) = 6{,}000\) dollars per month, which reads as "growing by $6,000 a month on average".
The slope of a line graph is the pace of change itself. Finding how fast something changes from its values at two times, whether sales, body weight or temperature, is the same calculation as the slope formula on this page.

Formulas and graphs

Slope of a line \(m\) (rate of change)
Graph
Standard notation (the usual math form)
\(m\) \(=\) \(y_2 - y_1\) \(\div\) \(x_2 - x_1\)
In words (symbols replaced with words)
③ slope of the line \(m\) \(=\) ① change in y (rise) \(\Delta y = y_2 - y_1\) \(\div\) ② change in x (run) \(\Delta x = x_2 - x_1\)
The formula in words
① Take the change in y, \(\Delta y\) (how far it goes up or down)
② divide it by the change in x, \(\Delta x\) (how far it goes across)
③ and you get the slope of the line \(m\)
Quick example
The slope of the line through the points (3, 4) and (6, 8) is
slope \(m\) \(=\) change in y (8 − 4 = 4) \(\div\) change in x (6 − 3 = 3)
\(m = \frac{8 - 4}{6 - 3} = \frac{4}{3} \approx 1.333\)
Key idea
The slope tells you "how much the line goes up or down for every 1 it goes across". It is often called "rise over run", and it is the same as the rate of change of a linear function from Grade 8 math. A positive slope rises from left to right, a negative slope falls from left to right, and a slope of 0 is a horizontal line. Subtract in the same order on the top and the bottom (if you subtract point 1 from point 2, do it in both). If you mix the order, the sign comes out reversed. When the change in x is 0 (a vertical line), you would be dividing by 0, so the slope is undefined.
Distance between two points \(d\)
Graph
Standard notation (the usual math form)
\(d\) \(=\) \(\sqrt{\Delta x^2 + \Delta y^2}\)
In words (symbols replaced with words)
② distance between the points \(d\) \(=\) ① square root of the sum of the squared changes \(\Delta x^2 + \Delta y^2\)
The formula in words
① Take the square root of the sum of the squared changes, \(\Delta x^2 + \Delta y^2\) (square the change across and the change up, add them, and take the square root)
② and you get the distance between the points \(d\)
Quick example
The distance between the points (1, 1) and (4, 5) (Δx = 3, Δy = 4) is
distance \(d\) \(=\) square root of the sum of squares (3² + 4² = 25)
\(d = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5\)
Key idea
This is just the Pythagorean theorem. Picture a right triangle whose two legs are the change across, \(\Delta x\), and the change up, \(\Delta y\). The segment joining the two points is its hypotenuse. Even if a change is negative, squaring makes it positive, so the formula works no matter where the points are.
Angle of inclination \(\theta\) (the angle of the line)
Graph
Standard notation (the usual math form)
\(\theta\) \(=\) \(\arctan m\)
In words (symbols replaced with words)
② angle of inclination \(\theta\) \(=\) ① arctangent of the slope \(m\) (the angle found back from tan)
The formula in words
① Take the arctangent of the slope \(m\) (find the angle whose tan is m)
② and you get the angle of inclination \(\theta\)
Quick example
The angle between the x-axis and a line with slope 1 (it rises 1 for every 1 to the right) is
angle of inclination \(\theta\) \(=\) arctangent of the slope (1)
\(\theta = \arctan 1 = 45^{\circ}\)
Key idea
The slope and the angle are linked by \(m = \tan\theta\). The arctangent (\(\arctan\), shown as tan⁻¹ on a scientific calculator) goes the other way, finding the angle from the slope. \(\arctan\) returns angles from −90° to 90°, so when the slope is negative (the line falls from left to right), the result is a negative angle. This calculator adds 360° to negative angles so that they are shown from 0° up to 360° (example: −63.4° → 296.6°). The angle of a vertical line is 90°. When you work from two points, the angle is measured in the direction "from point 1 toward point 2", so if you enter the same two points in the opposite order, the angle points the opposite way (it differs by 180°).
Equation of a line \(y = mx + b\) (slope-intercept form)
Graph
Standard notation (the usual math form)
\(y\) \(=\) \(m\) \(\times\) \(x\) \(+\) \(b\)
In words (symbols replaced with words)
④ y-coordinate of a point on the line \(y\) \(=\) ② slope \(m\) \(\times\) ① x-coordinate \(x\) \(+\) ③ y-intercept \(b\)
The formula in words
① Take the x-coordinate \(x\)
② multiply it by the slope \(m\)
③ add the y-intercept \(b\)
④ and you get the y-coordinate of the point on the line \(y\)
Quick example
The equation of the line with slope −2 through the point (1, 5) (the y-intercept is b = 5 − (−2) × 1 = 7) is
y-coordinate \(y\) \(=\) slope (−2) \(\times\) x-coordinate \(x\) \(+\) y-intercept (7)
\(b = y_1 - m x_1 = 5 - (-2) \times 1 = 7\)
\(y = -2x + 7\)
Key idea
Once you know the slope \(m\) and one point \((x_1, y_1)\) on the line, there is exactly one line. The y-intercept \(b\) comes from solving "the equation at that point", \(y_1 = m x_1 + b\), for \(b\): \(b = y_1 - m x_1\). The y-intercept is the height where the graph crosses the y-axis (\(y\) when \(x = 0\)), and the x-intercept is where the graph crosses the x-axis (\(x\) when \(y = 0\)). The x-intercept is \(-b \div m\) (a horizontal line, \(m = 0\), has no x-intercept, unless it is the x-axis itself).
The point a distance \(d\) away from one point (given the slope \(m\))
Graph
Standard notation (the usual math form)
\(\Delta x\) \(=\) \(d\) \(\div\) \(\sqrt{1 + m^2}\)
\(\Delta y\) \(=\) \(m\) \(\times\) \(\Delta x\)
In words (symbols replaced with words)
③ change in x \(\Delta x\) \(=\) ① distance to move \(d\) \(\div\) ② square root of \(1 + m^2\)
⑥ change in y \(\Delta y\) \(=\) ④ slope \(m\) \(\times\) ⑤ change in x \(\Delta x\)
The formula in words
① Take the distance to move \(d\)
② divide it by the square root of \(1 + m^2\)
③ and you get the change in x \(\Delta x\)
④ Next, multiply the slope \(m\)
⑤ by the change in x \(\Delta x\)
⑥ and you get the change in y \(\Delta y\) (so the point you reach is \((x_1 + \Delta x,\ y_1 + \Delta y)\))
Quick example
Starting at the point (1, 1) and moving a distance of 5 to the right along a line with slope 0.75, you reach
change in x \(\Delta x\) \(=\) distance to move (5) \(\div\) \(\sqrt{1 + 0.75^2}\) (= 1.25)
\(\Delta x = 5 \div \sqrt{1 + 0.75^2} = 5 \div 1.25 = 4\)
\(\Delta y = 0.75 \times 4 = 3\)
\((x_2,\ y_2) = (1 + 4,\ 1 + 3) = (5,\ 4)\)
Key idea
Why divide by \(\sqrt{1 + m^2}\)? Along a line with slope \(m\), going 1 across takes you \(m\) up, so by the Pythagorean theorem the length you actually travel is \(\sqrt{1 + m^2}\). In other words, "for every 1 across, you travel \(\sqrt{1 + m^2}\) along the line", so dividing the distance \(d\) by \(\sqrt{1 + m^2}\) gives the change across. You can move in two directions, "to the right" (\(\Delta x\) positive) and "to the left" (negative), so this calculator shows both solutions. If you give an angle \(\theta\) instead of a slope, the angle also fixes the direction, so there is only one solution: \(\Delta x = d\cos\theta\), \(\Delta y = d\sin\theta\).
The slope of a line is "change in y ÷ change in x" (rise over run), the distance between two points comes from the Pythagorean theorem, and the angle comes from the arctangent. With these three tools, you can work out everything about a line from the coordinates of two points. You can also go the other way and find the point you reach from one point, a distance and a slope.

Symbols and terms

Symbols

\(m\) m The slope of the line: how much it goes up or down for every 1 across. A positive slope rises from left to right; a negative slope falls. US schools use \(m\) for slope.
\((x_1, y_1)\), \((x_2, y_2)\) x sub 1, y sub 1 The coordinates of the two points. \(x\) is the horizontal position and \(y\) the vertical position; the small number at the lower right (the subscript) tells "the first point" from "the second point".
\(\Delta x\), \(\Delta y\) delta x, delta y The change (how much a value changed). \(\Delta\) (delta) is the Greek letter for "change": \(\Delta x = x_2 - x_1\) (the run) and \(\Delta y = y_2 - y_1\) (the rise).
\(d\) d The distance between the two points, from the first letter of "distance".
\(\theta\) theta A Greek letter often used for angles. On this page, it is the angle between the line and the x-axis (the angle of inclination).
\(b\) b The y-intercept: the height where the line crosses the y-axis (the value of \(y\) when \(x = 0\)).
\(\tan\) tangent A trigonometric ratio: "opposite ÷ adjacent", or "up ÷ across", for an angle. The slope of a line is linked to its angle by \(m = \tan\theta\).
\(\arctan\) arctangent The inverse of tangent: it finds "the angle whose tan is that number". On a scientific calculator it is shown as tan⁻¹.

Terms

slope A number that shows how steep a line is: how much \(y\) increases when \(x\) increases by 1 ("rise over run"). The larger it is, the steeper the line. The grade of a road and the pitch of a roof use the same idea.
rate of change (change in y) ÷ (change in x). It is taught with linear functions in Grade 8, and for a linear function it is exactly the same as the slope of the line.
linear function A function of the form \(y = mx + b\). Its graph is a straight line, with slope \(m\) and y-intercept \(b\) (US schools write \(y = mx + b\); some other countries write \(y = ax + b\)).
intercept Where a graph crosses an axis. The height where it crosses the y-axis is the y-intercept (\(y\) when \(x = 0\)), and where it crosses the x-axis is the x-intercept (\(x\) when \(y = 0\)).
angle of inclination The angle a line makes with the x-axis (the horizontal). It is linked to the slope by \(m = \tan\theta\).
grade (pitch) Everyday names for the steepness of a road, ramp or roof. A "10% grade" road sign says "it rises 10 ft for every 100 ft across", which is a slope of 0.1. Roof pitch is given as rise per 12 inches of run, such as 4/12.
coordinates A pair of numbers (horizontal position, vertical position) that gives the location of a point. The point (3, 4) is "3 to the right and 4 up from the origin". Taught in Grade 6.
vertical line A line perpendicular to the x-axis (going straight up). The change in x is 0, so the slope formula would divide by 0, and the slope is undefined. Its equation is not of the form \(y = mx + b\) but \(x = \text{constant}\).

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.

The coordinate plane (Grades 5–6)
  • Being able to read coordinates such as the point (3, 4) as "a pair of a horizontal position and a vertical position"
  • Knowing that negative x- and y-coordinates are positions to the left and below
Adding and subtracting integers (Grades 6–7)
  • Being able to subtract with negative numbers, as in \(-1 - 5 = -6\) and \(5 - (-2) = 7\)
Linear functions and rate of change (Grade 8)
  • Knowing that the graph of \(y = mx + b\) is a straight line, with slope \(m\) and y-intercept \(b\)
  • Knowing that the rate of change is "change in y ÷ change in x"
The Pythagorean theorem (Grade 8)
  • Knowing that the hypotenuse of a right triangle is \(\sqrt{a^2 + b^2}\) (this is the basis of the distance formula)
The tangent ratio (Geometry)
  • Knowing that \(\tan\theta\) is the ratio "up ÷ across" for an angle (only needed for the angle; not needed for the slope or the distance)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the slope m
Point 1 x-coordinate x₁ 3
Point 1 y-coordinate y₁ 4
Point 2 x-coordinate x₂ 6
Point 2 y-coordinate y₂ 8
Slope m =(B4-B2)/(B3-B1)
Table to find the distance d between two points
Point 1 x-coordinate x₁ 3
Point 1 y-coordinate y₁ 4
Point 2 x-coordinate x₂ 6
Point 2 y-coordinate y₂ 8
Distance between the points d =SQRT((B3-B1)^2+(B4-B2)^2)
Table to find the angle of inclination θ
Point 1 x-coordinate x₁ 3
Point 1 y-coordinate y₁ 4
Point 2 x-coordinate x₂ 6
Point 2 y-coordinate y₂ 8
Angle of inclination θ (degrees) =DEGREES(ATAN2(B3-B1,B4-B2))
Table to find the y-intercept and x-intercept
x-coordinate of a point on the line x₁ 1
y-coordinate of a point on the line y₁ 5
Slope m -2
y-intercept b =B2-B3*B1
x-intercept =-B4/B3
Table to find the point a distance d away from one point
Point 1 x-coordinate x₁ 1
Point 1 y-coordinate y₁ 1
Distance to move d 5
Slope m 0.75
Change in x Δx =B3/SQRT(1+B4^2)
Change in y Δy =B4*B5
x-coordinate reached x₂ =B1+B5
y-coordinate reached y₂ =B2+B6
After pasting, the upper rows are your inputs and the formulas in the lower rows are calculated automatically.
"SQRT(…)" is the square root, "^2" squares a number, "DEGREES(…)" converts radians to degrees, and "ATAN2(change across, change up)" finds the angle from the changes in the two directions.
The first table gives a slope of about 1.333, the second a distance of 5, and the third an angle of about 53.13°. ATAN2 in the third table returns negative angles (from −180° to 180°), so for a line that falls from left to right, add 360 if you want the angle from 0 to 360°.
The fifth table finds the solution that goes to the right (the point (5, 4) in the example). For the solution that goes to the left, put a minus sign at the start of the Δx formula (=-B3/SQRT(1+B4^2)).

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the slope m
Point 1 x-coordinate x₁ 3
Point 1 y-coordinate y₁ 4
Point 2 x-coordinate x₂ 6
Point 2 y-coordinate y₂ 8
Slope m =(B4-B2)/(B3-B1)
Table to find the distance d between two points
Point 1 x-coordinate x₁ 3
Point 1 y-coordinate y₁ 4
Point 2 x-coordinate x₂ 6
Point 2 y-coordinate y₂ 8
Distance between the points d =SQRT((B3-B1)^2+(B4-B2)^2)
Table to find the angle of inclination θ
Point 1 x-coordinate x₁ 3
Point 1 y-coordinate y₁ 4
Point 2 x-coordinate x₂ 6
Point 2 y-coordinate y₂ 8
Angle of inclination θ (degrees) =DEGREES(ATAN2(B3-B1,B4-B2))
Table to find the y-intercept and x-intercept
x-coordinate of a point on the line x₁ 1
y-coordinate of a point on the line y₁ 5
Slope m -2
y-intercept b =B2-B3*B1
x-intercept =-B4/B3
Table to find the point a distance d away from one point
Point 1 x-coordinate x₁ 1
Point 1 y-coordinate y₁ 1
Distance to move d 5
Slope m 0.75
Change in x Δx =B3/SQRT(1+B4^2)
Change in y Δy =B4*B5
x-coordinate reached x₂ =B1+B5
y-coordinate reached y₂ =B2+B6
The same formulas as in Excel (SQRT, DEGREES, ATAN2 and ^2) work as is in Google Sheets. Copy the whole table, paste it into cell A1, and replace the input numbers with your own coordinates.

How to calculate it in Python

import math

x1, y1 = 3.0, 4.0   # coordinates of point 1
x2, y2 = 6.0, 8.0   # coordinates of point 2

delta_x = x2 - x1                       # change in x (run)
delta_y = y2 - y1                       # change in y (rise)
slope = delta_y / delta_x               # slope m (if delta_x is 0, the line is vertical and this fails)
distance = math.hypot(delta_x, delta_y) # distance between the points (same as √(Δx²+Δy²))
angle = math.degrees(math.atan2(delta_y, delta_x)) % 360   # angle (0 to 360°)
y_intercept = y1 - slope * x1           # y-intercept b

print(f"Slope m: {slope}")
print(f"Distance d: {distance}")
print(f"Angle θ: {angle}")
print(f"Equation of the line: y = {slope}x + {y_intercept}")

# The other way: the point reached by moving a distance d from point (x1, y1) along the slope
d = 5.0
dx = d / math.sqrt(1 + slope ** 2)      # solution going right (going left is -dx)
dy = slope * dx
print(f"Point reached: ({x1 + dx}, {y1 + dy})")
Runs with the standard library only. math.hypot is the square root of the sum of squares, and math.atan2 is the arctangent (a function that finds the angle from the changes across and up). Change the coordinates at the top and run it.

How to write it in LaTeX and other math languages (copy and paste)

Slope of a line \(m\) (rate of change)
m = (y₂ − y₁) ÷ (x₂ − x₁)
m = \frac{y_2 - y_1}{x_2 - x_1}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>m</mi>
    <mo>=</mo>
    <mfrac>
      <mrow><msub><mi>y</mi><mn>2</mn></msub><mo>&#x2212;</mo><msub><mi>y</mi><mn>1</mn></msub></mrow>
      <mrow><msub><mi>x</mi><mn>2</mn></msub><mo>&#x2212;</mo><msub><mi>x</mi><mn>1</mn></msub></mrow>
    </mfrac>
  </mrow>
</math>
m = (y_2 - y_1)/(x_2 - x_1)
(y2 - y1)/(x2 - x1)
m := (y2 - y1)/(x2 - x1);
m = (y2 - y1)/(x2 - x1);
m = (y_2 - y_1)/(x_2 - x_1)
Distance between two points \(d\)
d = √(Δx² + Δy²)
d = \sqrt{\Delta x^2 + \Delta y^2}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>d</mi>
    <mo>=</mo>
    <msqrt>
      <mrow>
        <msup><mrow><mi mathvariant="normal">&#x394;</mi><mi>x</mi></mrow><mn>2</mn></msup>
        <mo>+</mo>
        <msup><mrow><mi mathvariant="normal">&#x394;</mi><mi>y</mi></mrow><mn>2</mn></msup>
      </mrow>
    </msqrt>
  </mrow>
</math>
d = sqrt((Delta x)^2 + (Delta y)^2)
Sqrt[dx^2 + dy^2]
d := sqrt(dx^2 + dy^2);
d = sqrt(dx^2 + dy^2);
d = √(Δx^2 + Δy^2)
Angle of inclination \(\theta\) (the angle of the line)
θ = arctan(m)
\theta = \arctan m
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>&#x3B8;</mi>
    <mo>=</mo>
    <mi>arctan</mi>
    <mo>&#x2061;</mo>
    <mi>m</mi>
  </mrow>
</math>
theta = arctan(m)
ArcTan[m]
theta := arctan(m);
theta = atan(m);
θ = arctan(m)
Equation of a line \(y = mx + b\) (slope-intercept form)
y = mx + b (b = y₁ − m·x₁)
y = mx + b, \quad b = y_1 - m x_1
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>y</mi>
    <mo>=</mo>
    <mi>m</mi><mi>x</mi>
    <mo>+</mo>
    <mi>b</mi>
    <mo>,</mo>
    <mi>b</mi>
    <mo>=</mo>
    <msub><mi>y</mi><mn>1</mn></msub>
    <mo>&#x2212;</mo>
    <mi>m</mi><msub><mi>x</mi><mn>1</mn></msub>
  </mrow>
</math>
y = m x + b, b = y_1 - m x_1
b = y1 - m*x1; y = m*x + b
b := y1 - m*x1; y := m*x + b;
b = y1 - m*x1; y = m*x + b;
y = mx + b, b = y_1 - mx_1
The point a distance \(d\) away from one point (given the slope \(m\))
Δx = ±d ÷ √(1 + m²),  Δy = m·Δx
\Delta x = \pm\frac{d}{\sqrt{1 + m^2}}, \quad \Delta y = m\,\Delta x
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mrow><mi mathvariant="normal">&#x394;</mi><mi>x</mi></mrow>
    <mo>=</mo>
    <mo>&#xB1;</mo>
    <mfrac>
      <mi>d</mi>
      <msqrt><mrow><mn>1</mn><mo>+</mo><msup><mi>m</mi><mn>2</mn></msup></mrow></msqrt>
    </mfrac>
    <mo>,</mo>
    <mrow><mi mathvariant="normal">&#x394;</mi><mi>y</mi></mrow>
    <mo>=</mo>
    <mi>m</mi>
    <mrow><mi mathvariant="normal">&#x394;</mi><mi>x</mi></mrow>
  </mrow>
</math>
Delta x = +-d/sqrt(1 + m^2), Delta y = m Delta x
dx = d/Sqrt[1 + m^2]; dy = m*dx
dx := d/sqrt(1 + m^2); dy := m*dx;
dx = d/sqrt(1 + m^2); dy = m*dx;
Δx = ±d/√(1 + m^2), Δy = mΔx

How to have ChatGPT  do the calculation

You are a math calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

For the two points (3, 4) and (6, 8) on the coordinate plane, find each of the following:
1. The slope m of the line through the two points
2. The distance d between the two points
3. The angle θ (in degrees) between the line and the x-axis
4. The equation of the line y = mx + b (also show the value of the y-intercept b)

Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.