Equation of an Ellipse with Predetermined Foci

Introduction

We all know the equation of an ellipse \( \frac{x^{2}}{a^{2}} + \frac{y^{2}}{b^{2}} = 1 \). This ellipse has foci at \( (-c, 0) \) and \( (c, 0) \) where \( c^{2} = a^{2} - b^{2} \). Of the three variables, a, b, and c, we can choose any two and draw an ellipse of our choosing. But this equation is limited to having the foci on the x-axis. Only way to choose an alternate ellipse is if the foci are on the y-axis instead so that the equation is \( \frac{x^{2}}{b^{2}} + \frac{y^{2}}{a^{2}} = 1 \). This just changes the major axis of the ellipse to be on the y-axis. At most, we can shift the center of the ellipse.

What if we wanted an ellipse where the foci is at our own choosing, any where on the graph so that the ellipse is in any orientation? I pondered this question years ago but never came up with an equation. The math was just too complicated and I got nowhere. But now, armed with new skills and new knowledge and new experience and some more insight, I came up with an equation of an ellipse with the foci located on the coordinates of our choosing and the length of the major or minor axis of our choosing.

Note that because of the relationship \( c^{2} = a^{2} - b^{2} \), we can either pick our own a or b, but not both. And since we are picking our own foci, the c has been predetermined because it is half the distance of the foci.

So, let’s get started. The math is actually not that complicated.

The Approach

First, since we are choosing our own foci, we will call their coordinates \( (P_{1}, Q_{1}) \) and \( (P_{2}, Q_{2}) \). The distance between the foci is 2c, due to the properties of an ellipse. Therefore, \( 2c = \sqrt{(P_{1}- P_{2})^{2} + (Q_{1} - Q_{2})^{2}} \). Let’s keep this in mind.

Second, we can choose the length of the major axis or the minor axis but not both, ensuring that a > c. Since c is already determined by the distance between the foci, use the equation \( a^{2} = b^{2} + c^{2} \) to find a or b.

Third, the center of the ellipse is the midpoint of the foci. Therefore, the center will be at \( \left( \frac{P_{1}+P_{2}}{2}, \frac{Q_{1}+Q_{2}}{2} \right) \)

Fourth, the angle of rotation, \( \phi \), is \( \phi = \tan^{-1}\left(\frac{Q_{2}-Q_{1}}{P_{2}-P_{1}} \right) \).

With these four relationships we have determined, our approach is to find the equation of the ellipse in standard position with the above relationships, then rotate the ellipse using the rotation substitutions, and then shift the ellipse to the center we have determined above.

The Rotated Ellipse

Let’s convert the standard equation of the ellipse to a general equation of conics and rotate the ellipse by \( \phi \) first. For now, we will keep the angle as the simple variable instead of its arctangent value. May be it may not be necessary later on?

The general equation is \( b^{2}x^{2} + a^{2}y^{2} - (ab)^{2} = 0 \). To rotate by \( \phi \), we use the following substitutions: \( x = x'\cos\phi + y'\sin\phi \) and \( y = y'\cos\phi - x'\sin\phi \). I do not like using primes, so let’s assume the standard equation is with primes and we are finding the rotated equation.

(i) \( b^{2}x'^{2} + a^{2}y'^{2} - (ab)^{2} = 0 \)

(ii) \( b^{2}(x\cos\phi + y\sin\phi)^{2} + a^{2}(y\cos\phi - x\sin\phi)^{2} - (ab)^{2} = 0 \)

(iii) \( b^{2}(\cos^{2}\phi x^{2} + 2\sin\phi \cos\phi xy + \sin^{2}\phi y^{2}) + \) \( a^{2}(\cos^{2}\phi y^{2} - 2\sin\phi \cos\phi xy + \sin^{2}\phi x^{2}) - (ab)^{2} = 0 \)

(iv) \( (b^{2}\cos^{2}\phi + a^{2}\sin^{2}\phi)x^{2} + (b^{2}\sin^{2}\phi + a^{2}\cos^{2}\phi)y^{2} + \) \( (b^{2}-a^{2})(2\sin\phi\cos\phi)xy - (ab)^{2} = 0 \)

The coefficient of the \( xy \) term is \( b^{2} - a^{2} \) which is equal to \( -c^{2} \). Let’s make that substitution after rearrangement.

(v) \( (b^{2}\cos^{2}\phi + a^{2}\sin^{2}\phi)x^{2} + (b^{2}\sin^{2}\phi + a^{2}\cos^{2}\phi)y^{2} - \) \( (2c^{2}\sin\phi\cos\phi)xy - (ab)^{2} = 0 \)

Equation (v) represents our ellipse that has the same angle of rotation as our desired ellipse except its center is at the origin.

The Trig Substitutions

