I need a way to plot a generic ellipsoid given the following implicit equation. Can someone help me?
$$\frac{x^2}{a^2}+\frac{y^2}{b^2}+\frac{z^2}{c^2}=1$$
See my general comment. Note Ellipsoid
is a built-in function.
Here are some ways you could do this:
e[a_, b_, c_] :=
ContourPlot3D[
x^2/a^2 + y^2/b^2 + z^2/c^2, {x, -1.1 a, 1.1 a}, {y, -1.1 b,
1.1 b}, {z, -1.1 c, 1.1 c}, Contours -> {1},
BoxRatios -> Automatic, Mesh -> False, Boxed -> False,
Background -> Black, Axes -> False]
p[a_, b_, c_] :=
ParametricPlot3D[{a Sin[u] Cos[v], b Sin[u] Sin[v], c Cos[u]}, {u, 0,
Pi}, {v, 0, 2 Pi}, Mesh -> False, Background -> Black,
Boxed -> False, Axes -> False]
s[a_, b_, c_] :=
Graphics3D[
GeometricTransformation[Sphere[], ScalingTransform[{a, b, c}]],
Background -> Black, Boxed -> False, Axes -> False]
el[a_, b_, c_] :=
Graphics3D[Ellipsoid[{0, 0, 0}, {a, b, c}], Background -> Black,
Boxed -> False, Axes -> False]
Showing:
Manipulate[
Grid[{{e[a, b, c], p[a, b, c]}, {s[a, b, c], el[a, b, c]}}], {a, 1,
5}, {b, 1, 5}, {c, 1, 5}]
There is a wonderful page on Wolfram MathWorld: Ellipsoid
where you can also download a NB
.
There are two good friends; ContourPlot3D
and RegionPlot3D
;
a = 3; b = 2; c = 1;
ContourPlot3D[x^2/a^2 + y^2/b^2 + z^2/c^2 == 1, {x, -3, 3}, {y, -3, 3}, {z, -3, 3}]
With[{a = 3, b = 2, c = 1},
RegionPlot3D[
x^2/a^2 + y^2/b^2 + z^2/c^2 < 1, {x, -3, 3}, {y, -2, 2}, {z, -1, 1},
BoxRatios -> Automatic]
]
Ellipsoid
;-)
$\endgroup$
Aug 17, 2015 at 13:57
ContourPlot3D[]
. $\endgroup$a
,b
,c
? Please clarify. $\endgroup$