Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Formule pour vérifier si un point (x, y) appartient à un cercle :
- private boolean coordinateBelongToCircle(float x, float y, Circle circle) {
- if ((x - circle.getX()) * (x - circle.getX()) + (y - circle.getY()) * (y - circle.getY()) <= circle.getRadius() * circle.getRadius()) {
- return true;
- } else {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement