Click to See Complete Forum and Search --> : Crescent moon Formula


HanneSThEGreaT
November 14th, 2006, 02:00 AM
Hey geniuses! :wave:

Not sure if this is the appropriate forum, but it is still Graphics related :rolleyes:

I'm busy with a project in VB 6 / VB.NET, which should not be this complicated, and is really starting to make me a bit frustrated!

Basically what I want to do is to draw a Crescent Moon shape, then later on, enable the user to draw it with the mouse.

I want to know :
Is there a special mathematics formula that I can use to create the crescent shape - I guess Sin and Cos should be used.

I had two overlapping circles, which worked fine when I want to fill the crescent, but I'm looking for a way to draw the Outline of the crescent.

Can anyone give me some ideas on this ¿

JohnyDog
November 14th, 2006, 03:35 AM
As you've said, mathematically it is just intersection between two circles. If you are using predefined function to draw filled circles, you can create outline by first drawing one of the circle, then drawing smaller one with the same center and background color. Repeat for the second circle, and as final step, cut the unneeded part with drawing box or another circle. This is the simplest method, of course you also can use sin/cos to draw two semi-circles pixel by pixel.

HanneSThEGreaT
November 14th, 2006, 03:59 AM
Thanx for the advice Johny! :thumb:

I have drawn a circle using Sin / Cos in a loop, so then I thought, I'd just draw another one, but the main problem was the starting and ending points of the "inner" circle.

In .NET luckily, there are Intersect and Union objects, do you think I should rather opt for that ¿

I thought this was going to be easy...