Items tagged with implicitplot3d implicitplot3d Tagged Items Feed

Someone asked on math.stackexchange.com about plotting x*y*z=1 and, while it's easy enough to handle it with implicitplot3d it raised the question of how to get nice constained axes in the case that the x- or y-range is much less than the z-range.

Here's what WolframAlpha gives. (Mathematica handles it straight an an plot of the explict z=1/(x*y), which is interesting although I'm more interested here in axes scaling than in discontinuous 3D plots)

Here is the result of a call to implicitplot3d with default scaling=unconstrained. The axes appear like in a cube, each of equal "length".

 

Here is the same plot, with scaling=constrained. This is not pretty, because the x- and y-range are much smalled than the z-range.

 

How can we control the axes scaling? Resizing the inlined plot window with the mouse just affects the window. The plot itself remains  rendered in a cube. Using right-click menus to rescale just makes all axes grow or shrink together.

One unattractive approach it to force a small z-view on a plot of a much larger z-range, for a piecewise or procedure that is undefined outisde a specific range.

plots:-implicitplot3d(proc(x,y,z)
                        if abs(z)>200 then undefined;
                        else x*y*z-1; end if;
                      end proc,
                      -1..1, -1..1, -200..200, view=[-1..1,-1..1,-400..400],
                      style=surfacecontour, grid=[30,30,30]);

Another approach is to scale the x and y variables, scale their ranges, and then force scaled tickmark values. Here is a rough procedure to automate such a thing. The basic idea is for it to accept the same kinds of arguments are implicitplot3d does, with two extra options for scaling the axis x-relative-to-z, and axis y-relative-to-z.

implplot3d:=proc( expr,
                  rng1::name=range(numeric),
                  rng2::name=range(numeric),
                  rng3::name=range(numeric),
                  {scalex::numeric:=1, scaley::numeric:=1} )
   local d1, d2, dz, n1, n2, r1, r2, rngs, scx, scy;
   uses plotfn=plots:-implicitplot3d;
   (n1,n2) := lhs(rng1), lhs(rng2);
   dz := rhs(rhs(rng3))-lhs(rhs(rng3));
   (scx,scy) := scalex*dz/(rhs(rhs(rng1))-lhs(rhs(rng1))),
                scaley*dz/(rhs(rhs(rng2))-lhs(rhs(rng2)));
   (r1,r2) := map(`*`,rhs(rng1),scx), map(`*`,rhs(rng2),scy);
   (d1,d2) := rhs(r1)-lhs(r1), rhs(r1)-lhs(r1);
   plotfn( subs([n1=n1/scx, n2=n2/scy], expr),
           n1=r1, n2=r2, rng3, _rest[],
           ':-axis[1]'=[':-tickmarks'=[seq(i=evalf[3](i/scx),i=r1,d1/4)]],
           ':-axis[2]'=[':-tickmarks'=[seq(i=evalf[3](i/scy),i=r2,d2/4)]],
           ':-scaling'=':-constrained');
end proc:

The above could be better. It could also detect user-supplied custom x- or y-tickmarks and then scale those instead of forming new ones.

Here is an example of using it,

implplot3d( x*y*z=1, x=-1..1, y=-1..1, z=-200..200, grid=[30,30,30],
            style=surfacecontour, shading=xy, orientation=[-60,60,0],
            scalex=1.618, scaley=1.618 );

Here is another example

implplot3d( x*y*z=1, x=-5..13, y=-11..5, z=-200..200, grid=[30,30,30],
            style=surfacecontour, orientation=[-50,55,0],
            scaley=0.5 );

Ideally I would like to see the GUI handle all this, with say (two or three) additional (scalar) axis scaling properties in a PLOT3D structure. Barring that, one might ask whether a post-processing routine could use plots:-transform (or friend) and also force the tickmarks. For that I believe that picking off the effective x-, y-, and z-ranges is needed. That's not too hard for the result of a single call to the plot3d command. Where it could get difficult is in handling the result of plots:-display when fed a mix of several spacecurves, 3D implicit plots, and surfaces.

