may help you . You have to decide what kind of tolerance your method will use. While your example uses points that are expressible in floating point, there are many points along the border of the ellipse which will not be, and so deciding whether a point is "on the border" isn't clear-cut. If you don't much care, then I would suggest making the ellipse slightly "bigger" than you actually want and using the built-in contains() method. If you want to write your own method, it's as simple as taking the formula for an ellipse, plugging in the X and Y values of the point you wish to test, and observing the result:
Any of those help After short check - it seems that OpenCV function calculates middle angle as ma = (angle1 + angle2) / 2 and draws arc through this point. Both (-45,45) and (45,-45) give the same 90-degrees arc through zero, both (315,45) and (45,315) give the same 270-degrees arc.
Points of Intersection of an Ellipse and a line after rotating ellipse by angle theta
it fixes the issue If you have tested and ready-to-use solution for axis-aligned ellipse, it is much simpler to transform points defining line into ellipse system, find intersection points, then make reverse transformation. For origin-centered ellipse and rotation angle theta
should help you out The usual approach would be to project a line horizontally left from your given point and find the nearest edge that that line intersects. The direction of that edge tells you whether the point is inside or outside the polygon (with a path direction imposed as per Paul's suggestion). If no edge is encountered, you are, of course, outside. To achieve this, you need each cell of your binary tree to reference every edge that passes through the cell, even if its vertices are outside the cell. You may sometimes need to traverse through multiple cells to find the nearest intersecting edge.