Recently, I discovered a long-standing bug in the rendering of Disk
and Circle
primitives after applying GeometricTransformation
with a matrix as the second argument. This bug affects rendering of general ellipsoids of the form Ellipsoid[p, Σ]
, but does not affect axes-oriented ellipsoids of the form Ellipsoid[p, {r1, …}]
, because the latter are directly translated into the corresponding Disk
objects with the same syntax and arguments. Applying Rotate
(or GeometricTransformation
with RotationTransform
as the second argument) to the axis-oriented ellipsoids is a workaround for the bug. But for this we should be able to obtain from the matrix Σ
the corresponding semiaxes lengths {r1, …}
and the rotation angle Θ
(for the 3D case, we also need the rotation axis w
).
There is an elegant and efficient built-in way to perform the opposite task. For the 2D case, we have:
TransformedRegion[Ellipsoid[{x, y}, {r1, r2}], RotationTransform[Θ, {x, y}]]
Ellipsoid[{x, y}, {{r1^2 Cos[Θ]^2 + r2^2 Sin[Θ]^2, r1^2 Cos[Θ] Sin[Θ] - r2^2 Cos[Θ] Sin[Θ]}, {r1^2 Cos[Θ] Sin[Θ]] - r2^2 Cos[Θ] Sin[Θ], r2^2 Cos[Θ]^2 + r1^2 Sin[Θ]^2}}]
But I failed to find a way to transform Ellipsoid[p, Σ]
into Rotate[Ellipsoid[p, {r1, …}], Θ, p]
(or another suitable syntax form of Rotate
or RotationTransform
). Is it possible to do this in an elegant and efficient way (2D and 3D cases)?