TeX Community Aggregator

Category Asymptote examples (various authors)

Drawing solids

Asymptote can draw standard shapes (spheres, cylinders, cubes, etc) which you can then scale, rotate, and shift to create many other shapes. \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy} import three; settings.render = 0; //Setup View size(200); currentprojection=orthographic(5,4,2); //Draw Axes pen thickblack =… Continue Reading →

Planes intersecting a hyperboloid

\documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy} // settings.outformat=”pdf”; // settings.prc = false; // settings.render = 16; settings.render = 0; import three; import graph; size(8cm,0); currentprojection = orthographic(2,0,10, up=Y); draw(-2X–2X,arrow=Arrow3(),L=Label(“$X$”, position=EndPoint)); draw(-2Y–2Y,arrow=Arrow3(),L=Label(“$U$”, position=EndPoint)); draw(-2Z–2Z); label(“$w \to \infty$”,(2,1,0)); draw((0.5,-1,1)–(0.7,-0.2,1),arrow=Arrow3(size=5bp),L=Label(“$\Pi_w$”, position=BeginPoint)); draw((1.5,-1.3,0)–(1.3,-0.8,0),arrow=Arrow3(size=5bp),L=Label(“$X+U = L \mathrm{e}^{w/L}$”,… Continue Reading →

Plane in space

\documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy} settings.render=0; unitsize(1cm); import three; draw(Label(“$x$”,EndPoint,align=SW),O–2.5X,Arrow3); draw(Label(“$y$”,EndPoint),O–4Y,Arrow3); draw(Label(“$z$”,EndPoint),O–3Z,Arrow3); triple A=(1,sqrt(3),0), B=2Z; path3 p=plane(A,B); draw(surface(p),magenta+opacity(.2)); draw(p,magenta+.6pt); label(“$x\sqrt{3} -y =0$”,A+B,NE,magenta); draw(Label(scale(.6)*”$1$”,EndPoint,align=NW,black),A–(A.x,0,0),gray+dashed); draw(Label(scale(.6)*”$\sqrt{3}$”,EndPoint,align=.4dir(60),black),A–(0,A.y,0),gray+dashed); \end{asy} \end{document} Source: TeX.SE Author: Black Mild (License) See also: Original Source

Double cone

\documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy} settings.render=0; import graph3; currentprojection=orthographic(2,2,.5,zoom=.9); unitsize(1cm); pen plane1=red, plane2=cyan, plane3=blue,pcone=yellow; real a=1.8,h=3; surface c=scale(a,a,h)*shift(0,0,-1)*unitcone; draw(zscale3(-1)*c,pcone+opacity(.5)); draw(c,pcone+opacity(.3)); real b=2.2; path3 g=scale3(b/a)*unitcircle3; draw(shift(0,0,b)*g,plane1+1pt); draw(shift(0,0,-b)*g,plane3+1pt); surface pl=shift(-3,-4,0)*scale(6,8,0)*unitplane; draw(shift(0,0,b)*pl,plane1+opacity(.3)); draw(pl,plane2+opacity(.3)); draw(shift(0,0,-b)*pl,plane3+opacity(.3)); draw(Label(“$\eta_1$”,EndPoint),O–4*X,Arrow3); draw(Label(“$\eta_2$”,EndPoint),O–5*Y,Arrow3); draw(Label(“$\eta_3$”,EndPoint,align=E),-3Z–4*Z,Arrow3); \end{asy} \end{document} Source: TeX.SE Author: Black Mild… Continue Reading →

