To rotate an absolute value function like y = |x|, you replace x and y in the original equation with expressions that account for the rotation angle. This uses a coordinate substitution based on the 2D rotation matrix, and it works for any angle you choose. The technique applies to graphing calculators like Desmos, homework problems, and any situation where you need a tilted V-shape.
Why Simple Algebra Won’t Work
You might first try to “solve for y” to get a neat rotated version of y = |x|. But rotating a function around the origin generally produces a curve that fails the vertical line test, meaning it’s no longer a function of x in the traditional sense. A 90-degree rotation of y = |x|, for example, gives you a sideways V that has two y-values for some x-values. Instead of working with y = f(x), you work with an implicit equation relating x and y.
The Coordinate Substitution Method
The core idea is straightforward: instead of moving every point on the graph, you rotate the coordinate axes in the opposite direction. If you want to rotate a graph counterclockwise by angle θ, you substitute the following into your original equation:
- Replace x with: x cos θ + y sin θ
- Replace y with: −x sin θ + y cos θ
These come from the transpose of the standard 2D rotation matrix. When you rotate the coordinate system by θ counterclockwise, a fixed point (x, y) has new coordinates x’ = x cos θ + y sin θ and y’ = −x sin θ + y cos θ. Plugging these into the original equation effectively rotates the entire graph by θ counterclockwise around the origin.
Applying It to y = |x|
Start with the equation y = |x|. Everywhere you see x in the original equation, write (x cos θ + y sin θ). Everywhere you see y, write (−x sin θ + y cos θ). The rotated equation becomes:
−x sin θ + y cos θ = |x cos θ + y sin θ|
That single equation, with θ as your chosen angle, draws a rotated absolute value graph. In Desmos, you can type this directly using a slider for θ (or “a” as the variable) and watch the V-shape tilt in real time. This is exactly the form Desmos uses internally for rotated absolute value graphs.
Worked Example: 45-Degree Rotation
Set θ = 45° (or π/4 radians). Since cos 45° = sin 45° = √2/2, the substitutions simplify nicely:
- x becomes: (√2/2)(x + y)
- y becomes: (√2/2)(−x + y)
Plugging into y = |x| gives:
(√2/2)(−x + y) = |(√2/2)(x + y)|
The √2/2 factor cancels from both sides, leaving:
−x + y = |x + y|
Now consider two cases. When x + y ≥ 0, the absolute value drops and you get −x + y = x + y, which simplifies to x = 0 (the positive y-axis). When x + y < 0, you get −x + y = −(x + y), which simplifies to y = 0 with the constraint x + y < 0, meaning the negative x-axis. So a 45-degree counterclockwise rotation of y = |x| produces an L-shape along the positive y-axis and the negative x-axis. This makes visual sense: the original V (pointing up along the angle bisectors of quadrant I and II) tilts counterclockwise to sit along the axes.
Worked Example: 90-Degree Rotation
For θ = 90° (π/2 radians), cos 90° = 0 and sin 90° = 1. The substitutions become:
- x becomes: y
- y becomes: −x
The rotated equation is simply −x = |y|. Since an absolute value is always non-negative, this requires −x ≥ 0, meaning x ≤ 0. Rewrite it as |y| = −x, or equivalently x = −|y|. This is a sideways V opening to the left, which is exactly what you’d expect from rotating the upward-opening V by 90 degrees counterclockwise.
For a 90-degree clockwise rotation, use θ = −90°. The same process gives you x = |y|, a sideways V opening to the right.
How to Graph It in Desmos
Desmos handles implicit equations natively, which makes this easy. Type the following into an expression line:
-x sin(a) + y cos(a) = |x cos(a) + y sin(a)|
Desmos will prompt you to add a slider for “a.” Move the slider and the V-shape rotates smoothly around the origin. The slider value is in radians by default. If you prefer degrees, wrap your angle in a conversion: use (aπ/180) in place of “a” throughout, then the slider moves in degrees.
If you want to rotate a shifted absolute value function like y = |x − 2| + 3, use the same substitution. Replace every x with (x cos θ + y sin θ) and every y with (−x sin θ + y cos θ). The equation gets longer but the method is identical.
Rotating Around a Point Other Than the Origin
The substitution above always rotates around the origin. To rotate around a different center point (h, k), you first shift the graph so the center lands on the origin, apply the rotation, then shift back. In practice, replace x with (x − h) and y with (y − k) before applying the rotation formulas, then add h and k back afterward.
For y = |x| rotated by θ around the point (h, k), the equation becomes:
−(x − h) sin θ + (y − k) cos θ = |(x − h) cos θ + (y − k) sin θ|
This shifts the vertex of the V to (h, k) and then rotates around that point. In Desmos, this works with sliders for h, k, and θ, giving you full control over position and tilt.
Why the Substitution Goes “Backward”
A common source of confusion: to rotate a graph counterclockwise, you apply the clockwise rotation to the coordinates. This feels backward, but it follows from how implicit equations work. The graph of an equation is the set of all (x, y) points that satisfy it. When you want to rotate that set counterclockwise by θ, you ask: “Which point, if I rotated it clockwise by θ, would land on the original graph?” That backward rotation is what the substitution computes. If you accidentally use the forward rotation (replacing x with x cos θ − y sin θ and y with x sin θ + y cos θ), your graph will rotate in the opposite direction from what you intended.

