Step 1 - The parametric equation of an ellipse
The parametric formula of an ellipse centered at $(0, 0)$, with the major axis parallel to the $x$-axis and minor axis parallel to the $y$-axis:
$$
x(\alpha) = R_x \cos(\alpha) \\
y(\alpha) = R_y \sin(\alpha)
$$
where:
- $R_x$ is the major radius
- $R_y$ is the minor radius.
Step 2 - Rotate the equation
The rotation is given by the mapping:
$$
x(\theta) = \cos(\theta) x - \sin(\theta) y\\
y(\theta) = \sin(\theta) x + \cos(\theta) y
$$
where:
- $\theta$ is the rotation angle.
Once we put the ellipse equation in the rotation equation we get:
$$
x(\alpha) = R_x \cos(\alpha) \cos(\theta) - R_y \sin(\alpha) \sin(\theta) \\
y(\alpha) = R_x \cos(\alpha) \sin(\theta) + R_y \sin(\alpha) \cos(\theta)
$$
Step 3 - Shift the equation from the center at $(0, 0)$
To shift any equation from the center we add $C_x$ to the $x$ equation and $C_y$ to the $y$ equation.
Therefore the equation of a rotated ellipse is:
$$
x(\alpha) = R_x \cos(\alpha) \cos(\theta) - R_y \sin(\alpha) \sin(\theta) + C_x \\
y(\alpha) = R_x \cos(\alpha) \sin(\theta) + R_y \sin(\alpha) \cos(\theta) + C_y
$$
where:
- $C_x$ is the $x$-coordinate of the center
- $C_y$ is the $y$-coordinate of the center
- $R_x$ is the major radius
- $R_y$ is the minor radius
- $\alpha$ is the parameter, which ranges from $0$ to $2 \pi$ radians
- $\theta$ is the ellipse rotation angle.