Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Determining if a point is within a circle

807606Feb 18 2007 — edited Feb 19 2007
Hey guys,
I have need to write an applet that does the following:
1. Draws a circle
2. When a user clicks anywhere inside the circle and drags the mouse to
a different location the circle should be redrawn in that location when mouse is released.

My question is:
How do you determine weather a mouse click occurred within a circle? I think the question is rather mathematical, basically how to check if a point
A(x, y) is inside a circle.

Thanks for your help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 19 2007
Added on Feb 18 2007
4 comments
83 views