Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Formule pour vérifier si un point (x, y) appartient à un cercle :
  2.  
  3. private boolean coordinateBelongToCircle(float x, float y, Circle circle) {
  4. if ((x - circle.getX()) * (x - circle.getX()) + (y - circle.getY()) * (y - circle.getY()) <= circle.getRadius() * circle.getRadius()) {
  5. return true;
  6. } else {
  7. return false;
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement