
graphics.h
I downloaded this graphics library:
http://www.uniquenesstemplate.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

The equation of a circle should be a clue.

hm?
But how would I find that out??


Ahhh many thanks :)
Ill impliment this tommorow