I'm attempting to draw a pie-chart programmatically, using an ellipse instead of a circle, but I'm having trouble calculating the correct angles for the slices. If it were a circle, I could use the percentage that the slice represents multiplied by $360$ degrees to obtain the accurate angles created by the slices.
Assume the following is known about an ellipse centered at the origin with a slice $s$:
- radii $a$ and $b$
- the percentage of the area that slice $s$ represents
- angle $\theta_1$, which is the angle from $0$ degrees to the beginning of the first edge of the slice (moving counter-clockwise).
How do you calculate the angle that slice $s$ creates from the center of the ellipse?
Note: Essentially, I would need to find either $\theta_2$ or the angle of the yellow-shaded slice depicted in this question: