1
$\begingroup$

I an trying to mark a point with Ball[] on a Plot3D Surface.

Block[{soln},
 soln = Maximize[{x y^2 + y x^2, x^2 + y^2 <= 2}, {x, y}];
 Show[{Plot3D[{x y^2 + y x^2, x^2 + y^2}, {x, -10, 10}, {y, -10, 10}],
    Graphics3D@Ball[Append[Values@soln[[2]], soln[[1]]], 5]}]
 ]

What I see is this. I don't see the Ball in 3D, rather it looks like a 2d projection.

$\endgroup$
  • 3
    $\begingroup$ Take a look at a vertical range in comparison to x/y. Scale[Ball[..., 1], {1, 1, 30}] $\endgroup$ – Kuba Jan 29 '18 at 13:39
  • $\begingroup$ Thanks That Worked $\endgroup$ – Neel Basu Jan 29 '18 at 13:50
2
$\begingroup$

The Ball has a radius of 5 which relative to the scale of the z-axis is flat. Instead of Ball use Ellipsoid and set the z-radius to give you the desired appearance. Use Manipulate to see the effect of varying the z-radius.

Manipulate[
 Block[{soln},
  soln = Maximize[{x y^2 + y x^2, x^2 + y^2 <= 2}, {x, y}];
  Show[{
    Plot3D[{x y^2 + y x^2, x^2 + y^2},
     {x, -10, 10}, {y, -10, 10},
     ClippingStyle -> None],
    Graphics3D@
     Ellipsoid[
      Append[Values@soln[[2]], soln[[1]]],
      {5, 5, zr}]}]],
 {{zr, 100}, 25, 200, 25, Appearance -> "Labeled"}]

enter image description here

$\endgroup$
1
$\begingroup$

The z axis is in a ratio of 20/600 to the x and y axes. So you need to use an ellipsoid with semi-axes that reflect the ratio within an isometric plotting box (i.e, a cube). Like so.

Block[{soln},
  soln = Maximize[{x y^2 + y x^2, x^2 + y^2 <= 2}, {x, y}];
  Show[
    Plot3D[{x y^2 + y x^2, x^2 + y^2}, {x, -10, 10}, {y, -10, 10},
      PlotStyle -> Opacity[.4]],
    Graphics3D @ Ellipsoid[Append[Values @ soln[[2]], soln[[1]]], 5 {1, 1, 600/20}],
    BoxRatios -> {1, 1, 1},
    ImageSize -> Medium]]

plot

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