Expand your control over the coordinate plane by learning how to apply restrictions on the domain and range of expressions, functions, and relations.

### Basic

Goal: Use eight expression lines to graph the rectangle (four points, four line segments) shown below.

Note: Be sure to add restrictions (domain or range) to limit the segments.

### Advanced

Goal: Use six expression lines to graph the triangle (three movable points, three line segments) shown below.

Hint: Use some “min” and “max” magic on your domain restrictions so that the line segments remain visible regardless of where you drag the movable points.

### Legendary

Goal: Use four expression lines to create purple rain (and green grass).

Hint: I used a list, a linear function with a sinusoidal domain restriction, a slider (the rain needs to fall from the sky, after all), and an absolute-value heavy sinusoid (for the grass).

Note: Don’t worry about matching the image perfectly on this one. Just make it rain!

### Solutions

Get ’em here.

### You Create

Use what you’ve learned about restrictions to create your own amazing graph. Share it here.

(Need some help with how to share a graph? Check out 11 Challenges: Saving and Sharing (#9).)

## Comments 3

Hey! I’m loving this tutorial you’ve put together. I was working on the advanced level above and noticed that there are values where if the slider is dragged to them, the line disappears, in both the one I created and on your solutions page, even though I defined my functions a bit differently than yours. Upon investigation, I believe this is happening due to the slope having a denominator of zero when the x values in the denominator are the same on the sliders. Is there any sort of workaround with Desmos to say something to the effect of “when the denominator of the slope=0 (e.g. when x2-x1=0), graph x=x1 between y1 and y2 instead?

Hi Seth. Thanks for stopping by. Here’s an idea for solving that issue: https://www.desmos.com/calculator/iklvo9mcc7

That strikes me as a little clunky and tedious, but it does the trick, and keeps restrictions in the mix.

Here’s how I would probably build that graph now if I wasn’t concerned about using restrictions: https://www.desmos.com/calculator/fyl98rofbn

Let me know if either of those help!

Hi Michael. Both options are definitely helpful to see, but especially the first since I couldn’t quite figure out how to input those additional restrictions. Of course the second option is clearly preferred if restrictions aren’t needed. Thanks so much for your quick reply!