randRangeNonZero(-5, 5) randRange(-5, 5)
randRangeExclude(-5, 5, [0, Y]) randRangeExclude(-5, 5, [0, Y])
(Y - YINT_1) / X (Y - YINT_2) / X toFraction(SLOPE_1, 0.001) toFraction(SLOPE_2, 0.001)
fractionVariable(SLOPE_FRAC_1[0], SLOPE_FRAC_1[1], "x") fractionVariable(SLOPE_FRAC_2[0], SLOPE_FRAC_2[1], "x") randRangeNonZero(-3, 3) randRangeNonZero(-3, 3) SLOPE_FRAC_1[0] * -MULT_1 SLOPE_FRAC_2[0] * -MULT_2 SLOPE_FRAC_1[1] * MULT_1 SLOPE_FRAC_2[1] * MULT_2 SLOPE_FRAC_1[1] * YINT_1 * MULT_1 SLOPE_FRAC_2[1] * YINT_2 * MULT_2 randFromArray([true, false]) randFromArray([true, false]) randFromArray(["<", ">", "≤", "≥"]) randFromArray(["<", ">", "≤", "≥"]) B_1 < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[COMP_1] : COMP_1 B_2 < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[COMP_2] : COMP_2 COMP_1 === "<" || COMP_1 === "≤" COMP_2 === "<" || COMP_2 === "≤" COMP_1 === "≥" || COMP_1 === "≤" COMP_2 === "≥" || COMP_2 === "≤" (function() { // Create a point on one of the lines var minN = -floor((9 + X) / abs(SLOPE_FRAC_1[1])); var maxN = floor((9 - X) / abs(SLOPE_FRAC_1[1])); var n = randRange(minN, maxN); if (rand(2) < 1) { return [X + n * SLOPE_FRAC_1[1], Y + n * SLOPE_FRAC_1[0]]; } else { return [X + n * SLOPE_FRAC_2[1], Y + n * SLOPE_FRAC_2[0]]; } })() randFromArray([ [randRangeExclude(-9, 9, [-1, -2]), randRangeExclude(-9, 9, [-1, -2])], [randRangeExclude(-9, 9, [-1, -2]), randRangeExclude(-9, 9, [-1, -2])], EDGE_POINT ]) (function() { var p = POINT[1]; var p1 = SLOPE_1 * POINT[0] + YINT_1; var p2 = SLOPE_2 * POINT[0] + YINT_2; return ((COMP_1 === "<" && p < p1) || (COMP_1 === "≤" && p <= p1) || (COMP_1 === ">" && p > p1) || (COMP_1 === "≥" && p >= p1)) && ((COMP_2 === "<" && p < p2) || (COMP_2 === "≤" && p <= p2) || (COMP_2 === ">" && p > p2) || (COMP_2 === "≥" && p >= p2)); })()

Să se reprezinte grafic inegalitățile:

\blue{expr([ "+", [ "*", A_1, "x" ], [ "*", B_1, "y" ] ]) STD_FORM_COMP_1 C_1}

\blue{y COMP_1 PRETTY_SLOPE_1 + YINT_1}

\green{expr([ "+", [ "*", A_2, "x" ], [ "*", B_2, "y" ] ]) STD_FORM_COMP_2 C_2}

\green{y COMP_2 PRETTY_SLOPE_2 + YINT_2}

Inegalitatea 1:

Inegalitatea 2:

graphInit({ range: 11, scale: 20, axisArrows: "<->", tickStep: 1, labelStep: 1, gridOpacity: 0.05, axisOpacity: 0.2, tickOpacity: 0.4, labelOpacity: 0.5 }); label( [ 0, -11 ], "y", "below" ); label( [ 11, 0 ], "x", "right" ); 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.BLUE, fill: KhanUtil.BLUE } }); graph.pointD = addMovablePoint({ coord: [ 5, -5 ], snapX: 0.5, snapY: 0.5, normalStyle: { stroke: KhanUtil.BLUE, fill: KhanUtil.BLUE } }); graph.set = raphael.set(); graph.update = function() { graph.set.remove(); if ( abs( graph.pointB.coord[0] - graph.pointA.coord[0] ) > 0.001 ) { var slope = ( graph.pointB.coord[1] - graph.pointA.coord[1] ) / ( graph.pointB.coord[0] - graph.pointA.coord[0] ); var yint = slope * ( 0 - graph.pointA.coord[0] ) + graph.pointA.coord[1]; var shadeEdge = ( ( graph.pointA.coord[0] < graph.pointB.coord[0] ) ? graph.shadetop1 : !graph.shadetop1 ) ? 11 : -11; style({ stroke: BLUE, strokeWidth: 2, strokeDasharray: graph.dasharray1 }, function() { graph.set.push( line( [ -11, -11 * slope + yint ], [ 11, 11 * slope + yint ] ) ); }); style({ fill: BLUE, stroke: null, opacity: KhanUtil.FILL_OPACITY }, function() { graph.set.push( path([ [ 11, shadeEdge ], [ 11, 11 * slope + yint ], [ -11, -11 * slope + yint ], [ -11, shadeEdge ] ]) ); }); } else { // vertical line var x = graph.pointA.coord[0]; var shadeEdge = ( ( graph.pointB.coord[1] < graph.pointA.coord[1] ) ? graph.shadetop1 : !graph.shadetop1 ) ? 11 : -11; style({ stroke: BLUE, strokeWidth: 2, strokeDasharray: graph.dasharray1 }, function() { graph.set.push( line( [ x, -11 ], [ x, 11 ] ) ); }); style({ fill: BLUE, stroke: null, opacity: KhanUtil.FILL_OPACITY }, function() { graph.set.push( path([ [ x, -11 ], [ x, 11 ], [ shadeEdge, 11 ], [ shadeEdge, -11 ] ]) ); }); } if ( abs( graph.pointD.coord[0] - graph.pointC.coord[0] ) > 0.001 ) { var slope = ( graph.pointD.coord[1] - graph.pointC.coord[1] ) / ( graph.pointD.coord[0] - graph.pointC.coord[0] ); var yint = slope * ( 0 - graph.pointC.coord[0] ) + graph.pointC.coord[1]; var shadeEdge = ( ( graph.pointC.coord[0] < graph.pointD.coord[0] ) ? graph.shadetop2 : !graph.shadetop2 ) ? 11 : -11; style({ stroke: GREEN, strokeWidth: 2, strokeDasharray: graph.dasharray2 }, function() { graph.set.push( line( [ -11, -11 * slope + yint ], [ 11, 11 * slope + yint ] ) ); }); style({ fill: GREEN, stroke: null, opacity: KhanUtil.FILL_OPACITY }, function() { graph.set.push( path([ [ 11, shadeEdge ], [ 11, 11 * slope + yint ], [ -11, -11 * slope + yint ], [ -11, shadeEdge ] ]) ); }); } else { // vertical line var x = graph.pointC.coord[0]; var shadeEdge = ( ( graph.pointD.coord[1] < graph.pointC.coord[1] ) ? graph.shadetop2 : !graph.shadetop2 ) ? 11 : -11; style({ stroke: GREEN, strokeWidth: 2, strokeDasharray: graph.dasharray2 }, function() { graph.set.push( line( [ x, -11 ], [ x, 11 ] ) ); }); style({ fill: GREEN, stroke: null, opacity: KhanUtil.FILL_OPACITY }, function() { graph.set.push( path([ [ x, -11 ], [ x, 11 ], [ shadeEdge, 11 ], [ shadeEdge, -11 ] ]) ); }); } graph.set.toBack(); }; graph.showCorrect = function() { graph.pointA.setCoord([ 0, YINT_1 ]); graph.pointB.setCoord([ SLOPE_FRAC_1[1], YINT_1 + SLOPE_FRAC_1[0] ]); graph.pointC.setCoord([ 0, YINT_2 ]); graph.pointD.setCoord([ SLOPE_FRAC_2[1], YINT_2 + SLOPE_FRAC_2[0] ]); graph.shadetop1 = graph.pointA.coord[0] > graph.pointB.coord[0] ? LESS_THAN_1 : !LESS_THAN_1; graph.shadetop2 = graph.pointC.coord[0] > graph.pointD.coord[0] ? LESS_THAN_2 : !LESS_THAN_2; if ( INCLUSIVE_1 ) { graph.dasharray1 = ''; $( 'input[name=dashradio1][value=solid]' ).attr( 'checked', true ); } else { graph.dasharray1 = '- '; $( 'input[name=dashradio1][value=dashed]' ).attr( 'checked', true ); } if ( INCLUSIVE_2 ) { graph.dasharray2 = ''; $( 'input[name=dashradio2][value=solid]' ).attr( 'checked', true ); } else { graph.dasharray2 = '- '; $( 'input[name=dashradio2][value=dashed]' ).attr( 'checked', true ); } graph.update(); }; // A and B can't be in the same place graph.pointA.onMove = function( x, y ) { if ( x != graph.pointB.coord[0] || y != graph.pointB.coord[1] ) { graph.pointA.setCoord([ x, y ]); graph.update(); return true; } else { return false; } } graph.pointB.onMove = function( x, y ) { if ( x != graph.pointA.coord[0] || y != graph.pointA.coord[1] ) { graph.pointB.setCoord([ x, y, ]); graph.update(); return true; } else { return false; } } // C and D can't be in the same place graph.pointC.onMove = function( x, y ) { if ( x != graph.pointD.coord[0] || y != graph.pointD.coord[1] ) { graph.pointC.setCoord([ x, y ]); graph.update(); return true; } else { return false; } } graph.pointD.onMove = function( x, y ) { if ( x != graph.pointC.coord[0] || y != graph.pointC.coord[1] ) { graph.pointD.setCoord([ x, y, ]); graph.update(); return true; } else { return false; } } graph.dasharray1 = ""; graph.dasharray2 = ""; graph.shadetop1 = true; graph.shadetop2 = false; graph.update(); graph.pointA.toFront(); graph.pointB.toFront(); graph.pointC.toFront(); graph.pointD.toFront();

Este punctul (POINT[0], POINT[1]) o soluție a sistemului de inegalități?

[ graph.pointA.coord, graph.pointB.coord, graph.pointA.coord[0] > graph.pointB.coord[0] ? graph.shadetop1 : !graph.shadetop1, graph.dasharray1 === "- " ? false : true, graph.pointC.coord, graph.pointD.coord, graph.pointC.coord[0] > graph.pointD.coord[0] ? graph.shadetop2 : !graph.shadetop2, graph.dasharray2 === "- " ? false : true, $("input[name='isSolution']:checked").attr("id")]
if (_.isEqual(guess, [[-5,5],[5,5],false,true,[-5,-5],[5,-5],true,true])) { return ""; } var slope1 = ( guess[1][1] - guess[0][1] ) / ( guess[1][0] - guess[0][0] ); var yint1 = slope1 * ( 0 - guess[0][0] ) + guess[0][1]; var slope2 = ( guess[5][1] - guess[4][1] ) / ( guess[5][0] - guess[4][0] ); var yint2 = slope2 * ( 0 - guess[4][0] ) + guess[4][1]; return POINT_SOLUTION === (guess[8] === 'yes') && (abs(SLOPE_1 - slope1) < 0.001 && abs(YINT_1 - yint1) < 0.001 && guess[2] === LESS_THAN_1 && guess[3] === INCLUSIVE_1 && abs(SLOPE_2 - slope2) < 0.001 && abs(YINT_2 - yint2) < 0.001 && guess[6] === LESS_THAN_2 && guess[7] === INCLUSIVE_2) || (abs(SLOPE_2 - slope1) < 0.001 && abs(YINT_2 - yint1) < 0.001 && guess[2] === LESS_THAN_2 && guess[3] === INCLUSIVE_2 && abs(SLOPE_1 - slope2) < 0.001 && abs(YINT_1 - yint2) < 0.001 && guess[6] === LESS_THAN_1 && guess[7] === INCLUSIVE_1)
graph.pointA.setCoord( guess[0] ); graph.pointB.setCoord( guess[1] ); graph.pointC.setCoord( guess[4] ); graph.pointD.setCoord( guess[5] ); graph.shadetop1 = graph.pointA.coord[0] > graph.pointB.coord[0] ? guess[2] : !guess[2]; graph.shadetop2 = graph.pointC.coord[0] > graph.pointD.coord[0] ? guess[6] : !guess[6]; if ( guess[3] ) { graph.dasharray1 = ""; $( "input[name=dashradio1][value=solid]" ).attr( "checked", true ); } else { graph.dasharray1 = "- "; $( "input[name=dashradio1][value=dashed]" ).attr( "checked", true ); } if ( guess[7] ) { graph.dasharray2 = ""; $( "input[name=dashradio2][value=solid]" ).attr( "checked", true ); } else { graph.dasharray2 = "- "; $( "input[name=dashradio2][value=dashed]" ).attr( "checked", true ); } graph.update();

În primul rând vom muta dreptele in poziția corecta, astfel încât să reprezinte corect inegalitățile. Pentru a ne fi mai simplu ne vom folosi de intersecția dreptelor cu axa y și de panta lor.

Apoi din semnul fiecărei inegalități ne vom da seama dacă dreapta trebuie să fie continuă sau întreruptă.

Iar în final, vom vedea dacă punctul de la finalul enunțului este o soluție pentru sistem.

Trebuie să aducem prima inegalitatea \blue{expr(["+", ["*", A_1, "x"], ["*", B_1, "y"]])STD_FORM_COMP_1C_1} într-o formă mai ușor de folost:

\qquad\begin{eqnarray} expr(["+", ["*", A_1, "x"], ["*", B_1, "y"]]) &STD_FORM_COMP_1& C_1 \\ coefficient(B_1)y &STD_FORM_COMP_1& expr([ "+", [ "*", -A_1, "x" ], C_1 ]) \\ y &COMP_1& PRETTY_SLOPE_1 + YINT_1 \end{eqnarray}

În această formă putem vedea că panta dreptei este \pink{fractionReduce(SLOPE_FRAC_1[0], SLOPE_FRAC_1[1])} iar intersecția cu axa y este punctul \purple{(0, YINT_1)}.

Pentru prima inegalitate \blue{y COMP_1 PRETTY_SLOPE_1 + YINT_1}, avem panta fractionReduce(SLOPE_FRAC_1[0], SLOPE_FRAC_1[1]) și intersecția cu axa y este în punctul (0, YINT_1).

Folosindu-ne de valoare pantei putem trage concluzia că dreapta trece și prin punctul (0 \pink{+ SLOPE_FRAC_1[1]}, YINT_1 \purple{+ SLOPE_FRAC_1[0]}) = (SLOPE_FRAC_1[1], YINT_1 + SLOPE_FRAC_1[0]) .

graph.pointA.setCoord([0, YINT_1]); graph.pointB.setCoord([SLOPE_FRAC_1[1], YINT_1 + SLOPE_FRAC_1[0]]); graph.update();

Trebuie să aducem prima inegalitatea \green{expr(["+", ["*", A_2, "x"], ["*", B_2, "y"]])STD_FORM_COMP_2C_2} într-o formă mai ușor de folost:

\qquad\begin{eqnarray} expr(["+", ["*", A_2, "x"], ["*", B_2, "y"]]) &STD_FORM_COMP_2& C_2 \\ coefficient(B_2)y &STD_FORM_COMP_2& expr([ "+", [ "*", -A_2, "x" ], C_2 ]) \\ y &COMP_2& PRETTY_SLOPE_2 + YINT_2 \end{eqnarray}

În această formă putem vedea că panta dreptei este \pink{fractionReduce(SLOPE_FRAC_2[0], SLOPE_FRAC_2[1])} iar intersecția cu axa y este punctul \purple{(0, YINT_2)}.

Cea de-a doua inegalitate \green{y COMP_2 PRETTY_SLOPE_2 + YINT_2}, are pante fractionReduce(SLOPE_FRAC_2[0], SLOPE_FRAC_2[1]) și intersecția cu axa y este în punctul (0, YINT_2).

Folosindu-ne de valoare pantei putem trage concluzia că dreapta trece și prin punctul (0 \pink{+ SLOPE_FRAC_2[1]}, YINT_2 \purple{+ SLOPE_FRAC_2[0]}) = (SLOPE_FRAC_2[1], YINT_2 + SLOPE_FRAC_2[0]) .

graph.pointC.setCoord([0, YINT_2]); graph.pointD.setCoord([SLOPE_FRAC_2[1], YINT_2 + SLOPE_FRAC_2[0]]); graph.update();

Dacă ne uităm la semnul primei inegalități \blue{y COMP_1 PRETTY_SLOPE_1 + YINT_1}, vedem că soluțiile ei sunt sub dreaptă și linia dreptei ar trebui să fie continuă.

Dacă ne uităm la semnul primei inegalități \blue{y COMP_1 PRETTY_SLOPE_1 + YINT_1}, vedem că soluțiile ei sunt sub dreaptă și linia dreptei ar trebui să fie întreruptă.

Dacă ne uităm la semnul primei inegalități \blue{y COMP_1 PRETTY_SLOPE_1 + YINT_1}, vedem că soluțiile ei sunt deasupra dreptei și linia dreptei ar trebui să fie continuă.

Dacă ne uităm la semnul primei inegalități \blue{y COMP_1 PRETTY_SLOPE_1 + YINT_1}, vedem că soluțiile ei sunt deasupra dreptei și linia dreptei ar trebui să fie întreruptă.

Dacă ne uităm la semnul celei de-a doua inegalități \green{y COMP_2 PRETTY_SLOPE_2 + YINT_2}, vedem că soluțiile ei sunt sub dreaptă și linia dreptei ar trebui să fie continuă.

Dacă ne uităm la semnul celei de-a doua inegalități \green{y COMP_2 PRETTY_SLOPE_2 + YINT_2}, vedem că soluțiile ei sunt sub dreaptă și linia dreptei ar trebui să fie întreruptă.

Dacă ne uităm la semnul celei de-a doua inegalități \green{y COMP_2 PRETTY_SLOPE_2 + YINT_2}, vedem că soluțiile ei sunt deasupra dreptei și linia dreptei ar trebui să fie continuă.

Dacă ne uităm la semnul celei de-a doua inegalități \green{y COMP_2 PRETTY_SLOPE_2 + YINT_2}, vedem că soluțiile ei sunt deasupra dreptei și linia dreptei ar trebui să fie întreruptă.

graph.shadetop1 = graph.pointA.coord[0] > graph.pointB.coord[0] ? LESS_THAN_1 : !LESS_THAN_1; graph.shadetop2 = graph.pointC.coord[0] > graph.pointD.coord[0] ? LESS_THAN_2 : !LESS_THAN_2; if (INCLUSIVE_1) { graph.dasharray1 = ''; $('input[name=dashradio1][value=solid]').attr('checked', true); } else { graph.dasharray1 = '- '; $('input[name=dashradio1][value=dashed]').attr('checked', true); } if (INCLUSIVE_2) { graph.dasharray2 = ''; $('input[name=dashradio2][value=solid]').attr('checked', true); } else { graph.dasharray2 = '- '; $('input[name=dashradio2][value=dashed]').attr('checked', true); } graph.update();
style({ stroke: RED, fill: RED }, function() { circle(POINT, 0.2); label(POINT, "\\red{(" + POINT[0] + ", " + POINT[1] + ")}", "right"); });

Se observă că punctul \red{(POINT[0], POINT[1])} se află în zona colorată de ambele inegalități, ceea ce înseamnă că el este o soluție a sistemului.

Se observă că punctul \red{(POINT[0], POINT[1])} nu se află în zona colorată de ambele inegalități, ceea ce înseamnă că el nu este o soluție a sistemului.