expr([ "*", B, "y" ]) = C
Solve for y to convert expr([ "*", B, "y" ]) = C
to slope-intercept form.
Divide both sides by B:
\qquad y = \color{GREEN}{YINT}
The y-intercept is YINT,
and this equation represents a line where all of the points have y = YINT.
Let's pick some points where y = YINT.
(-X_EXAMPLE, YINT) and (X_EXAMPLE, YINT) are both good choices.
We can see that these points line up to form a horizontal line that crosses the y-axis at (0, YINT).
expr([ "*", B, "x" ]) = C
Notice that there is no y in this equation. Try solving for x and see what happens.
Divide both sides by B:
\qquad x = \color{GREEN}{XINT}
This equation represents a line where all of the points have x = XINT.
Let's pick some points where x = XINT.
(XINT, -Y_EXAMPLE), (XINT, Y_EXAMPLE_2) and (XINT, Y_EXAMPLE) are all good choices.
We can see that these points line up to form a vertical line that crosses the x-axis at (XINT, 0).
expr([ "+", [ "*", A, "x" ], [ "*", B, "y" ] ]) = C
y = PRETTY_SLOPE x + YINT
Convert expr([ "+", [ "*", A, "x" ], [ "*", B, "y" ] ]) = C
to slope-intercept form by solving for y.
A < 0 ? "Add" : "Subtract" abs( A )x A < 0 ? "to" : "from" both sides:
\qquad expr( [ "*", B, "y" ] ) = expr([ "+", [ "*", -A, "x" ], C ])
Divide both sides by B:
\qquad y = expr([ "+", "\\dfrac{" + expr([ "*", -A, "x" ]) + "}{" + B + "}", "\\dfrac{" + C + "}{" + B + "}" ])
\qquad y = \color{purple}{PRETTY_SLOPE} x \color{GREEN}{+ YINT}
The y-intercept is YINT and the slope is decimalFraction( SLOPE, true, true ).
The y-intercept is YINT, so the line must pass through the point (0, YINT).
The slope is decimalFraction( SLOPE, true, true ). Remember that
the slope tells you rise over run. So in this case for every
abs( SLOPE_FRAC[0] )
"position" + ( abs( SLOPE_FRAC[0] ) !== 1 ? "s" : "" )
you move
down (because it's negative)
up
you must also move
SLOPE_FRAC[1]
"position" + ( abs( SLOPE_FRAC[1] ) !== 1 ? "s" : "" )
to the right.
So the line must also pass through (SLOPE_FRAC[1], YINT + SLOPE_FRAC[0])