I recently read this Draw A Star tutorial by @TIMAI2, and I was thinking about how to draw moons on a canvas.
However, unlike stars, moons have different patterns over days, as shown in the image below. The white parts are the parts that you will see at night, while the gray parts are the ones you couldn't see.
I know. It draws two circles, one in yellow and the other in the background color. The yellow circle will be drawn at the first time, and the circle with the background color covers a part of the circle, making it look like a waning crescent. However, if there is any other stuff near the yellow circle, that will be covered.
which gives you the position of a point on the circumference of a circle, using the radius and the x,y position of the circle, where φ is the angle. Loop this over a range to get your shape.