Remember our angle of rotation is \( \phi = \tan^{-1}\left(\frac{Q_{2}-Q_{1}}{P_{2}-P_{1}} \right) \). We need to determine the sine and cosine of this angle of rotation. By using a right triangle, these values are: \( \cos\phi = \frac{P_{2}-P_{1}}{\sqrt{(P_{2}-P_{1})^{2} + (Q_{2}-Q_{1})^{2}}} \) and \( \sin\phi = \frac{Q_{2}-Q_{1}}{\sqrt{(P_{2}-P_{1})^{2} + (Q_{2}-Q_{1})^{2}}} \). But we already know that \( 2c = \sqrt{(P_{2}- P_{2})^{1} + (Q_{2} - Q_{1})^{2}} \). So the trigonometry values are essentially \( \cos\phi = \frac{P_{2}-P_{1}}{2c} \) and \( \sin\phi = \frac{Q_{2}-Q_{1}}{2c} \). With these substitutions, our equation in (iv) becomes:

(vi) \( \left( \frac{b^{2}(P_{2}-P_{1})^{2}}{4c^{2}} + \frac{a^{2}(Q_{2}-Q_{1})^{2}}{4c^{2}} \right)x^2 + \) \( \left( \frac{b^{2}(Q_{2}-Q_{1})^{2}}{4c^{2}} + \frac{a^{2}(P_{2}-P_{1})^{2}}{4c^{2}} \right)y^2 + \) \( 2c^{2} \left(\frac{P_{2}-P_{1}}{2c}\right) \left(\frac{Q_{2}-Q_{1}}{2c}\right)xy - (ab)^{2} = 0 \)

(vii) \( \left(b^{2}(P_{2}-P_{1})^{2} + a^{2}(Q_{2}-Q_{1})^{2}\right)x^2 + \) \( \left(b^{2}(Q_{2}-Q_{1})^{2} + a^{2}(P_{2}-P_{1})^{2}\right)y^2 + \) \(2c^{2}(P_{2}-P_{1})(Q_{2}-Q_{1})xy - 4(abc)^{2} = 0 \) (Multiply both sides by \(4c^{2}\))

The Final Shift

Last part is to shift the ellipse to the center of the chosen foci.

(viii) \( \left(b^{2}(P_{2}-P_{1})^{2} + a^{2}(Q_{2}-Q_{1})^{2}\right)\left(x - \frac{P_{1}+ P_{2}}{2} \right)^2 + \) \( \left(b^{2}(Q_{2}-Q_{1})^{2} + a^{2}(P_{2}-P_{1})^{2}\right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right)^2 - \) \(2c^{2}(P_{2}-P_{1})(Q_{2}-Q_{1})\left(x - \frac{P_{1}+ P_{2}}{2} \right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right) - 4(abc)^{2} = 0 \)

An ellipse that has foci at \( (P_{1}, Q_{1}) \) and \( (P_{2}, Q_{2}) \) has the equation:

\( \left(b^{2}(P_{2}-P_{1})^{2} + a^{2}(Q_{2}-Q_{1})^{2}\right)\left(x - \frac{P_{1}+ P_{2}}{2} \right)^2 + \) \( \left(b^{2}(Q_{2}-Q_{1})^{2} + a^{2}(P_{2}-P_{1})^{2}\right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right)^2 - \) \(2c^{2}(P_{2}-P_{1})(Q_{2}-Q_{1})\left(x - \frac{P_{1}+ P_{2}}{2} \right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right) \) \( - 4(abc)^{2} = 0 \)

where \( c = \frac{1}{2}\sqrt{(P_{2} - P_{1})^{2} + (Q_{2}-Q_{1})^{2}} \) and \( c^{2} = a^{2} - b^{2} \).

What an elegant equation! And notice that we did not have to deal with the messy trigonometry of the rotation angle!

We could make the substitution of b and c in the final equation but it just makes it more complicated.

I am not sure if we multiply it all out the equation would reduce further, but at least we have everything in place to customize our ellipse.

Observations

When P1 = P2 or Q1 = Q2, we have a standard ellipse. When this is the case, the xy term disappears, which is expected.

For rational location of the foci and a rational major axis length, the coefficients will be rational. However, because we have the relationship \( c^{2} = a^{2} - b^{2} \), either a or b will be irrational. In Example 1, we will choose an integer value for a so that b turns out to be irrational. The only way a, b, and c to be rational is if we use two Pythogrean triples; for example, 3-4-5 and 5-12-13 where 5 is the common number.

Examples

Example 1

Figure 1: Ellipse with Foci at (3, 5) and (-5, 1)

Figure 1 shows an ellipse with foci at (3, 5) and (-5, 1). I let a equal to 6 so the major axis has a length of 12. The center is at (-1, 3), which is the midpoint of the foci. The equation of the ellipse is \( 5x^{2}-4xy + 8y^{2}+22x-52y-55 = 0 \).

