How to find the points where it is most extreme on the X and Y axis?

For example lets say I have an equation that describes an ellipse that is rotated:

(x * RadiusX * Rx + y * RadiusX * Ux)^2 + 
(x * RadiusY * Ry + y * RadiusY * Uy)^2 = RadiusY^2 

enter image description here

How can I find the points where it will be most extreme on each axis

Please keep in mind the values for variables RadiusX, RadiusY, Rx, Ry, Ux, Uy are known.

An example with values:

((x * 1 * 0.70711) + (y * 1 * -0.70711))^2 + 
((x * 1.414213 * -0.70711) + (y * 1.414213* -0.70711))^2 = 1.414213 * 1.414213

2 Answers 2


A trick I find often helps with ellipses is to think of them as stretched/rotated copies of the unit circle.

By reversing the transformation, we can map the problem back onto the unit circle, where the math is usually easier, then run the answer back through the transformation to answer our original question about the ellipse.

enter image description here

To roughly outline the steps:

  1. Find the transformation matrix that maps the unit circle to your ellipse, then compute its inverse

  2. Apply its inverse to vectors along the horizontal and vertical axes (1, 0) & (0, 1) - these give you the directions of the edges of the blue bounding box, after it's been squashed to a diamond.

    Our extreme points in our original coordinate system map to where these slanted lines are tangent to the circle.

  3. Take the perpendiculars of these transformed directions (green lines in the diagram above) and normalize them to unit length to snap them onto the unit circle. These are the points of tangency.

  4. Apply your transformation matrix to these tangent points to map them back to the extremes in our original coordinate system.

  • \$\begingroup\$ Thank you very much for your help. This solution does it for me. I had to do a bit of extra work to implement it, but at the end, the solution does indeed give the points on the ellipse that is tangent to the axis directions. This should allow me to create a Cylinder/Plane/Box Collision detection without having to use Lagrange Multiplier. \$\endgroup\$
    – mdshirzada
    Jun 5, 2018 at 22:46

The general equation of an ellipse centered at the origin is:


Expand w.r.t x and y:


An horizontal line has equation y=k. Either it intersects with the ellipse in two points, or it intersects in only one point (it's tangent), or it doesn't intersect at all. We find the intersection by solving the trinomial (in x):


There is only one intersection when the discriminant is zero, hence you want to find k such that


Expand and simplify:





The positive k is the maximum value of y, the negative the minimum value. By symmetry of the ellipse, they are opposite.

The extreme values of x can be found the same way, using a vertical line x=l. The same computation will lead to


The positive l is the maximum value of x, the negative the minimum value. Again, by symmetry of the ellipse, they are opposite.

The expressions found are not defined when ad=bc, but then the two squares in the original equation are proportional and the conic is degenerate (the equation leads to two parallel lines).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .