Asymptote using graph3.asy – fig0020

Category: Asymptote,Examples 3D,graph3.asyPh. Ivaldi @ 4 h 11 min

Figure 0002
(Compiled with Asymptote version 2.14svn-r5318)
    
import graph3;

size(8cm,0);
currentprojection=orthographic(1,1,1);

limits((0,-2,0),(2,2,2));

xaxis3("$x$", OutTicks());
yaxis3("$y$", OutTicks());
zaxis3("$z$", OutTicks());

Étiquettes : ,


Asymptote using graph3.asy – fig0030

Category: Asymptote,Examples 3D,graph3.asyPh. Ivaldi @ 5 h 11 min

Figure 0003
(Compiled with Asymptote version 2.14svn-r5318)
    
import graph3;

size(8cm,0,IgnoreAspect);
currentprojection=orthographic(1,1,1);

limits((0,-2,0), (2,2,2));

axes3("$x$","$y$","$z$",Arrow3);

Étiquettes : ,


Asymptote using graph3.asy – fig0040

Category: Asymptote,Examples 3D,graph3.asyPh. Ivaldi @ 6 h 11 min

Figure 0004
(Compiled with Asymptote version 2.14svn-r5318)
    
import graph3;

size(8cm,0);
currentprojection=orthographic(1,1,1);

defaultpen(overwrite(SuppressQuiet));

limits((0,-2,0),(2,2,2));

xaxis3("$x$", InTicks(XY()*Label));
yaxis3("$y$", InTicks(XY()*Label));
zaxis3("$z$", OutTicks, p=red, arrow=Arrow3);

Étiquettes : ,


Asymptote using graph3.asy – fig0050

Category: Asymptote,Examples 3D,graph3.asyPh. Ivaldi @ 7 h 11 min

Figure 0005
(Compiled with Asymptote version 2.14svn-r5318)
    
import graph3;

size(6cm,0);
currentprojection=orthographic(1,1,1);

limits((-2,-2,0),(0,2,2));

xaxis3(Label("$x$",MidPoint), OutTicks());
yaxis3("$y$", InTicks());
zaxis3("$z$",XYEquals(-2,0), OutTicks());

Étiquettes : ,


Asymptote using graph3.asy – fig0060

Category: Asymptote,Examples 3D,graph3.asyPh. Ivaldi @ 8 h 11 min

Figure 0006
(Compiled with Asymptote version 2.14svn-r5318)
    
import graph3;
usepackage("icomma");

size(8cm,0);
currentprojection=orthographic(1.5,1,1);

limits((-2,-1,-.5), (0,1,1.5));

xaxis3("$x$",
       Bounds(Both,Value),
       OutTicks(endlabel=false));

yaxis3("$y$",
       Bounds(Both,Value),
       OutTicks(Step=.5,step=.25));

zaxis3("$z$", XYEquals(-2,0), InOutTicks(Label(align=Y-X)));

dot(Label("",align=Z), (-1,0,0), red);

Étiquettes : ,


Asymptote using graph3.asy – fig0070

Category: Asymptote,Examples 3D,graph3.asyPh. Ivaldi @ 9 h 11 min

Figure 0007
(Compiled with Asymptote version 2.14svn-r5318)
    
import graph3;

size(8cm,0);
currentprojection=orthographic(1,1,0.5);
limits((-2,-2,0),(0,2,2));

xaxis3(Label("$x$",align=Z),
       Bounds(Min,Min),
       OutTicks(endlabel=false,Step=1,step=0.5));

yaxis3("$y$", Bounds(),
       OutTicks(pTick=0.8*red, ptick=lightgrey));

zaxis3("$z$", Bounds(),
       OutTicks, p=red, arrow=Arrow3);

dot(Label("",align=Z), (-1,0,0), red);

Étiquettes : , ,


Asymptote using graph3.asy – fig0110

Category: Asymptote,Examples 3D,graph3.asyPh. Ivaldi @ 13 h 11 min

Figure 0011
(Compiled with Asymptote version 2.14svn-r5318)
    
import graph3;
import palette;
import contour;
size(14cm,0);
currentprojection=orthographic(-1,-1.5,0.75);
currentlight=(-1,0,5);

real a=1, b=1;
real f(pair z) { return a*(6+sin(z.x/b)+sin(z.y/b));}
real g(pair z){return f(z)-6a;}