Have I overlooked something much easier?

acer

I would like to plot this :

yz(x+y+2z)^3-8=0 such as x^2+x(y+2z)-1<0 and y^2+y(x+2z)-3<0

The difficulty is that bounds depend on other variables. I was trying to use Maple implicitplot3d function, but I don't see a way.

Is it possible to use Maple for such plot ? If so, how ?

 

Thank you for your answer

Hi all,

I'm trying to plot the regions of a cube that are defined by an inequality. At the moment I am able to plot only the surface defined by the corresponding equality. 

That's the code: 

with(plots)

implicitplot3d(x^2*y = z, z = 0 .. 1, y = 0 .. 1, x = 0 .. 1);

Now I would like to plot the two regions defined by the corresponding inequality. 

Have you got any idea on how to do this?

Bests

Manuele

Several years ago, I used to plot, in Maple 7 I think, 3D scalar functions by using procedures to create a 3D mesh and populate the data points before I could use plot3d.

I wonder if there is a more convenient (least coding) way to do it today? Consider for example f(x,y,z) = x^2 + y^2+z^2

A way to visualize a number of concentric isosurfaces of f is to loop with (is there a tag to write this in code block?): 

 

for i to 10 do iso[i] := implicitplot3d( f = i, x = -10 .. 10, y = -10 .. 10, z = -10 .. 10) end do

display(seq(iso[j], j = 1 .. 10))

 

Of course, visualizing the output is another issue.  I wish for an app to explore 3D data like Paraview. It does not have to be as sophisticated, but to display standard elements like isosurfaces and arbitrary cutting plane views would suffice.

If you know a package/app/procedure in Maple of this nature, please share it here. Thank you

 

How do I plot the imaginary or real part of a complex valued function

e.g.

E:=y^2+x^2=1

I tried:

E1:=eval(E,{y=y1+I*y2,x=x1+I*x2})

implicitplot3d(E1,x1=-3..3,x2=-3..3,y1=-3..3)

but which does not work

Hi all,

I have been trying for some time create an animation of a 3d plot I created rotating about the z-axis in Maple 15. I tried using the usual

animate(plot3d,f(x,y),orientation=[A,10],A=0..5)

but not only does that produce an error when I try to do the same thing with an implicitplot3d function, it also doesn't work when I try to animate multiple plots in the same graph, whether implicit functions or regular plot3d ones. I am creating a model...

An implicitplot3d of an f(x,y,z)=0 results in an ISOSURFACE structure containing the samples of a function taken over a regular grid in 3-D space and is rendered as a 3-D surface approximating the zero surface of the function.
When I select the points with values of f(x,y,z) "close" to zero, I only get a few points on the surface:

restart;
q := plots:-implicitplot3d( x^2+y^3+z^4=1 ,x=-1..1,y=-1..1,z=-1..1,
style=wireframe, color=black ):
pdata := plottools:-getdata(q); # doesn't work...

how to graph this two paraboloids into one graph in Maple? z=x^2+y^2 and z=2-x^2-y^2  I try to use Display, Display3d commend, and it doesn't work.

>with(plots)

>f:=(x,y,z)->z=x^2+y^2;

>implicitplot3d(f(x,y,z),x=-5..5,y=-5..5,z=-5..5);

>f:=(x,y,z)->z=2-x^2-y^2;

>impliticitplot3d(f(x,y,z),x=-5..5,y=-5..5,z=-5..5);

 

and if I want to combine the two graph into one, what should I do next?

I'm having an issue with the implicitplot3d command in Maple 16.  The sequence of commands I've listed below works just fine in Maple 15, but in Maple 16 I'm getting a problem.  Sometimes no graph will display;  other times, Maple may initially graph the surface correctly, but as soon as I rotate the graph, the surface disappears.  Furthermore, the following strange things happen:

 

1) Re-executing the command after rotating does not redraw the image ...

Page 1 of 1