## Asymptote using graph3.asy – fig0010

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

 A Möbius strip of half-width with midcircle of radius and at height can be represented parametrically by: for in and in . In this parametrization, the Möbius strip is therefore a cubic surface with equation Source (Compiled with Asymptote version 2.14svn-r5318)

import graph3;
ngraph=200;
size(12cm,0);
currentprojection=orthographic(-4,-4,5);

real x(real t), y(real t), z(real t);

real R=2;
void xyzset(real s){
x=new real(real t){return (R+s*cos(t/2))*cos(t);};
y=new real(real t){return (R+s*cos(t/2))*sin(t);};
z=new real(real t){return s*sin(t/2);};
}

int n=ngraph;
real w=1;
real s=-w, st=2w/n;
path3 p;
triple[][] ts;
for (int i=0; i <= n; ++i) {
xyzset(s);
p=graph(x,y,z,0,2pi);

ts.push(new triple[] {});
for (int j=0; j <= ngraph; ++j) {
ts[i].push(point(p,j));
}
s += st;
}

pen[] pens={black, yellow, red, yellow, black};
draw(surface(ts, new bool[][]{}), lightgrey);
for (int i=0; i <= 4; ++i) {
xyzset(-w+i*w/2);
draw(graph(x,y,z,0,2pi), 2bp+pens[i]);
}



Étiquettes : , ,

## Asymptote using graph3.asy – fig0020

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

 (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

 (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

 (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

 (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

 (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

 (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 – fig0080

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

 (Compiled with Asymptote version 2.14svn-r5318)

// Adapted from the documentation of Asymptote.
import graph3;
import contour;
texpreamble("\usepackage{icomma}");

size3(12cm,12cm,8cm,IgnoreAspect);

real sinc(pair z) {
real r=2pi*abs(z);
return r != 0 ? sin(r)/r : 1;
}

limits((-2,-2,-0.2),(2,2,1.2));
currentprojection=orthographic(1,-2,0.5);

xaxis3(rotate(90,X)*"$x$",
Bounds(Min,Min),
OutTicks(rotate(90,X)*Label, endlabel=false));

yaxis3("$y$", Bounds(Max,Min), InTicks(Label));
zaxis3("$z$", Bounds(Min,Min), OutTicks());

draw(lift(sinc,contour(sinc,(-2,-2),(2,2),new real[] {0})), bp+0.8*red);
draw(surface(sinc,(-2,-2),(2,2),nx=100, Spline), lightgray);

draw(scale3(2*sqrt(2))*unitdisk, paleyellow+opacity(0.25), nolight);
draw(scale3(2*sqrt(2))*unitcircle3, 0.8*red);



Étiquettes : , , , ,

## Asymptote using graph3.asy – fig0090

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(12cm,0,false);
import graph3;
import contour;
import palette;

texpreamble("\usepackage{icomma}");

real f(pair z) {return z.x*z.y*exp(-z.x);}

currentprojection=orthographic(-2.5,-5,1);

draw(surface(f,(0,0),(5,10),20,Spline),palegray,bp+rgb(0.2,0.5,0.7));

scale(true);

xaxis3(Label("$x$",MidPoint),OutTicks());
yaxis3(Label("$y$",MidPoint),OutTicks(Step=2));
zaxis3(Label("$z=xye^{-x}$",Relative(1),align=2E),Bounds(Min,Max),OutTicks);

real[] datumz={0.5,1,1.5,2,2.5,3,3.5};

Label[] L=sequence(new Label(int i) {
return YZ()*(Label(format("$z=%g$",datumz[i]),
align=2currentprojection.vector()-1.5Z,Relative(1)));
},datumz.length);

pen fontsize=bp+fontsize(10);
draw(L,lift(f,contour(f,(0,0),(5,10),datumz)),



Étiquettes : , , , , ,

## Asymptote using graph3.asy – fig0100

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

 (Compiled with Asymptote version 1.92svn-r4817)

// From documentation of Asymptote
import graph;
import palette;
import contour;
texpreamble("\usepackage{icomma}");

size(10cm,10cm,IgnoreAspect);

pair a=(0,0);
pair b=(5,10);

real fz(pair z) {
return z.x*z.y*exp(-z.x);
}
real f(real x, real y) {return fz((x,y));}

int N=200;
int Divs=10;
int divs=2;

defaultpen(1bp);
pen Tickpen=black;
pen tickpen=gray+0.5*linewidth(currentpen);
pen[] Palette=BWRainbow();

scale(false);

bounds range=image(f,Automatic,a,b,N,Palette);

xaxis("$x$",BottomTop,LeftTicks(pTick=grey, ptick=invisible, extend=true));
yaxis("$y$",LeftRight,RightTicks(pTick=grey, ptick=invisible, extend=true));

// Major contours
real[] Cvals;
Cvals=sequence(11)/10 * (range.max-range.min) + range.min;
draw(contour(f,a,b,Cvals,N,operator ..),Tickpen);

// Minor contours
real[] cvals;
real[] sumarr=sequence(1,divs-1)/divs * (range.max-range.min)/Divs;
for (int ival=0; ival < Cvals.length-1; ++ival)
cvals.append(Cvals[ival]+sumarr);
draw(contour(f,a,b,cvals,N,operator ..),tickpen);

palette("$f(x,y)=xye^{-x}$",range,point(NW)+(0,1),point(NE)+(0,0.25),Top,Palette,
PaletteTicks(N=Divs,n=divs,Tickpen,tickpen));



Étiquettes : , , , , ,