How to determine coordinates of touch event on an imageview which has an arc and rectangle in Android
<p>I have the following shape-image</p>

<p><a href="https://i.stack.imgur.com/taKlM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/taKlM.png" alt="enter image description here"></a></p>

<p>I want to validate my touch events when I touch in the blue area or not in my imageview. I need to combine the arc and the rectangle as one and validate the coordinates of the touch event? </p>

<p>I use this if it was a circle</p>

<pre><code>private boolean isIn3PointArea(float touchX, float touchY, float centerX, float centerY, double r){
    float x = touchX - centerX;
    float y = touchY - centerY;
    return (touchY &lt; centerY &amp;&amp; Math.sqrt(x*x+y*y) &gt; r);
}
</code></pre>