Graphing Linear Inequalities in Two Variables and Finding the Solution Region

Graphing Linear Inequalities in Two Variables and Finding the Solution Region
Loading the math board and drawing, please wait…
2023-09-25 20:29
This example demonstrates how to graph linear inequalities in two variables on a 2D coordinate plane and determine the solution set by checking whether points lie in the correct region (including the boundary when appropriate). It focuses on key concepts such as linear inequalities, half-planes/solution regions, boundary lines (solid vs. dashed for ≤/≥ vs. </>), and graphical reasoning for solving bivariate linear inequalities. In construction, it uses GeoGebra objects and commands reflected in the build: Inequality to model the statement, Line to create the boundary line, and IsInRegion with test points (e.g., TestPoint / TestPointInReg) to decide membership in the solution region. It employs Split for dividing objects along boundaries, and geometry utilities like Segment, Polygon, and IntersectPath to construct and display region visuals. It also includes logic and branching tools such as Sequence/If/IndexOf/AreEqual to manage cases, plus Textfield/Text and Translate for explanatory labels and feedback. The learning experience is guided by onboardingStage and hint-related objects (showhint1, onboardingTextOffset). Suitable for grades 9–12 and for teaching interactive visualization of inequality solution regions.

GeoGebra Commands & Parameters

  1. Sequence(Random[0, 99] / 100, A, 1, 200) → allRandomSeeds, {0.39, 0.65, 0.37, 0.82, 0.69, 0.31, 0.54, 0.23, 0.13, 0.95, 0.22, 0.94, 0.8, 0.59, 0.16, 0.17, 0.95, 0.96, 0.11, 0.03, 0.62, 0.42, 0.72, 0.7, 0.15, 0.93, 0.34, 0.58, 0.85, 0.92, 0.12, 0.31, 0.26, 0.11, 0.82, 0.73, 0.76, 0.16, 0.38, 0.19, 0.51, 0.84, 0.98, 0.97, 0.53, 0.87, 0.02, 0.79, 0.12, 0.14, 0.47, 0.23, 0.86, 0, 0.39, 0.54, 0.35, 0.89, 0.49, 0.76, 0.43, 0.47, 0.06, 0.55, 0.71, 0.39, 0.5, 0.11, 0.65, 0.68, 0.81, 0.12, 0.2, 0.91, 0.49, 0.23, 0.69, 0.72, 0.17, 0.9, 0.89, 0.12, 0, 0.92, 0.53, 0.44, 0.56, 0.41, 0.93, 0.54, 0.43, 0.12, 0.5, 0.83, 0.62, 0.31, 0.01, 0.49, 0.5, 0.59, 0.56, 0.62, 0.36, 0.02, 0.07, 0.5, 0.93, 0.49, 0.17, 0.51, 0.56, 0.95, 0.22, 0.63, 0.71, 0.45, 0.93, 0.44, 0.57, 0.87, 0.31, 0.79, 0.78, 0.53, 0.75, 0.46, 0.33, 0.47, 0.05, 0.41, 0.36, 0.06, 0.57, 0.76, 0.66, 0.21, 0.89, 0.96, 0.25, 0.63, 0.2, 0.07, 0.32, 0.27, 0.06, 0.22, 0.9, 0.78, 0.93, 0.38, 0.69, 0.68, 0.14, 0.78, 0.51, 0.84, 0.21, 0.21, 0.39, 0.7, 0.19, 0.48, 0.21, 0.27, 0.65, 0.87, 0.64, 0.12, 0.06, 0.37, 0.93, 0.44, 0.9, 0.09, 0.24, 0.92, 0.31, 0.49, 0.62, 0.32, 0.26, 0.7, 0.74, 0.72, 0.22, 0.63, 0.86, 0.8, 0.76, 0.71, 0.03, 0.98, 0.34, 0.24, 0.9, 0.19, 0.43, 0.78, 0.73, 0.09}
  2. Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1) → currentRandomSeeds
  3. If(currentRandomSeeds(3) ≥ 0.5, 1, 2) → Case
  4. Line((If[randomNum1 ≟ 0, 1, randomNum1], 0), (0, If[randomNum2 ≟ 0, 1, randomNum2])) → lineCase1
  5. If(Case ≟ 1, AreCollinear[TestPoint, Intersect[lineCase1, xAxis], Intersect[lineCase1, yAxis]], AreCollinear[TestPoint, (0, randomNum2), (1, randomNum1 + randomNum2)]) → TestPointInLine
  6. If(Mod[Inequality, 2] ≟ 1, y < (randomNum1 * x) + randomNum2, y > (randomNum1 * x) + randomNum2) → ineq2
  7. Element({"≤", "≥", "<", ">"}, Inequality) → InequalityText
  8. If(invert, If[Mod[Inequality, 2] ≟ 1, y > (Slope[lineCase1] * x) + If[randomNum2 ≟ 0, 1, randomNum2], y < (Slope[lineCase1] * x) + If[randomNum2 ≟ 0, 1, randomNum2]], If[Mod[Inequality, 2] ≟ 1, y < (Slope[lineCase1] * x) + If[randomNum2 ≟ 0, 1, randomNum2], y > (Slope[lineCase1] * x) + If[randomNum2 ≟ 0, 1, randomNum2]]) → ineq1
  9. IsInRegion(TestPoint, If[Case ≟ 1, ineq1, ineq2]) → TestPointInReg
  10. Split(TextCase1, {"≥", "≤", ">", "<"}) → Text1Split
  11. Zip(AreCollinear[PP, (0, randomNum2), (1, randomNum1 + randomNum2)], PP, TestPoints) → InLineCase2
  12. Zip(AreCollinear[PP, Intersect[lineCase1, xAxis], Intersect[lineCase1, yAxis]], PP, TestPoints) → InLineCase1
  13. IndexOf(false, If[Case ≟ 1, InLineCase1, InLineCase2]) → pointNum
  14. Element({"Drag to draw a line", "Click to change the line style", "Click to select a region"}, onboardingStage) → onboardingText
  15. Line(P1, P2) → studLine
  16. If(Defined[Slope[studLine]], y < (Slope[studLine] * x) + studLine(0) ∧ (-GVsize) ≤ x ≤ GVsize ∧ (-GVsize) ≤ y ≤ GVsize, x(P1) < x < GVsize ∧ (-GVsize) ≤ y ≤ GVsize) → side2
  17. Zip(IsInRegion[PP, side2], PP, TestPoints) → InSide2
  18. If(Defined[Slope[studLine]], y > (Slope[studLine] * x) + studLine(0) ∧ (-GVsize) ≤ x ≤ GVsize ∧ (-GVsize) ≤ y ≤ GVsize, (-GVsize) < x < x(P1) ∧ (-GVsize) ≤ y ≤ GVsize) → side1
  19. Zip(IsInRegion[PP, side1], PP, TestPoints) → InSide1
  20. AreEqual(studLine, If[Case ≟ 1, lineCase1, lineCase2]) → correct1
  21. Zip(IsInRegion[PP, ineq2], PP, TestPoints) → InIneq2
  22. Zip(IsInRegion[PP, ineq1], PP, TestPoints) → InIneq1
  23. Textfield(input1) → InputBox1
  24. Textfield(input2) → InputBox2
  25. Corner(5) → layoutAppSize
  26. PointToPixels(Corner[onboardingDisplayText, 2], Corner[1], Corner[3], Corner[5]) → layoutOnboarding
  27. Polygon({((-GVsize), (-GVsize)), (GVsize, (-GVsize)), (GVsize, GVsize), ((-GVsize), GVsize)}) → q1
  28. Text("x", (GVsize + 0.5, 0.1), true, true, 0, 0) → text1
  29. Text("y", (0, GVsize + 0.5), true, true, 0, 0) → text2
  30. Translate(hGL, Vector[(Vector[Corner[4], Corner[1]] / 500 * 16)]) → hGL'
  31. Translate(vGL, Vector[(Vector[Corner[1], Corner[2]] / 800 * 16)]) → vGL'
  32. onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5]) → OnboardingTextOffset
  33. circlePixels(P1, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5]) → pulsingObject
  34. circlePixels(P2, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5]) → pulsingObject2
  35. IntersectPath(studLine, q1) → f
  36. expandSegment(Vertex[f, 1], Vertex[f, 2], (7 * pulsing), Corner[1], Corner[3], Corner[5]) → pulsingObject3
  37. Split(Text1Replace, {"≥", "≤", ">", "<"}) → l1
  38. Split(TextCase2, {"≥", "≤", ">", "<"}) → Text2Split
  39. ReplaceAll(ReplaceAll[Text1Split(1), "x", (("(" * x(TestPoint)) * ")")], "y", (("(" * y(TestPoint)) * ")")) → text3
  40. Segment(((-GVsize) + a, 0), (GVsize - a, 0)) → fakeXAxis
  41. Segment((0, (-GVsize) + a), (0, GVsize - a)) → fakeYAxis
  42. circlePixels(TestPoint, 9 + (7 * pulsing), Corner[1], Corner[3], Corner[5]) → pulsingSol

AI Drawing Prompt Reference

Graph linear inequalities on a 2D coordinate plane, showing boundary lines and solution regions. Generate random points and lines, then determine the type of boundary line (solid or dashed) based on the inequality. Use test points to check if they lie within the solution region, highlighting them accordingly. Add axes, labels, and explanatory text to clarify the method of solving and the meaning of the solution region.
The prompt above was compiled from the original drawing commands and is for reference only.