Answer the question
In order to leave comments, you need to log in
How to determine whether a point belongs to a circle?
There is a circle, the position of the center is conditionally x \u003d 150, y \u003d 100 and radius \u003d 50. And also a point, let it be in coordinates x \u003d 100, y \u003d 100.
How to determine whether a point is inside the circle?
bool isInside = (circleInner->getPositionX() >= touch->getLocationInView().x - 55 &&
circleInner->getPositionX() <= touch->getLocationInView().x + 55) &&
(circleInner->getPositionY() <= touch->getLocationInView().x + 55 &&
circleInner->getPositionY() >= touch->getLocationInView().x - 55)
bool isInside = (circleInner->getPositionX() - touch->getLocationInView().x <= 55) &&
(circleInner->getPositionY() - touch->getLocationInView().y <= 55)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question