I have given 4 vectors $m, a, b, c \in \mathbb{R}^3$ (the center of an ellipsoid and its 3 main axes). I am looking for an clever way to compute a mesh of points on the ellipse, which is not to computational heavy (I have thousands to plot in a single figure).
Wikipedia says I should just use the parameterform $$E(\phi, \theta) = m + a~\cos (\theta) \cos (\phi) + b~\cos (\theta) \sin (\phi) +c ~ \sin (\theta),~~~ \phi \in (0,2\pi),~ \theta\in (-\pi/2, \pi /2)$$ but it allways plots the wrong ellisoid.
I also read that there is an easier way by using the matrix in the alternative definition of an ellipsoid:
$$ (x - m)^T A (x-m) = 1 $$
where with $v_1, v_2, v_3$ parallel to $a,b,c$ and $\lambda_1, \lambda_2, \lambda_3$ equal to $1/||a||^2, 1/||b||^2, 1/||c||^2$.
I know there is the python package nestle which can draw ellipsoids using this matrix, but I won't find any documentaion on how it dows that (I would like to do it without the package if possible).
Thank you for any help :)
I found my answer by looking through the original code of the package.
You'll find the ellipsoid function and the code:
Here they also explain how they calculate ellipsoid.axes
While I do not fully understand the math behind this, I now can use a simpler version of this to make my code more efficient.
So how do I plot the ellipsoid? My solution is something like this:
(might not work 100% since I had to change some things)
Have fun :)