The ellipse in red is the same ellipse centered at the origin and in standard orientation. The purple ellipse is rotated to the same angle as our desired ellipse but centred at the origin.

We will derive the equation of this ellipse using our formula.

The center of the ellipse is at \( \left( \frac{3-5}{2}, \frac{5+1}{2} \right) \) = (-1, 3).

The c value is \( c = \frac{1}{2}\sqrt{(-5 - 3)^{2} + (1-5)^{2}} = \frac{1}{2}\sqrt{64+16} = 2\sqrt{5} \). And \( c^{2} = 20 \).

The b value is \( b = \sqrt{a^{2} - c^{2}} = \sqrt{36 - 20} = 4\).

We have all the values we need to plugin.

(i) \( \left(b^{2}(P_{2}-P_{1})^{2} + a^{2}(Q_{2}-Q_{1})^{2}\right)\left(x - \frac{P_{1}+ P_{2}}{2} \right)^2 + \) \( \left(b^{2}(Q_{2}-Q_{1})^{2} + a^{2}(P_{2}-P_{1})^{2}\right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right)^2 - \) \(2c^{2}(P_{2}-P_{1})(Q_{2}-Q_{1})\left(x - \frac{P_{1}+ P_{2}}{2} \right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right) - 4(abc)^{2} = 0 \)

(ii) \( \left(4^{2}(-5-3)^{2} + 6^{2}(1-5)^{2}\right)\left(x - \frac{3 - 5}{2} \right)^2 + \) \( \left(4^{2}(1-5)^{2} + 6^{2}(-5-3)^{2}\right)\left(y - \frac{5 + 1}{2} \right)^2 - \) \(2\cdot (2\sqrt{5})^{2}(-5-3)(1-5)\left(x - \frac{3 - 5}{2} \right)\left(y - \frac{5 + 1}{2} \right) - 4(6\cdot 4 \cdot 2\sqrt{5})^{2} = 0 \)

(iii) \( \left(16(-8)^{2} + 36(-4)^{2}\right)(x + 1)^2 + \) \( \left(16(-4)^{2} + 36(-8)^{2}\right)(y - 3)^2 - \) \((2)(20)(-8)(-4)(x + 1)(y - 3) - (4)(36)(16)(20) = 0 \)

(iv) \( 1600(x + 1)^2 + \) \( 2560(y - 3)^2 - \) \(1280(x + 1)(y - 3) - 46080 = 0 \)

(v) \( 5(x + 1)^2 + 8(y - 3)^2 - 4(x + 1)(y - 3) - 144 = 0 \) (Reducing by the common factor 320)

(vi) \( 5x^{2} + 10x + 5 + 8y^{2} - 48y + 72 -4xy + 12x - 4y + 12 - 144 = 0 \)

(vii) \( 5x^{2} - 4xy + 8y^{2} +22x - 52y -55 = 0 \)

And this is our final equation. In the next example, we will do more of the same with different numbers just because.

Example 2

Let’s place out foci at (-2, 4) and (6, -2). Let the minor axis factor b be 3.

Determine the center of the ellipse: \( \left( \frac{-2 + 6}{2}, \frac{4 - 2}{2} \right) = (2, 1) \).

Determine c: \( \frac{1}{2}\sqrt{(-2-6)^{2} + (4-(-2))^{2}} = \frac{1}{2}\sqrt{100} = 5 \) and \( c^{2} = 25 \).

Determine a: \( a = \sqrt{b^{2}+c^{2}} = \sqrt{3^{2}+5^{2}} = \sqrt{34} \) and \( a^{2} = 34 \).

Since we let b = 3, \( b^{2} = 9 \).

Now, we are ready for the substitutions.

(i) \( \left(b^{2}(P_{2}-P_{1})^{2} + a^{2}(Q_{2}-Q_{1})^{2}\right)\left(x - \frac{P_{1}+ P_{2}}{2} \right)^2 + \) \( \left(b^{2}(Q_{2}-Q_{1})^{2} + a^{2}(P_{2}-P_{1})^{2}\right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right)^2 - \) \(2c^{2}(P_{2}-P_{1})(Q_{2}-Q_{1})\left(x - \frac{P_{1}+ P_{2}}{2} \right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right) - 4(abc)^{2} = 0 \)

(ii) \( \left((9)(6-(-2))^{2} + (34)(-2-4)^{2}\right)(x - 2 )^2 + \) \( \left((9)(-2-4)^{2} + (34)(6-(-2))^{2}\right)(y - 1)^2 - \) \(2(25)(6-(-2))(-2-4)(x - 2)(y - 1) - 4(34)(9)(25) = 0 \)

(iii) \( ((9)(64) + (34)(36))(x - 2 )^2 + \) \( ((9)(36) + (34)(64))(y - 1)^2 - \) \(2(25)(8)(-6)(x - 2)(y - 1) - 30600 = 0 \)

