boolean isInsideCircle ( float centerPointX , float centerPointY , float radius ) { double xValue = Math . pow ( ( getX ( ) - centerPointX ) , 2 ) ; double yValue = Math . pow ( ( getY ( ) - centerPointY ) , 2 ) ; double radiusValue = Math . pow ( radius , 2 ) ; boolean touchPointInsideCircle = xValue + yValue <= radiusValue ; LOGGER . trace ( "Detected touch point {} inside the main circle" , touchPointInsideCircle ? "IS" : "IS NOT" ) ; return touchPointInsideCircle ; }
Checks whether the touch point is inside the circle or not