reduce( randRangeNonZero( -5, 5 ), randRange( 1, 5 ) ) randRangeNonZero( max( -10, -10 - SLOPE_FRAC[0] ), min( 10, 10 - SLOPE_FRAC[0] ) ) SLOPE_FRAC[0] / SLOPE_FRAC[1] SLOPE === 1 ? "" : ( SLOPE === -1 ? "-" : fraction( SLOPE_FRAC[0], SLOPE_FRAC[1], true, true ) ) randRangeNonZero( -3, 3 ) SLOPE_FRAC[0] * -MULT SLOPE_FRAC[1] * MULT SLOPE_FRAC[1] * YINT * MULT randFromArray([ true, false ]) randFromArray([ "<", ">", "≤", "≥" ]) B < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[ COMP ] : COMP COMP === "<" || COMP === "≤" COMP === "≥" || COMP === "≤"

Graph the following inequality:

expr([ "+", [ "*", A, "x" ], [ "*", B, "y" ] ]) STD_FORM_COMP C

y COMP PRETTY_SLOPE x + YINT

Drag the two points to move the line into the correct position.
[ graph.pointA.coord, graph.pointB.coord, graph.pointA.coord[0] > graph.pointB.coord[0] ? graph.shadetop : !graph.shadetop, graph.dasharray === "- " ? false : true ]
var slope = ( guess[1][1] - guess[0][1] ) / ( guess[1][0] - guess[0][0] ); var yint = slope * ( 0 - guess[0][0] ) + guess[0][1]; return abs( SLOPE - slope ) < 0.001 && abs( YINT - yint ) < 0.001 && guess[2] === LESS_THAN && guess[3] === INCLUSIVE;
graph.pointA.setCoord( guess[0] ); graph.pointB.setCoord( guess[1] ); graph.shadetop = graph.pointA.coord[0] > graph.pointB.coord[0] ? guess[2] : !guess[2]; if ( guess[3] ) { graph.dasharray = ""; $( "input[name=dashradio][value=solid]" ).attr( "checked", true ); } else { graph.dasharray = "- ";$( "input[name=dashradio][value=dashed]" ).attr( "checked", true ); } graph.update();
graph the inequality
make sure the correct side is shaded
make sure the line is correctly shown as solid or dashed

Convert expr([ "+", [ "*", A, "x" ], [ "*", B, "y" ] ]) STD_FORM_COMP 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" ] ) STD_FORM_COMP expr([ "+", [ "*", -A, "x" ], C ])

Divide both sides by B. Since you're multiplying or dividing by a negative number, don't forget to flip the inequality sign:

\qquad y COMP expr([ "+", "\\dfrac{" + expr([ "*", -A, "x" ]) + "}{" + B + "}", "\\dfrac{" + C + "}{" + B + "}" ])

\qquad y COMP \color{purple}{PRETTY_SLOPE} x \color{GREEN}{+ YINT}

The y-intercept is YINT and the slope is decimalFraction( SLOPE, true, true ). Since the y-intercept is YINT, the line must pass through the point (0, YINT).

style({ stroke: GREEN, fill: GREEN }, function() { graph.yint = circle( [ 0, YINT ], 0.2 ).toBack(); });

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])

style({ stroke: "purple", strokeWidth: 2, arrows: "->" }, function() { path([ [ 0, YINT ], [ 0, YINT + SLOPE_FRAC[0] ] ]).toBack(); path([ [ 0, YINT + SLOPE_FRAC[0] ], [ SLOPE_FRAC[1], YINT + SLOPE_FRAC[0] ] ]).toBack(); }); label( [ 0, YINT + SLOPE_FRAC[0] / 2 ], abs( SLOPE_FRAC[0] ) + " \\text{ " + ( SLOPE_FRAC[0] < 0 ? "down" : "up" ) + "} \\quad", "left", { color: "purple" } ); label( [ 0, YINT + SLOPE_FRAC[0] ], SLOPE_FRAC[1] + " \\text{ right}", ( SLOPE_FRAC[0] < 0 ? "below right" : "above right" ), { color: "purple" } ); graph.yint.toBack();

Since our inequality has a LESS_THAN ? "less-than" : "greater-than"INCLUSIVE ? " or equal to" : "" sign, that means that any point LESS_THAN ? "below" : "above" the line is a solution to the inequality, so the area LESS_THAN ? "below" : "above" the line should be shaded.

Note that since the sign is LESS_THAN ? "less-than" : "greater-than" or equal to, any point on the line is also a solution, so the line should be solid.

Note that since the sign is LESS_THAN ? "less-than" : "greater-than" (and not equal to), any point on the line is not part of the solution, so the line should be dashed to indicate this.