(iv) \( 1800(x - 2 )^2 + \) \( 2500(y - 1)^2 + \) \( 2400(x - 2)(y - 1) - 30600 = 0 \)  (Let’s reduce this before expanding.)

(v) \( 18(x - 2 )^2 + 25(y - 1)^2 + 24(x - 2)(y - 1) - 306 = 0 \)

(vi) \( 18x^{2} - 72x + 72 + 25y^2 - 50y + 25 + 24xy - 24x - 48y + 48 - 306 = 0 \)

(vii) \( 18x^{2} + 24xy + 25y^{2} - 96x - 98y - 161 = 0 \)

Equation (vii) is our final equation graphed below.

Figure 2: Ellipse with Foci at (-2, 4) and (6, -2)

The graph above shows our predetermined foci at (-2, 4) and (6, -2), a b value of 3, which means half the minor axis lenght is 3, and the half the major axis length of \( \sqrt{34} \approx 5.831 \).

Example 3

If we want a, b and c to be rational, then both a and c have to be the hypotenuse in the Pythagorean triple. An example of such a pair of triples is 3-4-5 and 5-12-13. Let a = 13 since a has to be greater than c. Therefore, c will be 5 and b will be 12. Since a and b are pretty close, the ellipse will look close to a circle. We can place the foci anywhere. Let’s just say they are at (6, 12) and (14, 6). Therefore, the center is at (10, 9). We also have the following for number crunching: \( a^{2} = 169 \), \( b^{2} = 144 \), and \( c^{2} = 25 \). Here we go:

(i) \( \left(b^{2}(P_{2}-P_{1})^{2} + a^{2}(Q_{2}-Q_{1})^{2}\right)\left(x - \frac{P_{1}+ P_{2}}{2} \right)^2 + \) \( \left(b^{2}(Q_{2}-Q_{1})^{2} + a^{2}(P_{2}-P_{1})^{2}\right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right)^2 - \) \(2c^{2}(P_{2}-P_{1})(Q_{2}-Q_{1})\left(x - \frac{P_{1}+ P_{2}}{2} \right)\left(y - \frac{Q_{1}+ Q_{2}}{2} \right) - 4(abc)^{2} = 0 \)

(ii) \( \left((144)(8)^{2} + (169)(-6)^{2}\right)(x - 10)^2 + \) \( \left((144)(-6)^{2} + (169)(8)^{2}\right)(y - 9)^2 - \) \(2(25)(8)(-6)(x - 10)(y - 9) - 4(169)(144)(25) = 0 \)

(iii) \( 15300(x - 10)^2 + 16000(y - 9)^2 + 2400(x - 10)(y - 9) - 2433600 = 0 \)

(iv) \( 153(x - 10)^2 + 160(y - 9)^2 + 24(x - 10)(y - 9) - 24336 = 0 \) (Divide by 100.)

(v) \( 153x^{2} + 24xy + 160y^2 - 3276x - 3120y + 6084 = 0 \)

Figure 3: A ‘3-4-5/5-12-13’ Ellipse

The graph shows the ellipse that looks not quite like a circle but somewhat close. The values of a as the major axis, b as the minor axis, and c as the distance between the center and the foci have been shown.

When a, b and c are rational, the vertices are at rational locations.

Example 4

Can you think of another pair of Pythagorean triples which will give all rational numbers?

The triple does not have to be the smallest scale. For example, 3-4-5 can be scaled to 9-12-15. And 8-15-17 is also a triple. Hence, we can let c = 15. Then a would be 17. To make the calculations simple, let’s just make the center of the ellipse (0, 0). Therefore, the foci are at (-9, 12) and (9, -12).

I will skip the calculations since it is just simple number crunching. The equation of this ellipse is \( 208x^{2} + 216xy + 145y^{2} - 18496 = 0 \).

Figure 4: A ‘9-12-15/8-15-17’ Ellipse

You can see the a, b, and c denoted in the graph above. Again, when a, b and c are rational, the vertices are at rational locations.

Can you spot the right triangle with these measurements?

There are four 8-15-17 triangles, and one of them is triangle F1CM1. Segments F1C = c, CM1 = b and F1M1 = a. We also used a 9-12-15 triangle, which is not so apparent, but remember that c = 15. So that triangle is the one where F1C is the hypotenuse and represents the slope of that segment.

Conclusion

I finally succeeded in finding the equation of an ellipse that has our own chose foci and length of major or minor axis. The parabola already has such an equation called the Focus-Directrix Equation of a Parabola, where we can choose the location the parabola’s focus and the equation of the directrix.

Lastly, just like we have an equation for an ellipse, we can also derive an equation of a hyperbola with our own foci and length of major or minor axis. I have not derived this equation yet but it is likely to be very similar except a few sign changes.