I am currently using fl_chart package in order to create a scatter plot with flutter.
I am trying to mimic the functionality of a venn diagram just for the case of two circles.
Is there a way that I can detect a click inside the intersection of these circles?
So far I was only able to detect a click on either of those circles even when I click over their intersection.
Is there a way to achieve such thing on flutter? I am not bound to this specific package if you know about a package that provides this functionality I would love to hear about it.
To detect a click in the intersection of 2 circles, you'll need 3 pieces of information:
If you know these, then you can use the distance formula to calculate the distance between the clicked point, and the center of one of the circles. If the distance is less than or equal to the radius, then it is within the circle. Now you check the distance to the other circle's center and if it is also less than or equal to the radius of the 2nd circle, then it is within both circles, meaning it is in the overlapping area.