How can I plot a sector of an ellipse using the central angle and not the Eccentric Anomaly?

It would appear that the Disk function, when asked to produce the sector of an ellipse between two angles treats those angles as Eccentric Anomalies (i.e. arguments to a parametric plot) rather than true central angles (i.e. arguments to a polar plot). The first part of my question asks whether this observation is correct?

Given that I want to construct a sector using the true central angles, I know that I can make use of the polar equation (r=(a*b)/Sqrt[(b Cos[θ])^2+(a Sin[θ])^2];), but this does not provide me Disk’s ability to color the resultant sector. So, the second part of my question is, does Mathematica provide me a function for performing this filling operation?

I am aware of the Filling option to Plot. If it is, in fact, the preferred approach, can anyone provide an example of its use for doing elliptical sectors?




1 Answer


I think these functions do what you want. First the length from the centre of the ellipse to a point on its perimeter.

EllipsePolarRadius[t_, a_, b_] := a*b/Sqrt[(a Sin[t])^2 + (b Cos[t])^2]

Next a conversion from eccentric anomaly to central angle that works when input to Disk.

AngleConversionForDisk[t_, a_, b_] :=
0 <= t < Pi/2, ArcTan[a*Tan[t]/b], t == Pi/2, Pi/2, Pi/2 < t < 3 Pi/2, ArcTan[a*Tan[t]/b] + Pi, t == 3 Pi/2, 3 Pi/2, 3 Pi/2 < t <= 2 Pi, ArcTan[a*Tan[t]/b] + 2 Pi] And a Manipulate to illustrate the relationships. Manipulate[ Module[{a = 2, b = 4, u}, u = AngleConversionForDisk[t, a, b]; Graphics[{Thick, Circle[{0, b}, {a, b}],(* ellipse *) Cyan, Disk[{0, b}, {a, b}, {0, u}], (* ellipse sector *) (* t parameterization *) Black, Line[{{0, b}, {a Cos[t], b Sin[t]} + {0, b}}], (* u parameterization *) Red, Line[{{0, b}, EllipsePolarRadius[t, a, b]*{Cos[t], Sin[t]} + {0, b}}] }, Frame -> True, GridLines -> {Range[-a, a], Range[0, 2 b]},
PlotLabel -> “Central Angle: ” <> ToString[N[t]/Degree] <> ” degrees”]],
{{t, 0.2, “Central Angle”}, 0., 2.*Pi, Appearance -> “Labeled”}]



AngleConversionForDisk[] looks like it can be expressed better with two-argument arctangent. See this article by Glassner as well.
– J. M.♦
Oct 8 ’15 at 3:12



This is exactly what I need. BTW, I am familiar with using the expansion factor a/b to transform a y coordinate from an ellipse to the circumscribed circle. But I am unfamiliar with its use in the context of ArcTan[a*Tan[t]/b]. Can you explain a bit how this works, or give me a pointer to a resource? Thanks.
– Spencer Rugaber
Oct 12 ’15 at 16:51



Thanks! The connection between the central angle and the eccentric anomaly is discussed, for example, here.
– KennyColnago
Oct 14 ’15 at 15:09