// The axes
limits((0,0,4a),(14,14,8a));
xaxis3(Label("$x$",MidPoint),OutTicks());
yaxis3(Label("$y$",MidPoint),OutTicks(Step=2));
ticklabel relativelabel()
{
  return new string(real x) {return (string)(x-6a);};
}
zaxis3(Label("$z$",Relative(1),align=2E),Bounds(Min,Max),OutTicks(relativelabel()));

// The surface
surface s=surface(f,(0,0),(14,14),100,Spline);

pen[] pens=mean(palette(s.map(zpart),Gradient(yellow,red)));

// Draw the surface
draw(s,pens);
// Project the surface onto the XY plane.
draw(planeproject(unitsquare3)*s,pens,nolight);

// Draw contour for "datumz"
real[] datumz={-1.5, -1, 0, 1, 1.5};
guide[][] pl=contour(g,(0,0),(14,14),datumz);
for (int i=0; i < pl.length; ++i)
  for (int j=0; j < pl[i].length; ++j)
    draw(path3(pl[i][j]));

// Draw the contours on the surface
draw(lift(f,pl));

if(!is3D())
  shipout(bbox(3mm,Fill(black)));

Étiquettes : , , , , , , , , , ,


Asymptote using grid3.asy – fig0100

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 20 h 09 min

Figure 0001
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25, 1, 0.25);

limits((-2,-2,0), (0,2,2));

grid3(
      pic=currentpicture,            // picture (default=currentpicture)

      gridroutine=XYZgrid(           // gridtype3droutine or gridtype3droutine [] (alias gridtype3droutines)
                          //                         or gridtype3droutines []:
                          //                         The routine(s) to draw the grid(s);
                          //                         the values can be as follows:
                          //                            * XYgrid : draw grid from X in direction of Y
                          //                            * YXgrid : draw grid from Y in direction of X
                          //                                etc...
                          //                            * An array of previous values XYgrid, YXgrid, ...
                          //                            * XYXgrid : draw XYgrid and YXgrid grids
                          //                            * YXYgrid : draw XYgrid and YXgrid grids
                          //                            * ZXZgrid : draw ZXgrid and XZgrid grids
                          //                            * YX_YZgrid : draw YXgrid and YZgrid grids
                          //                            * XY_XZgrid : draw XYgrid and XZgrid grids
                          //                            * YX_YZgrid : draw YXgrid and YZgrid grids
                          //                            * An array of previous values XYXgrid, YZYgrid, ...
                          //                            * XYZgrid : draw XYXgrid, ZYZgrid and XZXgrid grids.
                          pos=Relative(0)), // position (default=Relative(0)) :
      //                          this is the position of the grid relatively to
      //                          the perpendicular axe of the grid.
      //                          If 'pos' is a the real, 'pos' is a coordinate relativly to this axe.
      //                          Alias 'top=Relative(1)', 'middle=Relative(0.5)'
      //                          and 'bottom=Relative(0)' can be used as value.

      // Following arguments are similar as the function 'Ticks'.
      N=0,                // int (default=0)
      n=0,                // int (default=0)
      Step=0,             // real (default=0)
      step=0,             // real (default=0)
      begin=true,         // bool (default=true)
      end=true,           // bool (default=true)
      pGrid=grey,         // pen (default=grey)
      pgrid=lightgrey,    // pen (default=lightgrey)
      above=false         // bool (default=false)
      );

xaxis3(Label("$x$",position=EndPoint,align=S), Bounds(Min,Min), OutTicks());
yaxis3(Label("$y$",position=EndPoint,align=S), Bounds(Min,Min), OutTicks());
zaxis3(Label("$z$",position=EndPoint,align=(0,0.5)+W), Bounds(Min,Min), OutTicks(beginlabel=false));

Étiquettes : , ,


Asymptote using grid3.asy – fig0200

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 21 h 09 min

Figure 0002
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25, 1, 0.25);

limits((-2,-2,0), (0,2,2));

scale(Linear, Linear, Log(automax=false));
grid3(XZXgrid);
grid3(XYXgrid);
xaxis3(Label("$x$",position=EndPoint,align=S), Bounds(Min,Min), OutTicks());
yaxis3(Label("$y$",position=EndPoint,align=S), Bounds(Min,Min), OutTicks());
zaxis3(Label("$z$",position=EndPoint,align=(0,0.5)+W), Bounds(Min,Min), OutTicks(beginlabel=false));

