[Math] How to graph crescent

circlesgraphing-functions

I have this graph in Desmos

enter image description here

and I want just the green part (i.e. crescent moon shape) to appear. How do I do that?

Best Answer

The key feature of Desmos that allows this to be possible is restricting the domain and range of a graph. For example, if you type into Desmos $$f(x)=x^2\{0\le y\le1\},$$ the resulting graph will be a segment of a parabola with its vertex at the origin that's truncated at $y=1$. If, for example, you type in $$g(x)=x^2\{x\ge0\},$$ the resulting graph will be the right half of a parabola.

Using this principle, it's possible to construct two circles of the form $$(x-a)^2+(y-b)^2=r^2$$ and use one to selectively restrict the domain of the other to produce a crescent, like this:

Shaded crescent Desmos graph

Equations (2) and (3) just show the circles in question (since we care about the crescent, not the individual circles, I've turned off their display for now). Equation (4) produces the left edge of the crescent and the shaded area, and Equation (5) produces the right edge of the crescent. $D$ is a constant that's determined by a complicated combination of $a_1$, $a_2$, $b_1$, $b_2$, $r_1$, and $r_2$.

See the note at the top of the equation list; this method is rather specific to the geometry of the situation you gave in the question. If the circles have different radii or have their centers at different $y$-values, my graph breaks down pretty quickly. I imagine there is a more general way to do this, but I don't know at the moment what that would be. For now, here's the Desmos graph I made, so you can explore it in more detail: https://www.desmos.com/calculator/hfqwdoyfgv.

Related Question