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:
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.
In order to maximize the number of regions, it seems you want to make sure that
every line intersects the inner boundary of the crescent, either in two distinct points or in a double point where it is a tangent like in your figure and
every line intersects every other line in the interior of the crescent.
Depending on how rigorous your proof has to be, you might have to elaborate on this point.
So you could choose $n$ points on the interior of the crescent, and draw a tangent at each. Then you consider the whole thing as a graph in terms of its Euler characteristic formula:
Every straight line intersects all other lines and also touches the inner boundary. So every one of the $n$ lines contributes $n+1$ straight line segments as edges of the graph. Furthermore, the inner arc is intersected once by every line, so it is split into $n+1$ curved edges. The outer arc is intersected twice, resulting in $2n+1$ curved edges. So the total number of edges is
$$E=n(n+1)+(n+1)+(2n+1)=n^2+4n+2$$
Every point of intersection between two lines is a vertex, amounting to $\binom{n}{2}=\frac{n(n-1)}2$ vertices inside the crescent. Then there are $n$ points where the lines intersect the inner arc, and $2n$ where they intersect the outer. The tips where inner and outer arc meet contribute two more vertices. So the total number is
This is because topologically your crescent is a disk, so it has Euler characteristic $\chi=1$.
Except for an offset of one in the indices (i.e. the value of $n$), these are exactly the triangular numbers. They do confirm the numbers you gave in your question, so you did count right.
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:
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.