Inequality & Region Shading Math

x: ---, y: ---

What is the Inequality Region Shader?

Quick Answer: An interactive visualization that fills the area where a mathematical inequality (like y > x^2 - 4 or x^2 + y^2 < 25) is true. It helps linear programming, JEE/SAT graph-based problems, and shows feasible regions instantly.

Theory of Inequality Regions

A two‑variable inequality divides the coordinate plane into two regions: where the condition is true and where it is false. The boundary is typically the curve where the expression equals zero. This tool evaluates the boolean expression for every pixel using Math.js, which supports relational operators (<, >, <=, >=, ==) and logical connectives (and, or, not). The shaded region represents the solution set. Multiple constraints can be combined to form a feasible region, a core concept in linear programming and optimization problems.

Core formula: The pixel is shaded if the compiled inequality evaluates to true for its world coordinates (x, y).

Step-by-Step Examples

Example 1: Quadratic Inequality

  1. Enter y > x^2 - 4. Press Shade Region.
  2. The area above the parabola y = x² - 4 is filled with the chosen color.
  3. Toggle grid/axes for reference. The parabola itself is not drawn as a boundary but the shading clearly shows the region.

Example 2: Circle Interior

  1. Input x^2 + y^2 < 25. This shades the interior of a circle radius 5.
  2. To see the exterior, invert the inequality: x^2 + y^2 >= 25.

Example 3: Feasible Region (Intersection)

  1. Combine conditions with and: y > -x + 2 and y < x + 2.
  2. This shades the infinite strip between two lines, showing the overlapping region.

Frequently Asked Questions

What syntax is allowed in the inequality?

Use standard math functions (sin, cos, abs, log, sqrt, etc.) and relational operators (<, >, <=, >=, ==). Combine with 'and', 'or', 'not'. Example: abs(x) + abs(y) < 2.

Why doesn't the boundary line appear?

The tool shades only the region where the inequality is true. To see the boundary, you would need an additional equation plotter. Use our 2D Function Plotter for that.

Can I use this for linear programming?

Yes, enter each constraint joined by 'and' to visualize the feasible polygon. However, for many constraints, the expression may become long; we recommend entering up to 3-4.

How do I zoom and pan?

Scroll to zoom, hold Shift and drag to pan. Reset View returns to default coordinates.

Is the evaluation pixel‑perfect?

The region is sampled at each pixel, so the edge of the region aligns with the mathematical boundary within 1‑2 pixels.