2
$\begingroup$

I have a sphere of radius 5 and a cone (i.e. z=√(x^2+y^2)) inside of it. I can show them separately, but I'd like to show them together. I've tried a few tricks with opacity, implicit specifications, show, and range changes, but nothing is giving me a satisfying result.

Really I'd like to show the "ice cream cone" shape by itself, but I'd settle for a cone under a hemisphere right now. Anyone know how I can get this done?

Thanks in advance

$\endgroup$
  • 3
    $\begingroup$ In what sense were your results not satisfying? $\endgroup$ – Sjoerd C. de Vries Dec 6 '12 at 6:28
  • $\begingroup$ @NasserM.Abbasi it was nothing special really. It was basically just Plot3D[x^2+y^2+z^2=25, {x,-5,5},{y,-5,5}] for the sphere and Plot3D[sqrt(x^2+y^2), {x,-5/sqrt(2),5/sqrt(2)},{y,-5/sqrt(2),5/sqrt(2)} for the cone. When I'd try to put them together with the Show command I'd get a squished hemisphere and a cone higher than the sphere even if I'd specified the z component the way that I'd expect it to come out well (i.e. above the xy-plane and stopping at 5). $\endgroup$ – BlBl Dec 7 '12 at 5:20
  • $\begingroup$ @Sjoerd C. de Vries $\endgroup$ – BlBl Dec 7 '12 at 5:24
10
$\begingroup$

Enjoy it!

enter image description here

Graphics3D[{
  {Lighter[Brown], Cone[{{0, 0, 0}, {0, 0, -1}}, .25]},
  {Yellow, Sphere[{0, 0, .1}, .25]},
  {Pink, Sphere[{.15, 0, .2}, .26]},
  {Orange, Sphere[{-.1, 0, .25}, .25]}
  }, Boxed -> False]
$\endgroup$
  • $\begingroup$ Yum yum yum yum... $\endgroup$ – Yves Klett Dec 6 '12 at 7:52
  • $\begingroup$ Thanks for that VLC. I'll fiddle with the code to see if I can just get away with this. $\endgroup$ – BlBl Dec 7 '12 at 5:25
4
$\begingroup$

Something related from a Christmas notebook I wrote last year:

Candle[color_, Pos_] :=
 {color, Cylinder[{Pos, Pos + {0, 0, 0.1}}, 0.013],
  Black, Thick, Line[{Pos + {0, 0, 0.1}, Pos + {0, 0, 0.12}}],
  Yellow, EdgeForm[None], Sphere[Pos + {0, 0, 0.12}, 0.013],
  Cone[{Pos + {0, 0, 0.121}, Pos + {0, 0, 0.16}}, 0.0127]}

Graphics3D@Candle[Red, {0, 0, 0}]

Mma candle

$\endgroup$
3
$\begingroup$

Vanilla, Strawberry and Pistachio, after VLC ...

Graphics3D[{{Lighter[Brown], 
   Cone[{{0, 0, 0}, {0, 0, -1}}, .25]}, {LightGreen, 
   Sphere[{0, 0, .1}, .25]}, {Pink, 
   Sphere[{.15, 0, .23}, .26]}, {LightGray, 
   Sphere[{-.1, 0, .25}, .23]}}, Boxed -> False, 
 Lighting -> "Neutral"]

Mathematica graphics

$\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.