Category: Algebra Level: 201
|x - 2| < 3 ⇔ -1 < x < 5
|x − 2| is the distance from x to 2. Asking for a distance under 3 picks out every point within 3 steps of 2, in either direction.
The bars measure how far x sits from 2, ignoring direction. So mark 2 as the center.
|x - 2| = distance from x to 2
Step 3 to the right and 3 to the left of the center. Both walks cover the same distance.
2 - 3 = -1, 2 + 3 = 5
At -1 and 5 the distance is exactly 3. The rule says less than 3, so the edges stay out.
|-1 - 2| = 3, |5 - 2| = 3
Every point between the edges is within 3 of the center. One absolute value inequality becomes two plain ones.
-3 < x - 2 < 3 so -1 < x < 5
x = 4 is 2 away from the center: in. x = 6 is 4 away: too far, out.
|4 - 2| = 2 < 3 in; |6 - 2| = 4 > 3 out
cd svg-generator python3 -m svgmath render absolute-value-distance --out /tmp/absolute-value-distance
Source: svgmath/diagrams/equations.py