0
$\begingroup$

I’m using mathematica 9.0 and want to draw an Ellipse in 3D. I notice that there is “Sphere”, but not ellipse... what is the easy way do draw one?

Thanks

$\endgroup$
  • 3
    $\begingroup$ Look for Ellipsoid in the documentation... $\endgroup$ – Fraccalo Jul 10 '18 at 14:42
  • $\begingroup$ as in Graphics3D[Ellipsoid[{0, 0, 0}, {4, 3, 2}]]? or Graphics3D[ Table[{Hue[RandomReal[]], Ellipsoid[RandomReal[50, {3}], RandomReal[{1, 5}, 3]]}, {100}]] $\endgroup$ – chris Jul 10 '18 at 14:43
  • $\begingroup$ Welcome! To make the most of Mma.SE start by taking the tour now. It will help us to help you if you write an excellent question. Edit if improvable, show due diligence, give brief context, include minimal working example of code and data in formatted form. As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. $\endgroup$ – rhermans Jul 10 '18 at 15:45
  • $\begingroup$ @rhermans He wrote ellipse, not ellipsoid. I do not think we should try to second guess what people mean. It is entirely reasonable to want to draw an ellipse in 3D (after all it's a conic section, it's often drawn in 3D to illustrate that). (Also, the edit made my answer look pretty stupid and prompted people to point that out.) $\endgroup$ – Szabolcs Jul 10 '18 at 16:11
  • 1
    $\begingroup$ @rhermans I did wonder if OP meant ellipse or ellipsoid because he mentions Sphere. It is entirely possible that he meant ellipsoid ... but he wrote ellipse (twice). He should clarify. $\endgroup$ – Szabolcs Jul 10 '18 at 16:29
6
$\begingroup$

When I wrote this answer the question clearly asked for an ellipse.


Look up ParametricPlot3D and use the equation of an ellipse.

ParametricPlot3D[{2 Cos[u], Sin[u], 0}, {u, 0, 2 Pi}]

enter image description here

$\endgroup$
  • $\begingroup$ Ellipse =!= Ellipsoid... $\endgroup$ – Jens Jul 10 '18 at 16:08
  • 5
    $\begingroup$ @Jens Of course it's not the same. The original poster wrote ellipse (not once but twice). Then someone else edited the post and changed it to ellipsoid (only after I wrote the answer). The original poster also mentioned Sphere[], so he might have meant ellipsoid, but I am not going to play that kind of guessing game. If he asked for an ellipse, he will get an ellipse from me. $\endgroup$ – Szabolcs Jul 10 '18 at 16:10
  • $\begingroup$ Sorry - didn't know this, but have been annoyed by the same issue several times before. In this case it would be a dupe of mathematica.stackexchange.com/q/6526/245. $\endgroup$ – Jens Jul 10 '18 at 16:16
  • $\begingroup$ Sorry, it was my fault. $\endgroup$ – rhermans Jul 10 '18 at 16:28
0
$\begingroup$
ParametricPlot3D[{3 Cos[u] Cos[v], 2 Cos[u] Sin[v], 1 Sin[u]}  (*-(\[Pi]/2)<u<\[Pi]/2,0<v<2\[Pi] *), {u, -Pi/2,Pi/2}, {v, 0, 2 Pi}]

enter image description here

plots an ellipsoid!

$\endgroup$

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