Geometry – How to Check if a Point is Within an Ellipse

conic sectionseuclidean-geometrygeometry

I have an ellipse centered at $(h,k)$, with semi-major axis $r_x$, semi-minor axis $r_y$, both aligned with the Cartesian plane.

How do I determine if a point $(x,y)$ is within the area bounded by the ellipse?

Best Answer

The region (disk) bounded by the ellipse is given by the equation: $$ \frac{(x-h)^2}{r_x^2} + \frac{(y-k)^2}{r_y^2} \leq 1. \tag{1} $$ So given a test point $(x,y)$, plug it in $(1)$. If the inequality is satisfied, then it is inside the ellipse; otherwise it is outside the ellipse. Moreover, the point is on the boundary of the region (i.e., on the ellipse) if and only if the inequality is satisfied tightly (i.e., the left hand side evaluates to $1$).