Conic Sections – Parametric Equation for Rotated Ellipse

conic sections

What's the parametric equation for the general form of an ellipse rotated by any amount?

Preferably, as a computer scientist, how can this equation be derived from the three variables: coordinate of the center/two foci and eccentricity of an ellipse?

I need to generate completely random eclipses within certain bounds. The variables I described above are most convenient. This is for a personal project of mine and I can't find anybody who can help me.

Best Answer

Let's start with the parametric equation for a circle centered at the origin with radius 1:

x(t) = cos 2πt

y(t) = sin 2πt

To turn this into an ellipse, we multiply it by a scaling matrix of the form

| a  0 |
| 0  b |

which gives

| a  0 |   | x(t) |   | a x(t) |
| 0  b | * | y(t) | = | b y(t) |

To rotate this by θ degrees, multiply it by the rotation matrix

| cos θ   -sin θ |   | a x(t) |    |a x(t) cos θ - b y(t) sin θ|
| sin θ    cos θ | * | b y(t) | =  |a x(t) sin θ + b y(t) cos θ|

So the new parametric equation would be

x'(t) = a x(t) cos θ - b y(t) sin θ = a cos 2πt cos θ - b sin 2πt sin θ

y'(t) = a x(t) sin θ + b y(t) sin θ = a cos 2πt sin θ + b sin 2πt cos θ

You can then translate this to have center (x0, y0) by adding these components to the parametric components.

Hope this helps!

Related Question