Constructing a triangle

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[inline=true] import math; import graph; struct construct{ pair[] loc; string[] name; pair[] namePos; guide[] straight; pen[] straightPen; guide[] circ; pen[] circPen; pen thinpen; bool pqr(pair p, pair q, pair r){ return (p.x*(q.y-r.y)+(r.y-p.y)*q.x+r.x*(p.y-q.y))>0; }; pair lastpoint(){ assert(loc.length>0); return… Continue Reading →

Drawing multiple plots

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[inline=true] settings.tex=”pdflatex”; import graph; import math; import palette; size(12cm); import fontsize;defaultpen(fontsize(8pt)); real xmin=-3.6, xmax=5; real ymax=1.6, ymin=-ymax; real dxmin=0, dxmax=0.1; real dymin=0.1, dymax=dymin; xaxis(“$x$”,xmin-dxmin,xmax+dxmax,RightTicks(Step=1,step=0.2,OmitTick(0,2.2)),above=true); yaxis(“$y$”,ymin-dymin,ymax+dymax,LeftTicks (Step=1,step=0.2,OmitTick(0,1.4)),above=true); real[] n={-3, -2, -1, 0, 1, 2, 3}; pen[] p=Gradient(n.length, blue,red);… Continue Reading →

Filled contour plot

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[inline=true] import graph; import contour; import palette; defaultpen(fontsize(10pt)); size(14cm,8cm,IgnoreAspect); pair xyMin=(1,74); pair xyMax=(3,86); real f(real x, real y) {return -2.051^3*1000/(2*3.1415*(2.99*10^2)^2)/(x^2*Cos(y)^2);} int N=200; int Levels=16; defaultpen(1bp); bounds range=bounds(-3,-0.10); // min(f(x,y)), max(f(x,y)) real[] Cvals=uniform(range.min,range.max,Levels); guide[][] g=contour(f,xyMin,xyMax,Cvals,N,operator –); pen[] Palette=Gradient(Levels,rgb(0.3,0.06,0.5),rgb(0.9,0.9,0.85));… Continue Reading →

Blobs

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; size(7cm); import graph; import patterns; import fontsize; defaultpen(fontsize(9pt)); texpreamble(“\usepackage{lmodern}”); pen hatchPen=orange+0.4bp; pen borderPen=deepblue+1bp; pen arrPen=red+1bp; pen areaBG=palegreen; pair[] dots={ (25,280), (60,280), (25,140), }; pair star=(60,137); guide[] arrows={(25,265)–(25,160), (60,265){dir(-90)}..(60,200)..(40,160), }; guide[] markedArrows={ (150,280)–(200,280), (150,140)–(200,140),… Continue Reading →

Vertical spiral in cylinder

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; import solids; import graph3; usepackage(“newtxmath”); size(200,400); real r=3; real h=2.5pi; currentprojection=orthographic(8,2,4); revolution R=cylinder(O,r,h); // The circular helix triple f(real t){ real a=r*cos(t); real b=r*sin(t); real c=t; return (a,b,c); } real k=7; path3 plane=(k,k,0)–(k,-k,0)–(-k,-k,0)–(-k,k,0)–cycle;… Continue Reading →

Folium of Descartes

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.render=8; settings.prc=false; size(8cm); import three; import graph; import fontsize; defaultpen(fontsize(9pt)); pen[] fillpen={ red, orange, yellow, green, lightblue, blue, darkblue }; real xmin=0, xmax=20, ymin=0, ymax=20; xaxis(xmin,xmax,RightTicks(Step=10,step=5)); yaxis(ymin,ymax, LeftTicks(Step=10,step=5)); real ra(real t, real a){return 3*a*sin(t)*cos(t)/(sin(t)^3+cos(t)^3);}; real r(real);… Continue Reading →

Radar-like diagram

Drawing a radar-like diagram. Text can be added with the function putText; the legend is written next to the data sector. \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{asydef} struct RadarPlot{ real[] data; string[] Legend; pen[] Pens; pen gridPen; pen axisPen; pen labelPen; pen legendPen;… Continue Reading →

Projection of Circle onto Spherical Surface

\documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] import graph3; currentprojection=orthographic(-5,-4,2,center=true); guide3 sphere_x_cyl(real a, real r, real R, int n=10){ // return a closed curve of the Sphere–cylinder intersection (top part) // only for the case when a cylinder is completely inside // except… Continue Reading →

Reuleaux Triangle

The boundary of a Reuleaux triangle is a constant width curve based on an equilateral triangle. All points on a side are equidistant from the opposite vertex. (Wikipedia) \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] path triangle = scale(1/2)*polygon(3); pair a = point(triangle,… Continue Reading →

Coloring the faces of a graph

\documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] pen lineAb=black+3pt; pen lineAt=white+1.2pt; pen lineB=dashed+darkblue+1.3pt; pen circA=lightyellow; pen circB=darkblue; pen rimA=red; pen rimB=blue; pen shade=springgreen; guide circ=unitcircle; real d=5; pair a,b,c,u; a=(0,-d); b=(d,-d); c=(d,0); u=1.618b; guide ga=shift(a.x,a.y)*circ; guide gc=shift(c.x,c.y)*circ; guide garc=a{dir(-45)}..u..{dir(135)}c; pair xa=intersectionpoint(ga,c–a); pair xc=intersectionpoint(gc,a–c);… Continue Reading →

Spiral of Roots

This example plots a spiral of roots. \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asydef} unitsize(2cm); import fontsize; defaultpen(fontsize(9pt)); pen linepen=deepblue+0.8bp; pen labelpen=black; pen markpen=gray+0.6bp; void spiralOfRoots(int n){ assert(n>0); real w=0.15; pair O=0E,a=E,b; pair p,q,r; for(int i=1;i<=n;++i){ draw(O–a,linepen); label(“$\sqrt{“+string(i)+”}$”,O–a,O,labelpen,UnFill); b=a+dir(degrees(a)+90); draw(a–b,linepen); p= w*dir(b-a); r=-w*dir(a);… Continue Reading →

Torus

This example plots a lattice of points on the surface of a torus. \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; import graph3; pen surfPen=rgb(1,0.7,0); pen xarcPen=deepblue+0.7bp; pen yarcPen=deepred+0.7bp; currentprojection=perspective(5,4,4); real R=2; real a=1; triple fs(pair t) { return ((R+a*Cos(t.y))*Cos(t.x),(R+a*Cos(t.y))*Sin(t.x),a*Sin(t.y)); }… Continue Reading →

Cubes

This solution illustrates (a+b)^3 = a^3 + 3a^2b + 3ab^2 + b^3. \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; unitsize(1cm); import three; currentprojection=orthographic(3,2,1,center=true,zoom=.8); //currentprojection=orthographic(0,10,0,zoom=.8); light White=light(new pen[] {rgb(0.38,0.38,0.45),rgb(0.6,0.6,0.67), rgb(0.5,0.5,0.57)},specularfactor=3, new triple[] {(5,5,5),(0,5,5),(-0.5,0,2)}); currentlight=White; real a=3.2, b=1.5; path3[] p=unitbox; surface q=unitcube;… Continue Reading →

Fish

A fish for fun \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; real w=600,h=400; size(h,w); pen bgPen=rgb(0,0.647,1), bodyPen=rgb(0.847,0.196,0.133), whitePen=rgb(1,1,1), eyePen=rgb(0.004,0.18,1)+opacity(0.01), mouthPen=rgb(1,1,1), scalesPen=rgb(0.98,1,0)+12pt; pair[][] bBody={ {(454,270),(436,252),(443,251),},{(433,269),(424,286),(398,322),}, {(361,352),(324,382),(276,405),},{(218,394),(160,382),(92,334),}, {(55,295),(18,256),(12,226),},{(13,187),(14,149),(21,102),}, {(65,66),(109,30),(189,3),},{(243,2),(296,1),(322,24),}, {(348,46),(374,68),(398,89),},{(414,109),(430,129),(437,149),}, {(450,143),(463,137),(481,105),},{(504,80),(526,55),(552,37),}, {(568,40),(585,43),(592,66),},{(584,97),(576,128),(553,166),}, {(542,181),(531,197),(531,189),},{(543,204),(555,218),(579,256),}, {(585,286),(591,316),(578,339),},{(571,349),(563,359),(561,356),}, {(538,338),(515,320),(472,287),}, }; pair[][] bWhite={ {(223,261),(227,278),(209,303),},{(192,312),(174,321),(156,315),}, {(141,304),(127,293),(115,276),},{(116,260),(118,244),(132,228),}, {(143,222),(155,215),(162,220),},{(179,227),(195,234),(220,244),}, };… Continue Reading →

Möbius strip

The Möbius strip, as a parametric surface. \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; import graph3; size(200,IgnoreAspect); size3(200,IgnoreAspect); currentprojection=orthographic(camera=(1.5,0.3,2),up=Z,target=(0.5,0,0),zoom=0.8); real r=2, w=1; real x(real u, real v){return (r+v/2*cos(3pi*u))*cos(2pi*u);}; real y(real u, real v){return (r+v/2*cos(3pi*u))*sin(2pi*u);}; real z(real u, real v){return (v/2*sin(3pi*u));};… Continue Reading →

Trefoil knot

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; import graph3; import tube; size(200,0); currentlight.background=paleyellow+opacity(0.0); currentprojection=orthographic(camera=(-40,9,70), up=Z); real x(real t){return sin(t)+2sin(2t);} real y(real t){return cos(t)-2cos(2t);} real z(real t){return -sin(3t);} guide3 g=graph(x,y,z, 0, 2pi,operator..); draw(tube(g,circle((0,0),0.618)),white); \end{asy} \end{document} Source: TeX.SE Author: g.kov (License) See… Continue Reading →

One-sided trefoil knot

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; import graph3; import tube; size(200,0); currentlight.background=paleyellow+opacity(0.0); currentprojection=orthographic(camera=(-10,49,-58),up=(0.92,0.36,0.14)); real x(real t){return sin(2pi*t)+2sin(2*2pi*t);} real y(real t){return cos(2pi*t)-2cos(2*2pi*t);} real z(real t){return -sin(3*2pi*t);} guide3 g=graph(x,y,z, 0, 1,operator..); pair[][] p={ {(-40, 20),( -56.8421, 23.4210),( -78.9473, 28.6842),(-90, 20)}, {(-90,… Continue Reading →

Blowup of a plane at a point

The following image illustrates the blowup of a plane at a point–an important construction in algebraic geometry. \documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; usepackage(“lmodern”); usepackage(“fontenc”,”T1″); usepackage(“amssymb”); // for the \mathbb command defaultpen(fontsize(10pt)); import graph3; size(400,400); currentprojection=orthographic(5,-10,4); real R=8; struct… Continue Reading →

Bezier control points of a letter

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; size(7cm); import fontsize; defaultpen(fontsize(9pt)); real wd=0.6bp; pen dotPen=deepblue+wd; pen dotFill=dotPen; pen dotPenB=blue+wd; pen dotPenC=red+wd; pen linePen=deepblue+wd; pen fillPen=lightgreen+opacity(0.5); pen thinLinePen=black+wd/2; guide[] g; g=texpath(“$\Omega$”); filldraw(g,fillPen,linePen); pair a,b,c,d; pair labdir; int pointNo=0; for(int i=0;i<g.length;++i){ for(int… Continue Reading →

Chain

\documentclass[margin=10pt,convert]{standalone} \usepackage{asymptote} \begin{document} \begin{asydef} // Global Asymptote definitions real linkLen=1, linkWidth=2pt; real rl=2+linkLen; // distance between beads guide link=(1,0)–(1+linkLen,0); // a link pen beadColor=orange; pen linkColor=beadColor; void bead(transform t){ draw(t*link,linkColor+linkWidth); radialshade(t*unitcircle, beadColor,shift(t)*(-0.4,0.3),0.01 ,black,shift(t)*(-0.4,0.3),1.5); } pair operator>(pair pos=(0,0), real phi){ transform… Continue Reading →

Chains of Rings

% chain.tex : % \begin{filecontents*}{chainofrings.asy} struct chainOfRings{ int n; // number of rings real w; pair origin; pen[] clrA={deepgreen,deepblue}; pen[] clrB={white,lightyellow,palered}; guide qring; real Rscaled(int); real rscaled(int); real eps; void drawHalf(int i,real Rt,real rt, pair p,real phi){ qring=rotate(phi)*(arc((0,0),Rt,-eps,90+eps)–reverse(arc((0,0),rt,-eps,90+eps))–cycle); radialshade(shift(p)*qring ,clrA[i%clrA.length],… Continue Reading →

Plot a function in integral form

\documentclass{article} \usepackage[inline]{asymptote} \usepackage{lmodern} \begin{document} \begin{asy} size(300,200,IgnoreAspect); import graph; real F(real t){return 4/sqrt(1+t^4);} real f(real x){return simpson(F,x,2x);} pen axPen=darkblue; pen fPen=red+1bp; draw(graph(f,-7,7,n=200),fPen); string noZero(real x) {return (x==0)?””:string(x);} defaultpen(fontsize(10pt)); xaxis(axPen,LeftTicks(noZero,Step=2)); yaxis(axPen,RightTicks(noZero,Step=0.5)); label(“$f:x\mapsto \displaystyle\int_x^{2x}” +”\frac{4}{\sqrt{1+t^4}}\, \textrm{d}t$” ,(1.7,f(1.7)),NE); \end{asy} \end{document} Source: TeX.SE Author: g.kov… Continue Reading →

Blurred curve

\documentclass[border=10pt]{standalone} \usepackage{textgreek} \usepackage[inline]{asymptote} \usepackage{lmodern} \begin{document} \begin{asy} size(200); import graph; pair[] botP={(0,0.09),(0.252,0.196),(0.383,0.429),(0.479,0.588), (0.574,0.668),(0.733,0.726),(0.883,0.747),(1,0.747),}; pair[] topP={(0,0.341),(0.252,0.451),(0.383,0.677),(0.479,0.841), (0.574,0.92),(0.733,0.977),(0.883,0.993),(1,1),}; pair[] midP=0.5*(topP+botP); guide gtop=graph(topP,operator..); guide gbot=graph(botP,operator..); guide gmid=graph(midP,operator..); real f(real x){ real t=times(gmid,x)[0]; return point(gmid,t).y; }; real s(real x){ real tt=times(gtop,x)[0]; real tb=times(gbot,x)[0]; return point(gtop,tt).y-point(gbot,tb).y;… Continue Reading →

Quarter sessile drop

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; import three; import solids; unitsize(1cm); currentprojection = orthographic(5,4,2); path3 x = (-1,0,0)–(4.5,0,0); draw(x,EndArrow3); label(“$x$”,(4.7,0,0)); path3 y = (0,-1,0)–(0,4.5,0); draw(y,EndArrow3); label(“$y$”,(0,4.7,0)); path3 z = (0,0,-1)–(0,0,4.5); draw(z,EndArrow3); label(“$z$”,(0,0,4.7)); label(“$O$”,(0,-0.3,-0.5)); path3 a = arc(O,3,0,0,90,0); draw(a); revolution… Continue Reading →

Parametrised surface

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[inline=true] import graph3; real w=9cm, h=1.618w; size(w,h); currentprojection=orthographic(camera=(-13,-8.6,59),up=Z,target=(0.5,0.5,3),zoom=1); import fontsize; defaultpen(fontsize(9pt)); texpreamble(“\usepackage{siunitx}\usepackage{lmodern}”); pen linePen=darkblue+0.9bp; pen grayPen=gray(0.3)+0.8bp; pen dashPen=gray(0.3)+0.8bp+linetype(new real[] {5,5}); pen patchFillPen=paleblue; pen planeFillPen=deepgreen+opacity(0.3); triple[][] p={ // Bicubic Bezier patch control points {(1 ,0.3,0),(1 ,0.5,-1),(1 ,0.6,1),(1 ,1,0),},… Continue Reading →

Spiral cone

\documentclass[border=10pt]{standalone} \usepackage[inline]{asymptote} \begin{document} \begin{asy} settings.render = 0; settings.prc = false; import graph3; real unit = 0.1cm; unitsize(unit); defaultpen(fontsize(10pt)); triple eyeDirection = dir((-2,-2,0.7)); currentprojection = orthographic(eyeDirection); triple translateDirection = dir(cross(Z, eyeDirection)); void drawBehind(path3 thepath, pen pen=currentpen, real backOpacity = 1.0, real… Continue Reading →

Moving contact line

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] unitsize(1cm); path a = (1,2.4)–(4,0.6)..(4.5,1)..(4.1,1.9)..(3.9,2)..cycle; draw(a); fill(a,cyan); path b = (0,3)–(5,0); draw(b,linewidth(2)); path c = shift(4,0.6)*scale(0.6)*unitcircle; draw(c,red+dashed); path d = (5,1.2)–(6,1.8); draw(d,EndArrow); path e = shift(8,3)*scale(2)*unitcircle; draw(e,red+dashed); path f = (9.4,1.6)–(6.1,3.58); draw(f,linewidth(2)); path g = (8,2.44)..(8.8,3.2)..(8.6,3.8)..(8.4,4.1);… Continue Reading →

Drawing in Spherical Coordinates

\documentclass[border=10pt]{standalone} \usepackage{lmodern} \usepackage{upgreek} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; import three; import graph3; import grid3; currentprojection=obliqueX; //Draw Axes pen thickblack = black+0.75; real axislength = 1.0; draw(L=Label(“$x$”, position=Relative(1.1), align=SW), O–axislength*X,thickblack, Arrow3); draw(L=Label(“$y$”, position=Relative(1.1), align=E), O–axislength*Y,thickblack, Arrow3); draw(L=Label(“$z$”, position=Relative(1.1), align=N), O–axislength*Z,thickblack,… Continue Reading →

Crystal structure

\documentclass[border=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] settings.outformat=”pdf”; settings.render=0; settings.prc=false; size(300); import solids; currentprojection=orthographic ( camera=(8,5,4), up=(0,0,1), target=(2,2,2), zoom=0.5 ); // save predefined 2D orientation vectors pair NN=N; pair SS=S; pair EE=E; pair WW=W; //%points on cube triple A = (0,0,0); triple B… Continue Reading →

Diagram with Gradients

\documentclass[border=10pt]{standalone} \usepackage{lmodern} \usepackage{upgreek} \usepackage[inline]{asymptote} \begin{document} \begin{asy}[width=\the\linewidth,inline=true] import graph; import roundedpath; import math; //texpreamble(“\usepackage{upgreek}”); defaultpen(fontsize(10pt)); real sc=2; unitsize(sc*1bp); // 1. bounding ellipse guide ell=(150,60)..(75,120)..(3.4,60)..(75,0)..cycle; // 2. day pen penA=rgb(0.773,0.831,0.882); pen penB=rgb(0.09,0.09,0.09); pair a=(70,60); pair b=(100,60); fill(box((0,0),(90,120)),penA); axialshade(box((0,0),(100,120)),penA,a, extenda=false,penB,b, extendb=false); // night… Continue Reading →

© 2025 TeX.social