(or: Why don’t we practice Carbon Reporting in Computational Humanities?) Oh, the debated question of whether personal or academic LLM use is environmentally problematic. Every once in a while, there’s a wave of discussion about the environmental impacts of using… Continue Reading →
Distant Viewing, the application of computer vision methods to Humanities data in the spirit of Distant Reading, is a well read more Is Distant Viewing a Scam? See also: Original Source by The LaTeX Ninja
The third edition of the LaTeX Beginner’s Guide is now available with 30% off at Amazon, and is ranked as the #1 new release in Amazon’s Technical Writing category. Grab it as long as the Big Spring Sale runs! See… Continue Reading →
The third, improved, and extended edition of the LaTeX Beginner’s Guide was published this month, March 2026. Compared to the first edition from 2011 and the second edition from 2021, the book has been thoroughly revised. The code examples were… Continue Reading →
In November 2024, a translation of the TikZ book written by Stefan Kottwitz has been released by Asakura Publishing. 2024年11月に、Stefan Kottwitz著のTikZに関する書籍の翻訳版が朝倉書店から発売されました。LaTeXで画像を作るための実用的な入門書。TikZにより数学、科学、技術論文に図や画像を簡単に入れられる。アイデアやデータを可視化してプロフェッショナルな図表やプロットを2次元でも3次元でも表示できるようになるために。
Extracted from Wikipedia: In mathematics, differential topology, the Hopf fibration describes a hypersphere in four-dimensional space in terms of circles and an ordinary sphere. Stereographic projection of the Hopf fibration induces a remarkable structure, in which all of 3-dimensional space,… Continue Reading →
Im November 2024 wurde mein TikZ-Buch auf Japanisch durch Asakura Publishing veröffentlicht. 2024年11月に、Stefan Kottwitz著のTikZに関する書籍の翻訳版が朝倉書店から発売されました。LaTeXで画像を作るための実用的な入門書。TikZにより数学、科学、技術論文に図や画像を簡単に入れられる。アイデアやデータを可視化してプロフェッショナルな図表やプロットを2次元でも3次元でも表示できるようになるために。
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 →
\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 →
In November 2024, a translation of the TikZ book written by Stefan Kottwitz has been released by Asakura Publishing. 2024年11月に、Stefan Kottwitz著のTikZに関する書籍の翻訳版が朝倉書店から発売されました。LaTeXで画像を作るための実用的な入門書。TikZにより数学、科学、技術論文に図や画像を簡単に入れられる。アイデアやデータを可視化してプロフェッショナルな図表やプロットを2次元でも3次元でも表示できるようになるために。 本書の内容 第1章「TikZで始める」はTikZ入門だ。他のグラフィックスパッケージと比較してTikZの利点を論じる。TikZとは何かという全体像と独特の哲学を理解する。TikZをインストールする方法を学び、簡単な図を作成していく。さらに、TikZや他のパッケージのマニュアルなどを参照するための役立つヒントが得られる。 第2章「TikZで最初の画像を作る」では、LaTeX文書を一から作る。TikZの構文を理解して、2 次元および3 次元のデカルト座標と極座標を学ぶ。さらに、基本的な多角形の作り方、画像での色の使い方を学ぶ。 第3章「ノードの位置決めと描画」ではノードという基本的概念を与える。様々な形態のノードを位置決めして並べ、テキスト、画像、ラベルを追加する方法を学ぶ。 第4章「辺と矢印を描く」では、ノードの間を辺、直線、曲線、矢印でつなぐ方法を示す。辺にテキストラベルをつける方法や並べ方、位置、方向を調整する方法を学ぶ。線のスタイルや矢頭の形状をカスタマイズしたり両方向にする方法も学ぶ。 第5章「スタイルと画像の読み込み」では、TikZ要素をグローバルまたはローカルなstyleで定義して使う方法を学ぶ。ノードと辺でスタイルを使う方法とスコープを使って画像全体や画像の一部に対してスタイルを適用する方法を学ぶ。さらに、ミニTikZ画像を他の画像の構成要素として使う方法も学ぶ。 第6章「木とグラフの描画」では、親子の階層関係を表す木構造を作る方法を示す。アイデアを可視化するマインドマップの描き方やグラフを生成する簡潔な構文を与える。さらに、LaTeXのtabular環境と同様な行列形式にオブジェクトを配置する方法も示す。/p> 第7章「塗りつぶし、クリッピング、シェーディング」では、より高度な技法から始める。複雑なパスで塗りつぶす方法、特定の領域の画像をクリップしたり、ある色から別の色になめらかに色を変える方法を学ぶ。 第8章「パスの豊かな表現」では、線を曲げたりジグザグにしたり波打たせるようなクリエイティブな効果を加える技法を学ぶ。テキストを曲線に沿わせたり、1 つのパスに複数の作用を適用する方法も学ぶ。 第9章「レイヤー、オーバーレイ、透明性を使う」では、様々なレイヤーに描画して、オブジェクトをテキストや画像の背後に置く方法を学ぶ。透明性を使ってこの効果を上げる方法も学ぶ。さらに、TikZのビジュアルな注釈を通常のLaTeX文書にスーパーインポーズしたり、透かしのような背景画像を追加したりする方法を学ぶ。 第10章「座標とパスで計算する」では、TikZで座標値を計算する効率的な方法を示す。この章は座標計算、距離や射影を使った座標の計算、パスの交点の計算を扱う。また、repeatコマンドでループしてコードを簡単にする方法を学ぶ。 第11章「座標とキャンバスを変換する」では、変換による移動、回転、拡大縮小に焦点を絞る。図に対してちょっとした手直しや複雑な変更を加える必要がある場合に、適切な調整や位置変更ができるスキルを学ぶ。 第12章「なめらかな曲線を描く」では簡単な曲線の曲がりを変えたり、なめらかにして角の尖りをなくし、手書きのように簡単に曲線を描く様々な方法を学ぶ。 第13章「2Dおよび3Dでのプロット」では、座標系でデータをプロットする方法を扱う。2Dおよび3Dでデカルト座標と極座標の座標軸のカスタマイズ、凡例の追加、パラメトリック曲線のプロット、プロットの交点の計算、プロットの間の色塗りを扱う。 第14章「各種チャートを描く」では、フローチャート、関係図、説明図、数量を表す図の作り方を学ぶ。図全体を自動的に作れるようにパッケージの活用法を学ぶ。 第15章「TikZで楽しもう」では、スキルの高いTikZユーザが追加パッケージのプログラミングを楽しみTikZコミュニティでシェアする方法などを列挙する。かわいい動物、人物、国旗、パズルやゲームを描画する方法も学ぶ。… Continue Reading →
\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
\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 →
\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 →
\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 →
\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 →
\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 →
\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 →
\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 →
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 →
\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 →
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 →
\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 →
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 →
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 →
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 →
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 →
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 →
\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 →
\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 →
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 →
\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 →
\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 →
% 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 →
\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 →
\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 →
\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 →
\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 →
\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 →
\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 →
\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 →
\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 →
\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 →
© 2026 TeX.social