randRangeNonZero( -5, 5 ) randRange( -5, 5 )
randRangeNonZero( -5, 5 ) randRangeNonZero( -5, 5 )
(Y - YINT_1) / X (Y - YINT_2) / X toFraction( SLOPE_1, 0.001 ) toFraction( SLOPE_2, 0.001 )
SLOPE_1 === 1 ? "" : ( SLOPE_1 === -1 ? "-" : decimalFraction( SLOPE_1, true, true ) ) SLOPE_2 === 1 ? "" : ( SLOPE_2 === -1 ? "-" : decimalFraction( SLOPE_2, true, true ) ) randRangeNonZero( -2, 2 ) randRangeNonZero( -2, 2 ) ( Y - YINT_1 ) * -MULT_1 ( Y - YINT_2 ) * -MULT_2 X * MULT_1 X * MULT_2 X * YINT_1 * MULT_1 X * YINT_2 * MULT_2 true true

Graph this system of equations and solve.

`expr([ "+", [ "*", A1, "x" ], [ "*", B1, "y" ] ]) = C1`

`y = PRETTY_SLOPE_1 x + YINT_1`

`expr([ "+", [ "*", A2, "x" ], [ "*", B2, "y" ] ]) = C2`

`y = PRETTY_SLOPE_2 x + YINT_2`

graphInit({ range: 11, scale: 20, axisArrows: "<->", tickStep: 1, labelStep: 1 }); addMouseLayer(); graph.pointA = addMovablePoint({ coord: [ -5, 5 ], snapX: 0.5, snapY: 0.5, normalStyle: { stroke: KhanUtil.BLUE, fill: KhanUtil.BLUE } }); graph.pointB = addMovablePoint({ coord: [ 5, 5 ], snapX: 0.5, snapY: 0.5, normalStyle: { stroke: KhanUtil.BLUE, fill: KhanUtil.BLUE } }); graph.pointC = addMovablePoint({ coord: [ -5, -5 ], snapX: 0.5, snapY: 0.5, normalStyle: { stroke: KhanUtil.GREEN, fill: KhanUtil.GREEN } }); graph.pointD = addMovablePoint({ coord: [ 5, -5 ], snapX: 0.5, snapY: 0.5, normalStyle: { stroke: KhanUtil.GREEN, fill: KhanUtil.GREEN } }); graph.line1 = addMovableLineSegment({ pointA: graph.pointA, pointZ: graph.pointB, fixed: true, extendLine: true }); graph.line2 = addMovableLineSegment({ pointA: graph.pointC, pointZ: graph.pointD, fixed: true, extendLine: true, normalStyle: { "stroke": KhanUtil.GREEN, "stroke-width": 2 } }); // A and B can't be in the same place graph.pointA.onMove = function( x, y ) { return ( x != graph.pointB.coord || y != graph.pointB.coord ); } graph.pointB.onMove = function( x, y ) { return ( x != graph.pointA.coord || y != graph.pointA.coord ); } // C and D can't be in the same place graph.pointC.onMove = function( x, y ) { return ( x != graph.pointD.coord || y != graph.pointD.coord ); } graph.pointD.onMove = function( x, y ) { return ( x != graph.pointC.coord || y != graph.pointC.coord ); } graph.pointC.toFront(); graph.pointD.toFront(); graph.pointA.toFront(); graph.pointB.toFront();
Click and drag the points to move the lines.

`x = ` X

`y = ` Y

[ graph.pointA.coord, graph.pointB.coord, graph.pointC.coord, graph.pointD.coord ]
var slope1 = ( guess - guess ) / ( guess - guess ); var slope2 = ( guess - guess ) / ( guess - guess ); var yint1 = slope1 * ( 0 - guess ) + guess; var yint2 = slope2 * ( 0 - guess ) + guess; // allows blue function to be graphed with green line and vice versa, fwiw return ( abs( SLOPE_1 - slope1 ) < 0.001 && abs( SLOPE_2 - slope2 ) < 0.001 && abs( YINT_1 - yint1 ) < 0.001 && abs( YINT_2 - yint2 ) < 0.001 ) || ( abs( SLOPE_1 - slope2 ) < 0.001 && abs( SLOPE_2 - slope1 ) < 0.001 && abs( YINT_2 - yint1 ) < 0.001 && abs( YINT_1 - yint2 ) < 0.001 );
graph.pointA.setCoord( guess ); graph.pointB.setCoord( guess ); graph.pointC.setCoord( guess ); graph.pointD.setCoord( guess ); graph.line1.transform( true ); graph.line2.transform( true );
two integers like `6`
false false
random() < 0.5 ? true : false !STD_FORM_1

Convert the first equation, `expr([ "+", [ "*", A1, "x" ], [ "*", B1, "y" ] ]) = C1`, to slope-intercept form.

`y = PRETTY_SLOPE_1 x + YINT_1`

The y-intercept for the first equation is `YINT_1`, so the first line must pass through the point `(0, YINT_1)`.

The slope for the first equation is `decimalFraction( SLOPE_1, true, true )`. Remember that the slope tells you rise over run. So in this case for every `abs( SLOPE_1_FRAC )` "position" + ( abs( SLOPE_1_FRAC ) !== 1 ? "s" : "" ) you move down (because it's negative) up you must also move `SLOPE_1_FRAC` "position" + ( abs( SLOPE_1_FRAC ) !== 1 ? "s" : "" ) to the right.

`SLOPE_1_FRAC` "position" + ( abs( SLOPE_1_FRAC ) !== 1 ? "s" : "" ) to the right and `abs( SLOPE_1_FRAC )` "position" + ( abs( SLOPE_1_FRAC ) !== 1 ? "s" : "" ) downup from `(0, YINT_1)` is `(SLOPE_1_FRAC, YINT_1 + SLOPE_1_FRAC)`.

Graph the blue line so it passes through `(0, YINT_1)` and `(SLOPE_1_FRAC, YINT_1 + SLOPE_1_FRAC)`.

Convert the second equation, `expr([ "+", [ "*", A2, "x" ], [ "*", B2, "y" ] ]) = C2`, to slope-intercept form.

`y = PRETTY_SLOPE_2 x + YINT_2`

The y-intercept for the second equation is `YINT_2`, so the second line must pass through the point `(0, YINT_2)`.

The slope for the second equation is `decimalFraction( SLOPE_2, true, true )`. Remember that the slope tells you rise over run. So in this case for every `abs( SLOPE_2_FRAC )` "position" + ( abs( SLOPE_2_FRAC ) !== 1 ? "s" : "" ) you move down (because it's negative) up you must also move `SLOPE_2_FRAC` "position" + ( abs( SLOPE_1_FRAC ) !== 1 ? "s" : "" ) to the right.

`SLOPE_2_FRAC` "position" + ( abs( SLOPE_2_FRAC ) !== 1 ? "s" : "" ) to the right and `abs( SLOPE_2_FRAC )` "position" + ( abs( SLOPE_2_FRAC ) !== 1 ? "s" : "" ) downup from `(0, YINT_2)` is `(SLOPE_2_FRAC, YINT_2 + SLOPE_2_FRAC)`.

Graph the green line so it passes through `(0, YINT_2)` and `(SLOPE_2_FRAC, YINT_2 + SLOPE_2_FRAC)`.

The solution is the point where the two lines intersect.

The lines intersect at `(X, Y)`.

style({ stroke: PINK }); circle( [ X, Y ], 0.5 );