Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

share|improve this question
3  
In what sense were your results not satisfying? –  Sjoerd C. de Vries Dec 6 '12 at 6:28
    
@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). –  BlBl Dec 7 '12 at 5:20
    
@Sjoerd C. de Vries –  BlBl Dec 7 '12 at 5:24
add comment

3 Answers

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]
share|improve this answer
    
Yum yum yum yum... –  Yves Klett Dec 6 '12 at 7:52
    
Thanks for that VLC. I'll fiddle with the code to see if I can just get away with this. –  BlBl Dec 7 '12 at 5:25
add comment

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

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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