Étiquettes : , ,


Asymptote using grid3.asy – fig0300

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 22 h 09 min

Figure 0003
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25, 1, 0.25);
limits((-2,-2,0), (0,2,2));

grid3(new grid3routines [] {XYXgrid(Relative(1)), XZXgrid(0)});

xaxis3(Label("$x$",position=EndPoint,align=S), Bounds(Min,Min), OutTicks());
yaxis3(Label("$y$",position=EndPoint,align=S), Bounds(Min,Min), OutTicks());
zaxis3(Label("$z$",position=EndPoint,align=(0,.5)+W), Bounds(Min,Min), OutTicks(beginlabel=false));

Étiquettes : , ,


Asymptote using grid3.asy – fig0400

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 23 h 09 min

Figure 0004
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25, 1, 0.25);
limits((-2,-2,0),(0,2,2));

grid3(new grid3routines [] {XYXgrid(-0.5), XYXgrid(1.5)},
      pGrid=new pen[] {red, blue},
      pgrid=new pen[] {0.5red, 0.5blue});
xaxis3(Label("$x$",position=EndPoint,align=Z), YZEquals(-2,0), OutTicks());
yaxis3(Label("$y$",position=EndPoint,align=Z), XZEquals(-2,0), OutTicks());
zaxis3(Label("$z$",position=EndPoint,align=X), XYEquals(-2,-2), OutTicks(Label("",align=-X-Y)));

Étiquettes : , ,


Asymptote using grid3.asy – fig0500

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 0 h 09 min

Figure 0005
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25,1,0.25);
limits((-2,-2,0),(0,2,2));

real Step=0.5, step=0.25;
xaxis3(Label("$x$",position=EndPoint,align=Z), YZEquals(-2,0),
       InOutTicks(Label(align=0.5*(Z-Y)),
                  Step=Step, step=step,
                  gridroutine=XYgrid,
                  pGrid=red, pgrid=0.5red));

yaxis3(Label("$y$",position=EndPoint,align=Z), XZEquals(-2,0),
       InOutTicks(Label(align=-0.5*(X-Z)), Step=Step, step=step,
                  gridroutine=YXgrid,
                  pGrid=red, pgrid=0.5red));

zaxis3("$z$", XYEquals(-1,0), OutTicks(Label(align=-0.5*(X+Y))));

Étiquettes : , ,


Asymptote using grid3.asy – fig0600

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 1 h 09 min

Figure 0006
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25,1,0.25);
limits((-2,-2,0),(0,2,2));

xaxis3(Label("$x$",position=EndPoint,align=Z), YZEquals(-2,0),
       OutTicks(Label(align=0.5*(Z-Y)),Step=0.5, gridroutine=XYgrid));

yaxis3(Label("$y$",position=EndPoint,align=-X), XZEquals(-2,0),
       InOutTicks(Label(align=0.5*(Z-X)),N=8,n=2, gridroutine=YX_YZgrid));

zaxis3("$z$", OutTicks(ZYgrid));

Étiquettes : , ,


Official Asymptote example – axis3

Category: Asymptote,Official Gallery One-PagerPh. Ivaldi @ 6 h 57 min

Figure 0006
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
import graph3;

size(0,200);
size3(200,IgnoreAspect);

currentprojection=perspective(5,2,2);

scale(Linear,Linear,Log);

xaxis3("$x$",0,1,red,OutTicks(2,2));
yaxis3("$y$",0,1,red,OutTicks(2,2));
zaxis3("$z$",1,30,red,OutTicks(beginlabel=false));

Étiquettes : , ,


Official Asymptote example – grid3xyz

Category: Asymptote,Official Gallery One-PagerPh. Ivaldi @ 21 h 57 min

Figure 0084
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
import grid3;

size(8cm,0,IgnoreAspect);
currentprojection=orthographic(0.5,1,0.5);

scale(Linear, Linear, Log);

limits((-2,-2,1),(0,2,100));

grid3(XYZgrid);

xaxis3(Label("$x$",position=EndPoint,align=S),Bounds(Min,Min),
       OutTicks());
yaxis3(Label("$y$",position=EndPoint,align=S),Bounds(Min,Min),OutTicks());
zaxis3(Label("$z$",position=EndPoint,align=(-1,0.5)),Bounds(Min,Min),
       OutTicks(beginlabel=false));


Étiquettes : ,