# graphics.h

Printable View

• 12-02-2007
turck3
graphics.h
I downloaded this graphics library:
http://www.uniqueness-template.com/devcpp/graphics.h

and I have figured it out for the most part, but I have one simple question....

I want to know how to detect if the user clicks inside a circle (I'm fairly certain that this just has something to do with trig which I havn't learned yet)

I made a function for squares:

Code:

```bool Squareclick(int x1, int y1, int x2, int y2, int click)     {         if(click != 513 & click != 516 & click != 519)         {               click = (click + 1) * 3 + 510;                }         //Click Types WM_LBUTTONDOWN replace L with M or R         bool h = false;         if(mousex() > x1 & mousex() < x2 & mousey() > y1 & mousey() < y2 & ismouseclick(click) == true)         {               h = true;                    }         else { clearmouseclick(click); }         return h;     }```
So if someone could help me to detect if a click occurs in a circle that would be great :)

also, is their a easy way to detect if one of the radii of a circle has come in contact with something? Just a general math algorithm for finding where the radii are would be nice.

thanks in advance
• 12-02-2007
VirtualAce
The equation of a circle should be a clue.
• 12-02-2007
turck3
hm?
But how would I find that out??
• 12-02-2007
Desolation
• 12-02-2007
turck3
Ahhh many thanks :)

Ill impliment this tommorow