You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ size(0,150); pen colour1=red; pen colour2=green; pen colour3=blue; real r=sqrt(3); pair z0=(0,0); pair z1=(-1,0); pair z2=(1,0); pair z3=(0,r); path c1=circle(z1,r); path c2=circle(z2,r); path c3=circle(z3,r); fill(c1,colour1); fill(c2,colour2); fill(c3,colour3); picture intersection12; [...]
Official Asymptote example – truncatedIcosahedron
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ import graph3; size(200); defaultrender.merge=true; real c=(1+sqrt(5))/2; triple[] z={(c,1,0),(-c,1,0),(-c,-1,0),(c,-1,0)}; triple[] x={(0,c,1),(0,-c,1),(0,-c,-1),(0,c,-1)}; triple[] y={(1,0,c),(1,0,-c),(-1,0,-c),(-1,0,c)}; triple[][] Q={ {(c,1,0),(1,0,-c),(0,c,-1),(0,c,1),(1,0,c),(c,-1,0)}, {(-c,1,0),(0,c,1),(0,c,-1),(-1,0,-c),(-c,-1,0),(-1,0,c)}, {(-c,-1,0),(-c,1,0),(-1,0,-c),(0,-c,-1),(0,-c,1),(-1,0,c)}, {(c,-1,0),(c,1,0),(1,0,c),(0,-c,1),(0,-c,-1),(1,0,-c)}, {(0,c,1),(0,c,-1),(-c,1,0),(-1,0,c),(1,0,c),(c,1,0)}, {(0,-c,1),(0,-c,-1),(-c,-1,0),(-1,0,c),(1,0,c),(c,-1,0)}, {(0,-c,-1),(0,-c,1),(c,-1,0),(1,0,-c),(-1,0,-c),(-c,-1,0)}, {(0,c,-1),(0,c,1),(c,1,0),(1,0,-c),(-1,0,-c),(-c,1,0)}, {(1,0,c),(-1,0,c),(0,-c,1),(c,-1,0),(c,1,0),(0,c,1)}, {(1,0,-c),(-1,0,-c),(0,-c,-1),(c,-1,0),(c,1,0),(0,c,-1)}, {(-1,0,-c),(1,0,-c),(0,c,-1),(-c,1,0),(-c,-1,0),(0,-c,-1)}, {(-1,0,c),(1,0,c),(0,c,1),(-c,1,0),(-c,-1,0),(0,-c,1)} }; real [...]
Official Asymptote example – stereoscopic
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ import three; currentprojection=perspective(50*dir(70,15)); picture pic; unitsize(pic,1cm); draw(pic,xscale3(10)*unitcube,yellow,blue); addStereoViews(pic); $(document).ready(function(){$(« a#fige731f8d6ca627160c556dd1bf4753dfc »).fancybox();});
Official Asymptote example – sin3
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ import graph3; import palette; size(12cm,IgnoreAspect); currentprojection=orthographic(1,-2,1); real f(pair z) {return abs(sin(z));} real Arg(triple v) {return degrees(cos((v.x,v.y)),warn=false);} surface s=surface(f,(-pi,-2),(pi,2),20,Spline); s.colors(palette(s.map(Arg),Wheel())); draw(s,render(compression=Low,merge=true)); real xmin=point((-1,-1,-1)).x; real xmax=point((1,1,1)).x; draw((xmin,0,0)–(xmax,0,0),dashed); xaxis3(« $\mathop{\rm Re} z$ »,Bounds,InTicks); [...]
Official Asymptote example – quilt
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ import math; int n=8, skip=3; pair r(int k) { return unityroot(n,k); } pen col=blue, col2=purple; guide square=box((1,1),(-1,-1)); guide step(int mult) { guide g; for(int k=0; k<n; ++k) g=g–r(mult*k); [...]
Official Asymptote example – polardatagraph
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ import graph; size(100); int n=30; real minRadius=0.2; real angles[]=uniform(0,2pi,n); angles.delete(angles.length-1); real[] r=new real[n]; for(int i=0; i < n; ++i) r[i]=unitrand()*(1-minRadius)+minRadius; interpolate join=operator ..(operator tension(10,true)); draw(join(polargraph(r,angles,join),cycle),dot(red));
Official Asymptote example – pipes
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ import solids; import tube; import graph3; import palette; size(8cm); currentprojection=perspective( camera=(13.3596389245356,8.01038090435314,14.4864483364785), up=(-0.0207054323419367,-0.00472438375047319,0.0236460907598947), target=(-1.06042550499095,2.68154529985845,0.795007562120261)); defaultpen(fontsize(6pt)); // draw coordinates and frames // axis1 is defined by z axis of TBase [...]
Official Asymptote example – penfunctionimage
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ import palette; size(200); real fracpart(real x) {return (x-floor(x));} pair pws(pair z) { pair w=(z+exp(pi*I/5)/0.9)/(1+z/0.9*exp(-pi*I/5)); return exp(w)*(w^3-0.5*I); } int N=512; pair a=(-1,-1); pair b=(0.5,0.5); real dx=(b-a).x/N; real dy=(b-a).y/N; pen [...]
Official Asymptote example – partitionExample
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ size(15cm); import bezulate; path[] p = texpath(« $\sigma \Theta$ »); pair m = min(p); pair M = max(p); real midy = 0.5(M.y+m.y); path[] alpha = p[0:2]; path[] theta = p[2:5]; [...]
Official Asymptote example – mergeExample
You may view all the posts of the category « Official Gallery One-Pager » (Compiled with Asymptote version 2.14svn-r5318) /* This code comes from The Official Asymptote Gallery */ size(16cm); import bezulate; pen edgepen=linewidth(1)+blue; pen dotpen=deepgreen; pen labelpen=fontsize(8pt); path outer = (0.5,5){E}..(5,-1){S}..{W}(4,-4)..{W}(2.5,-1.5){W}..(-0.3,-2.5){W}..(-3,0)..cycle; outer = subdivide(outer); path[] p = {outer,shift(-0.5,1.0)*rotate(-22)*scale(1.5,2.4)*subdivide(unitcircle),shift(2.3,0.3)*scale(0.7)*unitcircle}; // a filldraw(p,lightgrey+evenodd); real w = 1.1*(max(p).x-min(p).x); // [...]







