How to find the angle of rotation of the major axis of an ellipse given its bounding rectangle

boundingellipserotation

I have an ellipse centered at (0,0) and the bounding rectangle is x = [-5,5], y = [-6,6]. The ellipse intersects the rectangle at (-5,3),(-2.5,6),(2.5,-6),and (5,-3)

I know nothing else about the ellipse, but the only thing I need to know is what angle the major axis is rotated at.

seems like the answer must be really simple but I'm just not seeing it… thanks for the help!

Best Answer

If (0, 0) is the center, than equation of Your ellipse is:

F(x, y) = Ax^2 +By^2 + Cxy + D = 0

For any given ellipse, not all of the coefficients A, B, C and D are uniquely determined. One can multiply the equation by any nonzero constant and obtain new equation of the same ellipse.

4 points You have, give You 4 equations, but since those points are two pairs of symmetrical points, those equations won't be independent. You will get 2 independent equations. You can get 2 more equations by using the fact, that the ellipse is tangent to the rectangle in hose points (that's how I understand it).

So if F(x, y) = Ax^2 +By^2 + Cxy + D Your conditions are:
dF/dx = 0 in points (-2.5,6) and (2.5,-6)
dF/dy = 0 in points (-5,3) and (5,-3)

Here are four linear equations that You get

F(5, -3) = 5^2 * A + (-3)^2 * B + (-15) * C + D = 0  
F(2.5, -6) = (2.5)^2 * A + (-6)^2 * B + (-15) * C + D = 0  
dF(2.5, -6)/dx = 2*(2.5) * A + (-6) * C = 0  
dF(5, -3)/dy = 2*(-3) * B + 5 * C = 0  

After a bit of cleaning:

   25A +  9B - 15C + D = 0 //1
6.25A + 36B - 15C + D = 0 //2
   5A       -  6C     = 0 //3
      -  6B +  5C     = 0 //4

Still not all 4 equations are independent and that's a good thing. The set is homogeneous and if they were independent You would get unique but useless solution A = 0, B = 0, C = 0, D = 0.

As I said before coefficients are not uniquely determined, so You can set one of the coefficient as You like and get rid of one equation. For example

   25A + 9B - 15C = 1 //1
   5A      -  6C = 0 //3
      - 6B +  5C = 0 //4

From that You get: A = 4/75, B = 1/27, C = 2/45 (D is of course -1)

Now, to get to the angle, apply transformation of the coordinates:

x = ξcos(φ) - ηsin(φ)
y = ξsin(φ) + ηcos(φ)

(I just couldn't resist to use those letters :) )
to the equation F(x, y) = 0

F(x(ξ, η), y(ξ, η)) = G(ξ, η) =
  A (ξ^2cos^2(φ) + η^2sin^2(φ) - 2ξηcos(φ)sin(φ))
+ B (ξ^2sin^2(φ) + η^2cos^2(φ) + 2ξηcos(φ)sin(φ))
+ C (ξ^2cos(φ)sin(φ) - η^2cos(φ)sin(φ) + ξη(cos^2(φ) - sin^2(φ))) + D

Using those two identities:

2cos(φ)sin(φ) = sin(2φ)
cos^2(φ) - sin^2(φ) = cos(2φ)

You will get coefficient C' that stands by the product ξη in G(ξ, η) to be:

C' = (B-A)sin(2φ) + Ccos(2φ)

Now your question is: For what angle φ coefficient C' disappears (equals zero)
There is more than one angle φ as there is more than one axis. In case of the main axis B' > A'

Related Topic