Résultats

Slope and Linear Equations — Rise Over Run

Animation coming — full Sora 2 prompt below. Video will replace this placeholder.

Plain English first

Slope is steepness. It answers: for every step you take to the right, how many steps do you go up (or down)?

If slope m = 2, every 1 step right means 2 steps up — a steep climb. If m = 0.5, every 1 step right means half a step up — a gentle slope. If m = −1, every step right means 1 step down — a descent. If m = 0, perfectly flat.

A linear equation y = mx + b just says: start at height b when x = 0, then change by m for every unit you move right. That's the whole thing.


Standard math notation

Slope formula (given two points):
  m = (y₂ − y₁) / (x₂ − x₁)  =  rise / run

Slope-intercept form:
  y = mx + b
  m = slope, b = y-intercept (height where line crosses the y-axis)

Point-slope form (given slope m and one point (x₁, y₁)):
  y − y₁ = m(x − x₁)

Standard form:
  Ax + By = C

Horizontal line: y = b  (slope = 0, no rise)
Vertical line:   x = a  (slope = undefined, infinite rise per zero run)

Parallel lines:      same slope m, different b
Perpendicular lines: slopes are negative reciprocals (m₁ × m₂ = −1)

Verbose Python with descriptive names

def compute_slope_from_two_points(
    x_coordinate_of_first_point,
    y_coordinate_of_first_point,
    x_coordinate_of_second_point,
    y_coordinate_of_second_point
):
    """
    Slope = how much y changes per unit of x change.
    Rise = vertical change. Run = horizontal change. Slope = rise / run.
    """
    vertical_rise    = y_coordinate_of_second_point - y_coordinate_of_first_point
    horizontal_run   = x_coordinate_of_second_point - x_coordinate_of_first_point
    if horizontal_run == 0:
        return None  # vertical line — slope is undefined
    slope = vertical_rise / horizontal_run
    return slope

def compute_y_from_slope_intercept(
    slope_of_line,
    y_intercept,
    x_value
):
    """
    Given slope m and y-intercept b, find y at any x.
    y = mx + b: start at b, add m for every unit of x.
    """
    y_value = slope_of_line * x_value + y_intercept
    return y_value

def compute_y_intercept_from_point_and_slope(
    x_of_known_point,
    y_of_known_point,
    slope_of_line
):
    """
    Given a point on the line and the slope, find where the line hits y-axis.
    From y = mx + b  →  b = y - mx
    """
    y_intercept = y_of_known_point - slope_of_line * x_of_known_point
    return y_intercept

# Example: line through (1, 3) and (4, 9)
m = compute_slope_from_two_points(1, 3, 4, 9)
print(f"Slope: {m}")                # 2.0

b = compute_y_intercept_from_point_and_slope(1, 3, m)
print(f"y-intercept: {b}")          # 1.0

print(compute_y_from_slope_intercept(m, b, x_value=0))   # 1.0 (the y-intercept)
print(compute_y_from_slope_intercept(m, b, x_value=3))   # 7.0

Sora 2 video prompt

8-second animation. A coordinate grid. A line y=mx+b appears. Two points
are marked — horizontal arrow labeled 'run = Δx' and vertical arrow labeled
'rise = Δy'. The fraction m = rise/run forms visually. The slope value m
changes: 0 (flat), 1, 3, −1 — the line tilts each time, showing the rise/run
triangle growing and shrinking. Formula y=mx+b glows throughout. Warm earth
tones, clean grid, large clear labels.

The three forms say the same thing

# These are all the same line: slope 2, y-intercept 1

# Slope-intercept:   y = 2x + 1
# Point-slope (using point (0,1)):   y − 1 = 2(x − 0)
# Standard form:     −2x + y = 1   (or 2x − y = −1)

# Convert standard form Ax + By = C to slope-intercept:
def standard_to_slope_intercept(A, B, C):
    # Ax + By = C  →  y = (C − Ax) / B  →  y = (C/B) − (A/B)x
    slope       = -A / B
    y_intercept =  C / B
    return slope, y_intercept

slope, intercept = standard_to_slope_intercept(A=2, B=-1, C=-1)
print(f"y = {slope}x + {intercept}")  # y = 2.0x + 1.0

Builds on

See also

Commentaires

Aucun commentaire. Soyez le premier !


Les commentaires sont modérés et apparaîtront après approbation.