Category: Algebra Level: 201
y = mx + b, m = rise / run
The slope m says how much y climbs per step right, and b says where the line crosses the y-axis. Any slope triangle on the line, big or small, gives the same rise over run.
These points all sit on one straight line. Every 3 steps right, the line climbs 2.
(0, 1), (3, 3), (6, 5), (9, 7)
The line crosses the y-axis at height 1. That starting height is b.
x = 0 ⇒ y = 1, so b = 1
Walk 3 right along the orange run, then 2 up along the purple rise to get back to the line. The slope is rise divided by run.
m = rise / run = 2/3
Start at (3, 3) and walk 6 right and 4 up. The triangle is twice as big, but the ratio is the same, because a straight line has one steady slope.
4/6 = 2/3
Start at b and add m for every step right. That recipe is the whole equation of the line.
y = (2/3)x + 1
cd svg-generator python3 -m svgmath render slope-intercept --out /tmp/slope-intercept
Source: svgmath/diagrams/lines.py