3
$\begingroup$

I'm having trouble to implement a plot in Mathematica. I want to plot two things at the same time.

The first thing is a ellipsoid given by $\displaystyle f(x,y,z)=\frac{x^2}{a^2}+\frac{y^2}{b^2}+\frac{z^2}{c^2}=1$.

The code I wrote for this is:

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}]

The second thing I want to plot is the cuboid with the maximized volume: $\displaystyle f\left(\frac{a}{\sqrt{3}},\frac{b}{\sqrt{3}},\frac{c}{\sqrt{3}}\right)= \frac{8}{3\sqrt{3}}xyz$.

The problem is that I want the cuboid to be in the ellipsoid and I can't write anything that works.

$\endgroup$
6
$\begingroup$
Graphics3D[{
  {Yellow, Opacity[0.3], Ellipsoid[{0, 0, 0}, {3, 2, 1}]},
  {Red, Opacity[.6], Cuboid[s = {-3, -2, -1}/Sqrt[3], -s}
  }]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.