summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/doc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-25 19:22:25 +0000
committerKarl Berry <karl@freefriends.org>2021-02-25 19:22:25 +0000
commitad547a6b5986815fda458221149728d9d9ab1d87 (patch)
tree16296910eb3eca724371474ea9aea3994dc69614 /Build/source/utils/asymptote/doc
parent947b43de3dd21d58ccc2ffadefc4441ea1c2a813 (diff)
restore Build,TODO from r57911
git-svn-id: svn://tug.org/texlive/trunk@57915 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/doc')
-rw-r--r--Build/source/utils/asymptote/doc/Bode.asy27
-rw-r--r--Build/source/utils/asymptote/doc/CAD.pdfbin0 -> 186216 bytes
-rw-r--r--Build/source/utils/asymptote/doc/CAD.tex256
-rw-r--r--Build/source/utils/asymptote/doc/CAD1.asy43
-rw-r--r--Build/source/utils/asymptote/doc/CDlabel.asy16
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/Makefile40
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn1287
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/asy-faq.info1671
-rwxr-xr-xBuild/source/utils/asymptote/doc/FAQ/bfnnconv.pl302
-rwxr-xr-xBuild/source/utils/asymptote/doc/FAQ/install-sh520
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/m-ascii.pl189
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/m-html.pl344
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/m-info.pl226
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/m-lout.pl242
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/m-post.pl189
-rw-r--r--Build/source/utils/asymptote/doc/GaussianSurface.asy21
-rw-r--r--Build/source/utils/asymptote/doc/HermiteSpline.asy14
-rw-r--r--Build/source/utils/asymptote/doc/Hobbycontrol.asy20
-rw-r--r--Build/source/utils/asymptote/doc/Hobbydir.asy21
-rw-r--r--Build/source/utils/asymptote/doc/Makefile.in126
-rw-r--r--Build/source/utils/asymptote/doc/TeXShopAndAsymptote.pdfbin0 -> 77166 bytes
-rw-r--r--Build/source/utils/asymptote/doc/TeXShopAndAsymptote.tex94
-rw-r--r--Build/source/utils/asymptote/doc/asy-latex.dtx714
-rw-r--r--Build/source/utils/asymptote/doc/asy-latex.pdfbin0 -> 194511 bytes
-rw-r--r--Build/source/utils/asymptote/doc/asy.1333
-rw-r--r--Build/source/utils/asymptote/doc/asy.1.begin32
-rw-r--r--Build/source/utils/asymptote/doc/asy.1.end10
-rw-r--r--Build/source/utils/asymptote/doc/asyRefCard.pdfbin0 -> 121128 bytes
-rw-r--r--Build/source/utils/asymptote/doc/asyRefCard.tex558
-rw-r--r--Build/source/utils/asymptote/doc/asycolors.sty72
-rw-r--r--Build/source/utils/asymptote/doc/asymptote.pdfbin0 -> 1213066 bytes
-rw-r--r--Build/source/utils/asymptote/doc/asymptote.sty404
-rw-r--r--Build/source/utils/asymptote/doc/asymptote.texi10180
-rw-r--r--Build/source/utils/asymptote/doc/axis3.asy12
-rw-r--r--Build/source/utils/asymptote/doc/bezier.asy1
-rw-r--r--Build/source/utils/asymptote/doc/bezier2.asy21
-rw-r--r--Build/source/utils/asymptote/doc/beziercurve.asy12
-rw-r--r--Build/source/utils/asymptote/doc/bigdiagonal.asy2
-rw-r--r--Build/source/utils/asymptote/doc/binarytreetest.asy13
-rw-r--r--Build/source/utils/asymptote/doc/brokenaxis.asy25
-rw-r--r--Build/source/utils/asymptote/doc/colo-asy.tex84
-rw-r--r--Build/source/utils/asymptote/doc/colons.asy1
-rw-r--r--Build/source/utils/asymptote/doc/colors.asy115
-rw-r--r--Build/source/utils/asymptote/doc/cube.asy15
-rw-r--r--Build/source/utils/asymptote/doc/cylinderskeleton.asy6
-rw-r--r--Build/source/utils/asymptote/doc/datagraph.asy12
-rw-r--r--Build/source/utils/asymptote/doc/diagonal.asy1
-rw-r--r--Build/source/utils/asymptote/doc/diatom.asy129
-rw-r--r--Build/source/utils/asymptote/doc/diatom.csv28
-rw-r--r--Build/source/utils/asymptote/doc/dots.asy1
-rw-r--r--Build/source/utils/asymptote/doc/eetomumu.asy60
-rw-r--r--Build/source/utils/asymptote/doc/elliptic.asy115
-rw-r--r--Build/source/utils/asymptote/doc/errorbars.asy42
-rw-r--r--Build/source/utils/asymptote/doc/exp.asy14
-rw-r--r--Build/source/utils/asymptote/doc/external-proposal.html415
-rw-r--r--Build/source/utils/asymptote/doc/externalprc.tex13
-rw-r--r--Build/source/utils/asymptote/doc/extra/intro.asy959
-rw-r--r--Build/source/utils/asymptote/doc/filegraph.asy15
-rw-r--r--Build/source/utils/asymptote/doc/filegraph.dat4
-rw-r--r--Build/source/utils/asymptote/doc/flow.asy31
-rw-r--r--Build/source/utils/asymptote/doc/flowchartdemo.asy27
-rw-r--r--Build/source/utils/asymptote/doc/generalaxis.asy11
-rw-r--r--Build/source/utils/asymptote/doc/generalaxis3.asy13
-rw-r--r--Build/source/utils/asymptote/doc/graphmarkers.asy37
-rw-r--r--Build/source/utils/asymptote/doc/grid3xyz.asy17
-rw-r--r--Build/source/utils/asymptote/doc/hatch.asy11
-rw-r--r--Build/source/utils/asymptote/doc/helix.asy20
-rw-r--r--Build/source/utils/asymptote/doc/histogram.asy19
-rw-r--r--Build/source/utils/asymptote/doc/icon.asy22
-rw-r--r--Build/source/utils/asymptote/doc/image.asy21
-rw-r--r--Build/source/utils/asymptote/doc/imagecontour.asy38
-rwxr-xr-xBuild/source/utils/asymptote/doc/install-sh520
-rw-r--r--Build/source/utils/asymptote/doc/irregularcontour.asy21
-rw-r--r--Build/source/utils/asymptote/doc/join.asy15
-rw-r--r--Build/source/utils/asymptote/doc/join3.asy21
-rw-r--r--Build/source/utils/asymptote/doc/knots.asy27
-rw-r--r--Build/source/utils/asymptote/doc/labelsquare.asy6
-rw-r--r--Build/source/utils/asymptote/doc/latexmkrc4
-rw-r--r--Build/source/utils/asymptote/doc/latexmkrc_asydir4
-rw-r--r--Build/source/utils/asymptote/doc/latexusage.tex119
-rw-r--r--Build/source/utils/asymptote/doc/leastsquares.asy55
-rw-r--r--Build/source/utils/asymptote/doc/leastsquares.dat882
-rw-r--r--Build/source/utils/asymptote/doc/legend.asy15
-rw-r--r--Build/source/utils/asymptote/doc/lineargraph.asy16
-rw-r--r--Build/source/utils/asymptote/doc/lineargraph0.asy16
-rw-r--r--Build/source/utils/asymptote/doc/linetype.asy13
-rw-r--r--Build/source/utils/asymptote/doc/log2graph.asy17
-rw-r--r--Build/source/utils/asymptote/doc/loggraph.asy17
-rw-r--r--Build/source/utils/asymptote/doc/loggrid.asy13
-rw-r--r--Build/source/utils/asymptote/doc/logimage.asy22
-rw-r--r--Build/source/utils/asymptote/doc/logo.asy28
-rw-r--r--Build/source/utils/asymptote/doc/logticks.asy11
-rw-r--r--Build/source/utils/asymptote/doc/makepen.asy9
-rw-r--r--Build/source/utils/asymptote/doc/markers1.asy102
-rw-r--r--Build/source/utils/asymptote/doc/markers2.asy34
-rw-r--r--Build/source/utils/asymptote/doc/mexicanhat.asy22
-rw-r--r--Build/source/utils/asymptote/doc/monthaxis.asy17
-rw-r--r--Build/source/utils/asymptote/doc/multicontour.asy19
-rw-r--r--Build/source/utils/asymptote/doc/ocg.sty130
-rw-r--r--Build/source/utils/asymptote/doc/onecontour.asy5
-rw-r--r--Build/source/utils/asymptote/doc/parametricgraph.asy15
-rw-r--r--Build/source/utils/asymptote/doc/penfunctionimage.asy27
-rw-r--r--Build/source/utils/asymptote/doc/penimage.asy14
-rw-r--r--Build/source/utils/asymptote/doc/pixel.pdfbin0 -> 2771 bytes
-rw-r--r--Build/source/utils/asymptote/doc/planes.asy18
-rw-r--r--Build/source/utils/asymptote/doc/png/Makefile.in57
-rw-r--r--Build/source/utils/asymptote/doc/png/asymptote.info10446
-rw-r--r--Build/source/utils/asymptote/doc/quartercircle.asy2
-rw-r--r--Build/source/utils/asymptote/doc/reloadpdf.tex11
-rw-r--r--Build/source/utils/asymptote/doc/saddle.asy7
-rw-r--r--Build/source/utils/asymptote/doc/scaledgraph.asy15
-rw-r--r--Build/source/utils/asymptote/doc/secondaryaxis.asy32
-rw-r--r--Build/source/utils/asymptote/doc/secondaryaxis.csv1003
-rw-r--r--Build/source/utils/asymptote/doc/shadedtiling.asy12
-rw-r--r--Build/source/utils/asymptote/doc/slopefield1.asy9
-rw-r--r--Build/source/utils/asymptote/doc/square.asy2
-rw-r--r--Build/source/utils/asymptote/doc/subpictures.asy20
-rw-r--r--Build/source/utils/asymptote/doc/superpath.asy5
-rw-r--r--Build/source/utils/asymptote/doc/tile.asy13
-rw-r--r--Build/source/utils/asymptote/doc/triangulate.asy19
-rw-r--r--Build/source/utils/asymptote/doc/unitcircle3.asy9
-rw-r--r--Build/source/utils/asymptote/doc/vectorfield.asy9
-rw-r--r--Build/source/utils/asymptote/doc/westnile.asy64
-rw-r--r--Build/source/utils/asymptote/doc/westnile.csv402
-rw-r--r--Build/source/utils/asymptote/doc/xasy.1x27
125 files changed, 34751 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/doc/Bode.asy b/Build/source/utils/asymptote/doc/Bode.asy
new file mode 100644
index 00000000000..6cc634299ff
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/Bode.asy
@@ -0,0 +1,27 @@
+import graph;
+texpreamble("\def\Arg{\mathop {\rm Arg}\nolimits}");
+
+size(10cm,5cm,IgnoreAspect);
+
+real ampl(real x) {return 2.5/sqrt(1+x^2);}
+real phas(real x) {return -atan(x)/pi;}
+
+scale(Log,Log);
+draw(graph(ampl,0.01,10));
+ylimits(0.001,100);
+
+xaxis("$\omega\tau_0$",BottomTop,LeftTicks);
+yaxis("$|G(\omega\tau_0)|$",Left,RightTicks);
+
+picture q=secondaryY(new void(picture pic) {
+ scale(pic,Log,Linear);
+ draw(pic,graph(pic,phas,0.01,10),red);
+ ylimits(pic,-1.0,1.5);
+ yaxis(pic,"$\Arg G/\pi$",Right,red,
+ LeftTicks("$% #.1f$",
+ begin=false,end=false));
+ yequals(pic,1,Dotted);
+ });
+label(q,"(1,0)",Scale(q,(1,0)),red);
+add(q);
+
diff --git a/Build/source/utils/asymptote/doc/CAD.pdf b/Build/source/utils/asymptote/doc/CAD.pdf
new file mode 100644
index 00000000000..373599d13c8
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/CAD.pdf
Binary files differ
diff --git a/Build/source/utils/asymptote/doc/CAD.tex b/Build/source/utils/asymptote/doc/CAD.tex
new file mode 100644
index 00000000000..270c528b85f
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/CAD.tex
@@ -0,0 +1,256 @@
+\documentclass{ltxguide}
+\usepackage{graphicx}
+
+
+
+\begin{document}
+
+
+
+\title{Asymptote package CAD.asy\footnote{This document describes version 1.0.}}
+\author{Mark Henning, Germany\thanks{URL: http://www.markhenning.de}}
+\date{29 September 2006}
+\maketitle
+
+
+
+\tableofcontents
+
+
+
+\section{Introduction}
+
+The package {\tt CAD.asy} provides basic pen definitions and measurement functions for simple 2D CAD drawings according to DIN 15.
+
+
+
+\section{Important rules for using this package}
+
+If a function is declared like this:
+%
+\begin{verbatim}
+void foo(int nParam1, string strParam2)
+\end{verbatim}
+%
+You may call it \verb\foo(0, 'abc');\ or \verb\foo(nParam1=0, strParam2='abc');\. The definitions of the functions in this package may change in future version: the order of the parameters may be changed, new parameters may be inserted. Therefore it is \emph{strongly recommended} always calling the functions \verb\foo(nParam1=0, strParam2='abc');\.
+
+
+
+\section{Usage}
+
+To use the capabilities of the package, import it:
+%
+\begin{verbatim}
+import CAD;
+\end{verbatim}
+%
+All functions are encapsulated in the structure \verb\sCAD\. As the pen definitions may differ depending on the size of your drawing, you have to initialize the structure before drawing:
+
+\begin{verbatim}
+static sCAD Create(int nLineGroup = 1)
+\end{verbatim}
+%
+The parameter \verb\nLineGroup\ depends on the size of your drawing. It specifies the line group to define the pens and thus the width used for the lines. The parameter has to be within the range $[0;3]$. The larger the value, the thicker the lines. Code example:
+%
+\begin{quote}\begin{verbatim}
+sCAD cad = sCAD.Create();
+\end{verbatim}\end{quote}
+
+The created variable \verb\cad\ then provides the most important pens. Available pens are:
+%
+\begin{itemize}
+\item The pens of group A:
+ \begin{itemize}
+ \item\verb\pA\
+ \item\verb\pVisibleEdge\
+ \item\verb\pVisibleContour\
+ \item\verb\pUsableWindingLength\
+ \item\verb\pSystemLine\
+ \item\verb\pDiagramCurve\
+ \item\verb\pSurfaceStructure\
+ \end{itemize}
+\item The pens of group B:
+ \begin{itemize}
+ \item\verb\pB\
+ \item\verb\pLightEdge\
+ \item\verb\pMeasureLine\
+ \item\verb\pMeasureHelpLine\
+ \item\verb\pMeasureLineBound\
+ \item\verb\pReferenceLine\
+ \item\verb\pHatch\
+ \item\verb\pWindingGround\
+ \item\verb\pDiagonalCross\
+ \item\verb\pBendLine\
+ \item\verb\pProjectionLine\
+ \item\verb\pGrid\
+ \end{itemize}
+\item The pens of group C:
+ \begin{itemize}
+ \item\verb\pC\
+ \item\verb\pFreehand\
+ \end{itemize}
+\item The pens of group E:
+ \begin{itemize}
+ \item\verb\pE\
+ \item\verb\pSurfaceTreatmentAllowed\
+ \end{itemize}
+\item The pens of group F:
+ \begin{itemize}
+ \item\verb\pF\
+ \item\verb\pInvisibleEdge\
+ \item\verb\pInvisibleContour\
+ \end{itemize}
+\item The pens of group G:
+ \begin{itemize}
+ \item\verb\pG\
+ \item\verb\pMiddleLine\
+ \item\verb\pSymmetryLine\
+ \item\verb\pPartialCircle\
+ \item\verb\pCircularHole\
+ \item\verb\pDivisionPlane\
+ \item\verb\pTransferLine\
+ \end{itemize}
+\item The pens of group J:
+ \begin{itemize}
+ \item\verb\pJ\
+ \item\verb\pCuttingPlane\
+ \item\verb\pSurfaceTreatmentRequested\
+ \end{itemize}
+\item The pens of group K:
+ \begin{itemize}
+ \item\verb\pK\
+ \item\verb\pContourBeforeDeformation\
+ \item\verb\pAdjacentPartContour\
+ \item\verb\pEndShapeRawMaterial\
+ \item\verb\pContourEligibleType\
+ \item\verb\pPartInFrontOfCuttingPlane\
+ \end{itemize}
+\end{itemize}
+%
+All pens of one group are the same. So there is no difference between the pen \verb\pA\ and the pen \verb\pVisibleEdge\. You may use the short names or the descriptive ones. The list of groups is not complete. I had no idea how to implement the pens of group D. For me, group H seems to be obsolete, and there is no group I contained in DIN 15. In the case I did something wrong translating the German names into English, the source file also contains the original German names of each pen. Whenever a drawing function does not allow you to select the pen, the right pen is selected automatically.
+
+
+
+\begin{verbatim}
+void MeasureLine(picture pic = currentpicture,
+ Label L,
+ pair pFrom,
+ pair pTo,
+ real dblLeft = 0,
+ real dblRight = 0,
+ real dblRelPosition = 0.5,
+ bool bSmallBound = false)
+\end{verbatim}
+%
+This is the basic function to draw labeled straight measurement lines. \verb\pic\ denotes the picture the line has to be drawn into, \verb\L\ is the label of the line. The pairs \verb\pFrom\ and \verb\pTo\ are the start and the end point of the distance to measure, respectively. Note, that these two points do \emph{not} refer to the start and end point of the line, as it may be longer than the measured distance.
+
+The line is extended on its left side (= the part of the line 'before' the start point) by the distance \verb\dblLeft\. On its right side (= the part of the line 'behind' the end point) it is extended by the distance \verb\dblRight\. \verb\dblLeft\ and \verb\dblRight\ must be $\leq 0$. If only one of both values is zero, it is set to the value of the other one, because according to DIN 15 it is not allowed to draw a measurement line asymmetrically. The position of the arrows indicating begin and end of the distance depends on \verb\dblLeft\ and \verb\dblRight\. If both values are 0, the measurement arrows are drawn within the measurement distance. Otherwise they are drawn outside.
+
+The parameter \verb\dblRelPosition\ refers to the relative position of the label between the start and end point. This means: The value 0 positions the label at the start point, 0.5 refers to the center between the start and the end point. Finally, the value 1 will position the label at the end point. If \verb\dblLeft\ or \verb\dblRight\ are nonzero, you may position the label at the left side of the start point ($< 0$) or at the right side of the start point ($> 1$).
+
+Usually, there is enough space to draw the measurement arrows. If you wish to use small circles instead of the arrows, set \verb\bSmallBound\ to \verb\true\.
+
+
+
+\begin{verbatim}
+real GetMeasurementBoundSize(bool bSmallBound = false)
+\end{verbatim}
+%
+Returns the size of the arrow or the small bound circle used for measurement lines.
+
+
+
+\begin{verbatim}
+guide GetMeasurementBound(bool bSmallBound = false)
+\end{verbatim}
+%
+Returns the correctly scaled guide of the arrow or the small bound circle used for measurement lines.
+
+
+
+\begin{verbatim}
+void MeasureParallel(picture pic = currentpicture,
+ Label L,
+ pair pFrom,
+ pair pTo,
+ real dblDistance,
+ // Variables from MeasureLine
+ real dblLeft = 0,
+ real dblRight = 0,
+ real dblRelPosition = 0.5,
+ bool bSmallBound = false)
+\end{verbatim}
+%
+Usually, measurement lines are placed outside the drawing with reference lines to the measured distance. \verb\pFrom\ and \verb\pTo\ denote the points of the drawing marking the begin and the end of the distance to measure, and not the begin and the end of the measurement line as in the case of the function \verb\MeasureLine\. The measurement line is placed \verb\dblDistance\ away from the distance to measure. If you would be at \verb\pFrom\ and look into the direction \verb\pTo\, it is placed on the left for positive values of \verb\dblDistance\. For negative values, it is positioned on the right. For the meaning of the other parameters see the function \verb\MeasureLine\.
+
+
+
+\begin{verbatim}
+guide MakeFreehand(pair pFrom, pair pTo,
+ real dblRelDivisionLength = 12.5,
+ real dblRelDistortion = 2.5,
+ bool bIncludeTo = true)
+\end{verbatim}
+%
+To draw a line between two points, which is not straight, but more like a freehand line, use this function. The pairs \verb\pFrom\ and \verb\pTo\ denote start and end point, respectively. \verb\dblRelDivisionLength\ is the length of the parts, the line is subdivided into. \verb\dblRelDistortion\ is the amount of distortion. Both sizes are given relative to the width of a freehand line. If \verb\bIncludeTo\ is \verb\true\, the point \verb\pTo\ is added to the path. Otherwise it is not. This may be useful for converting a guide containing more than two points to a freehand line.
+
+
+
+\section{Example}
+
+\begin{figure}
+\includegraphics{CAD1}
+\caption{Example showing the measurement capabilities and a small freehand line.\label{fig:example1}}
+\end{figure}
+
+To produce figure \ref{fig:example1}, use this code:
+\begin{quote}
+\begin{verbatim}
+import CAD;
+
+sCAD cad = sCAD.Create();
+
+// Freehand line
+draw(g = cad.MakeFreehand(pFrom = (3, -1)*cm, (6, -1)*cm),
+ p = cad.pFreehand);
+
+// Standard measurement lines
+draw(g = box((0, 0)*cm, (1, 1)*cm), p = cad.pVisibleEdge);
+cad.MeasureParallel(L = "$\sqrt{2}$",
+ pFrom = (0, 1)*cm,
+ pTo = (1, 0)*cm,
+ dblDistance = -15mm);
+
+// Label inside, shifted to the right; arrows outside
+draw(g = box((2, 0)*cm, (3, 1)*cm), p = cad.pVisibleEdge);
+cad.MeasureParallel(L = "1",
+ pFrom = (2, 1)*cm,
+ pTo = (3, 1)*cm,
+ dblDistance = 5mm,
+ dblLeft = 5mm,
+ dblRelPosition = 0.75);
+
+// Label and arrows outside
+draw(g = box((5, 0)*cm, (5.5, 1)*cm), p = cad.pVisibleEdge);
+cad.MeasureParallel(L = "0.5",
+ pFrom = (5, 1)*cm,
+ pTo = (5.5, 1)*cm,
+ dblDistance = 5mm,
+ dblLeft = 10mm,
+ dblRelPosition = -1);
+
+// Small bounds, asymmetric measurement line
+draw(g = box((7, 0)*cm, (7.5, 1)*cm), p = cad.pVisibleEdge);
+cad.MeasureParallel(L = "0.5",
+ pFrom = (7, 1)*cm,
+ pTo = (7.5, 1)*cm,
+ dblDistance = 5mm,
+ dblLeft = 2*cad.GetMeasurementBoundSize(
+ bSmallBound = true),
+ dblRight = 10mm,
+ dblRelPosition = 2,
+ bSmallBound = true);
+\end{verbatim}
+\end{quote}
+
+\end{document}
diff --git a/Build/source/utils/asymptote/doc/CAD1.asy b/Build/source/utils/asymptote/doc/CAD1.asy
new file mode 100644
index 00000000000..26184aaad2c
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/CAD1.asy
@@ -0,0 +1,43 @@
+import CAD;
+
+sCAD cad=sCAD.Create();
+
+// Freehand line
+draw(g=cad.MakeFreehand(pFrom=(3,-1)*cm,(6,-1)*cm),
+ p=cad.pFreehand);
+
+// Standard measurement lines
+draw(g=box((0,0)*cm,(1,1)*cm),p=cad.pVisibleEdge);
+cad.MeasureParallel(L="$\sqrt{2}$",
+ pFrom=(0,1)*cm,
+ pTo=(1,0)*cm,
+ dblDistance=-15mm);
+
+// Label inside,shifted to the right; arrows outside
+draw(g=box((2,0)*cm,(3,1)*cm),p=cad.pVisibleEdge);
+cad.MeasureParallel(L="1",
+ pFrom=(2,1)*cm,
+ pTo=(3,1)*cm,
+ dblDistance=5mm,
+ dblLeft=5mm,
+ dblRelPosition=0.75);
+
+// Label and arrows outside
+draw(g=box((5,0)*cm,(5.5,1)*cm),p=cad.pVisibleEdge);
+cad.MeasureParallel(L="0.5",
+ pFrom=(5,1)*cm,
+ pTo=(5.5,1)*cm,
+ dblDistance=5mm,
+ dblLeft=10mm,
+ dblRelPosition=-1);
+
+// Small bounds,asymmetric measurement line
+draw(g=box((7,0)*cm,(7.5,1)*cm),p=cad.pVisibleEdge);
+cad.MeasureParallel(L="0.5",
+ pFrom=(7,1)*cm,
+ pTo=(7.5,1)*cm,
+ dblDistance=5mm,
+ dblLeft=2*cad.GetMeasurementBoundSize(bSmallBound=true),
+ dblRight=10mm,
+ dblRelPosition=2,
+ bSmallBound=true);
diff --git a/Build/source/utils/asymptote/doc/CDlabel.asy b/Build/source/utils/asymptote/doc/CDlabel.asy
new file mode 100644
index 00000000000..70c8e50a404
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/CDlabel.asy
@@ -0,0 +1,16 @@
+size(11.7cm,11.7cm);
+
+asy(nativeformat(),"logo");
+
+fill(unitcircle^^(scale(2/11.7)*unitcircle),
+ evenodd+rgb(124/255,205/255,124/255));
+label(scale(1.1)*minipage(
+ "\centering\scriptsize \textbf{\LARGE {\tt Asymptote}\\
+\smallskip
+\small The Vector Graphics Language}\\
+\smallskip
+\textsc{Andy Hammerlindl, John Bowman, and Tom Prince}
+https://asymptote.sourceforge.io\\
+",8cm),(0,0.6));
+label(graphic("logo","height=7cm"),(0,-0.22));
+clip(unitcircle^^(scale(2/11.7)*unitcircle),evenodd);
diff --git a/Build/source/utils/asymptote/doc/FAQ/Makefile b/Build/source/utils/asymptote/doc/FAQ/Makefile
new file mode 100644
index 00000000000..07d40b0ace4
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/Makefile
@@ -0,0 +1,40 @@
+BFNNCONV = bfnnconv.pl m-ascii.pl m-html.pl m-info.pl m-lout.pl m-post.pl
+
+all: faq
+
+faq: $(BFNNCONV) asy-faq.bfnn
+ mkdir -p asy-faq.html
+ perl bfnnconv.pl asy-faq.bfnn
+ perl bfnnconv.pl asy-faq.bfnn
+
+clean: FORCE
+ -rm -f *~ core a.out *.lout *.ps *.info *.ascii *.xrefdb *.post
+ -rm -rf *.html
+
+install-all: install
+
+install: faq install-prebuilt
+ ${INSTALL} -d -m 755 $(docdir) $(docdir)/asy-faq.html
+ ${INSTALL} -p -m 644 asy-faq.ascii $(docdir)
+ ${INSTALL} -p -m 644 asy-faq.html/* $(docdir)/asy-faq.html
+
+install-prebuilt:
+ ${INSTALL} -d -m 755 $(infodir)
+ ${INSTALL} -p -m 644 asy-faq.info $(infodir)
+ -if test -z "$(DESTDIR)"; then \
+ install-info --infodir=$(infodir) asy-faq.info; \
+ fi
+
+install-info: faq install-prebuilt
+
+uninstall: uninstall-all
+
+uninstall-all:
+ -cd $(docdir)/asy-faq.html && rm -rf *.html
+ -cd $(docdir) && rmdir asy-faq.html && rm asy-faq.ascii
+ -install-info --remove --infodir=$(infodir) asy-faq.info
+ -rm -f $(infodir)/asy-faq.info
+
+distclean: FORCE clean
+
+FORCE:
diff --git a/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn b/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn
new file mode 100644
index 00000000000..a4dc8a0965c
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn
@@ -0,0 +1,1287 @@
+\comment This is the source for the Asymptote FAQ list, in
+\comment the Bizarre Format With No Name. It is turned into Lout
+\comment input, HTML, plain ASCII and an Info document by a Perl script.
+\comment
+\comment The format and scripts come from the Linux FAQ, by
+\comment Ian Jackson.
+\set brieftitle Asymptote FAQ
+\set author <A href="https://asymptote.sourceforge.io">Asymptote</A>
+\set title Asymptote Frequently Asked Questions
+\copyto ASCII
+ ASYMPTOTE FREQUENTLY ASKED QUESTIONS
+ `%perl use POSIX; POSIX::strftime("%Y-%m-%d", gmtime($ENV{SOURCE_DATE_EPOCH} || time))`
+
+\endcopy
+\copyto INFO
+INFO-DIR-SECTION Languages
+START-INFO-DIR-ENTRY
+* asymptote FAQ: (asy-faq). Asymptote Frequently Asked Questions.
+END-INFO-DIR-ENTRY
+
+
+File: asy-faq.info, Node: Top, Next: Question 1.1, Up: (dir)
+
+ ASYMPTOTE FREQUENTLY ASKED QUESTIONS
+ `%perl use POSIX; POSIX::strftime("%Y-%m-%d", gmtime($ENV{SOURCE_DATE_EPOCH} || time))`
+
+\endcopy
+
+This is the list of Frequently Asked Questions about Asymptote (asy).
+
+\section Index
+
+\index
+
+\comment ######################################################################
+
+\section About Asymptote
+
+\question 26jun:whatisasy What is Asymptote?
+
+Asymptote is a vector graphics language designed for
+technical graphics, inspired by MetaPost but with IEEE floating-point numerics,
+native three-dimensional graphics, Grayscale/RGB/CMYK colourspaces, and a
+C++-like syntax. Unlike MetaPost, it natively supports multiple-segment paths
+(and hence regions other than simply connected ones), tiling patterns, Gouraud
+ shading, tensor patch shading, and PostScript images.
+
+\question 22jun:whereisasy How do I obtain Asymptote?
+
+Binary releases are available for Linux, MacOS X, and Microsoft Windows
+platforms, in addition to full source code, from the website
+\docref{https://asymptote.sourceforge.io/\}. Many Linux distributions
+(such as RedHat and Debian) now include an Asymptote package (check your
+distribution's documentation for further information about this).
+
+\question 28jun:beforeasking Where can I ask questions about Asymptote?
+
+If you have a question, please try to find an answer in this FAQ, in the
+extensive Asymptote documentation at
+\docref{https://asymptote.sourceforge.io/doc/\}, or search the forum:
+\docref{http://sourceforge.net/forum/forum.php?forum_id=409349\}.
+
+\question 02sep:whyasy Why was the name Asymptote chosen?
+
+Well, it isn't the perfect graphics package, but we do think it is getting there
+asymptotically...
+
+\question 02sep:whycamp In the internal Asymptote source code, what does the name \courier{camp\} refer to?
+
+That was our original tentative name for this project, which stood for
+"C's Answer to MetaPost" (the language that inspired Asymptote).
+However, we eventually decided that the name \courier{Asymptote\} better
+emphasizes the mathematical and graphical nature of this language.
+
+\comment ######################################################################
+
+\section Questions about installation and setup
+
+\question 26jun:osx Is it possible to install Asymptote on Mac OS X?
+
+It is easy to compile Asymptote directly from the source code at
+\docref{http://sourceforge.net/project/showfiles.php?group_id=120000\}
+We recommend first upgrading to the latest GNU readline library, unless you
+don't care about interactive readline support (in which case configure will
+automatically detect and disable obsolete versions of the readline library).
+Marius Schamschula also maintains a binary package for various MacOS X
+platforms
+\docref{http://www.hmug.org/pub/MacOS_X/X/Applications/Publishing/asymptote\}.
+
+\question 26jun:osxbadCPU Why do I get the error \courier{Bad CPU type in executable\} on installing Asymptote from the MAC OS binary?
+
+This means either that you have a binary distribution for another MAC
+architecture, or (according to Marius Schamschula) that you may have a missing
+library. The simplest solution is to compile Asymptote directly from the
+official source:
+\docref{http://sourceforge.net/project/showfiles.php?group_id=120000\}.
+
+\question 04nov:brokenpdftex What do I do if I get the error: \courier{Error: pdfetex (file pdftex.cfg): cannot open config file...texinfo.tex appears to be broken\}?
+
+Simply put \docref{https://asymptote.sourceforge.io/asymptote.pdf\}
+in the directory \courier{doc\} and repeat the command \courier{make all\}.
+Or, if you don't want to build a local copy of the documentation, simply
+proceed with \courier{make install-asy\}.
+
+\question 04nov:brokentexinfo What do I do if I get the error: \courier{! Undefined control sequence. l.6 @copying\}?
+
+Either upgrade your \courier{texinfo\} package or follow one of the easy work arounds in \qref brokenpdftex.
+
+\question 27jun:latexintegration Is it possible to integrate Asymptote into LaTeX?
+
+Yes, see the example latexusage.tex. Dario Teixeira has also written a detailed
+guide on the topic. You can download it from
+\docref{http://dario.dse.nl/projects/asylatex/\}.
+
+Philippe Ivaldi has contributed an Asymptote mode for Emacs users
+\docref{https://asymptote.sourceforge.io/doc/Editing-modes.html\},
+which includes a \courier{lasy-mode\} that allows one to compile and view
+the output of one \\begin{asy}...\\end{asy} section at a time.
+
+\question 02sep:pdflatex Is it possible to integrate Asymptote into latex or pdflatex?
+
+Yes, as of version 1.14, Asymptote supports latex and pdflatex (both in
+EPS/PDF and inline mode), as illustrated by the example
+\courier{latexusage.tex\}:
+
+\verbatim
+pdflatex latexusage
+asy latexusage
+pdflatex latexusage
+\endverbatim
+
+\question 02sep:tkinterdepend Do I need the \courier{tkinter\} package to install an Asymptote rpm binary?
+
+No, you don't need \courier{tkinter\} unless you want to try out the GUI \courier{xasy\}. Try
+
+\verbatim
+rpm -Uvh --nodeps asymptote-x.xx-1.i386.rpm
+\endverbatim
+
+where \courier{x.xx\} represents the version number.
+
+\question 26jun:windir What does the path \courier{%USERPROFILE%\\.asy\\config.asy\} mean?
+
+That is the way that Microsoft Windows refers to the user profile directory.
+There's nothing really to understand here, just put your configuration
+commands in the file \courier{config.asy\} in a new folder \courier{%USERPROFILE%\\.asy\}.
+
+\question 25dec:escapechar Why do I get the error "string not terminated" when I try to set \courier{settings.dir="C:\\asymptote\\";\}?
+
+The backslash is an escape character here, so
+\courier{\\"\} is interpreted as a verbatim quotation mark, leaving the string
+without a terminating quotation mark. Fortunately, this is the
+only escaped character in double-quoted strings. A final backslash isn't
+needed here anyway, but should you really want one somewhere, you can say:
+\courier{settings.dir="C:\\asymptote"+'\\\\';\}.
+
+\question 27jun:winglobal How do I change environment variables in Microsoft Windows, for example, in order to change the default PostScript viewer?
+
+While it is easier to set the corresponding Asymptote configuration
+variable in your \courier{config.asy\} file, here is the procedure for changing
+Microsoft Windows environment variables:
+
+Click on the [Start] button
+
+* RIGHT-click on 'My Computer'
+
+* Choose 'Properties' from the popup menu
+
+* Click the 'Advanced' tab
+
+* Click the 'Environment Variables' button.
+
+\question 02sep:convert Under Microsoft Windows XP, why do I get an error like "Invalid Parameter - 432x432"?
+
+This means that ImageMagick wasn't properly installed and you are using the
+MSDOS convert program rather than the ImageMagick one. Or you may have
+installed ImageMagick but ran Asymptote from an existing MSDOS window.
+In that case, simply open a new window and try again. If that doesn't work,
+check that
+
+\verbatim
+convert --version
+\endverbatim
+
+returns something like
+
+\verbatim
+Version: ImageMagick 6.2.8 06/27/06 Q16 http://www.imagemagick.org
+\endverbatim
+
+\question 26jun:miktex Why does Asymptote freeze upon trying to draw a label with my MikTex installation under Microsoft Windows?
+
+Likely, this means that latex and dvips are not in your default path.
+Try adding the appropriate paths in your \courier{config.asy\} file,
+for example:
+
+\verbatim
+import settings;
+latex="C:\Program Files\MiKTeX 2.7\miktex\bin\latex.exe";
+dvips="C:\Program Files\MiKTeX 2.7\miktex\bin\dvips.exe";
+\endverbatim
+
+\comment #####################################################################
+
+\section Questions about paths
+
+\question 02sep:tensionsyntax Why do I get a syntax error message when I specify an integer value for the path tension?
+
+What is happening here is that
+
+\verbatim
+draw((0,0)..tension 2..(0,50)..(100,100));
+\endverbatim
+
+is read as
+
+\verbatim
+draw((0,0)..tension 2. .(0,50)..(100,100));
+\endverbatim
+
+So the first . after the two is treated as a decimal point.
+Just put a space after the integer tension value:
+
+\verbatim
+draw((0,0)..tension 2 ..(0,50)..(100,100));
+\endverbatim
+
+\question 27jun:dots Shouldn't dots always be the same size?
+
+From the documentation:
+
+"The dot command defined in the module plain draws a dot having a diameter
+equal to an explicit pen linewidth or the default linewidth magnified by
+dotfactor (6 by default)."
+
+Thus, when you use the default pen, the dot will have size 6*linewidth,
+but when you give a pen with an explicit width specified, you will
+have a dot of size linewidth. If you want the first case to behave like the
+second, you may set dotfactor=1.
+
+\comment #####################################################################
+
+\section Questions about labels
+
+\question 02sep:greek How do I get Greek letters like omega to show up in my labels?
+
+In (La)TeX, Greek letters can be obtained in math mode by prepending a
+backslash to the letter name. So for a omega symbol, use "$\\omega$". Everything
+between the dollar signs is considered to be a math formula. Uppercase Greek
+letters can be used by capitalizing the first letter of the name:
+
+\verbatim
+label("$\omega$",(0,0));
+label("$\Omega$",(20,0));
+\endverbatim
+
+\question 29jun:matlabels Can Asymptote use matrices as labels?
+
+Yes:
+\verbatim
+usepackage("amsmath");
+label("$\begin{matrix} 1 & 2 \\\ 1 & 1 \end{matrix}$",(0,0));
+\endverbatim
+
+\question 27jun:latexpackage How do I tell Asymptote to load a particular LaTeX package, like \courier{mathptmx\}?
+
+Put
+
+\verbatim
+usepackage("mathptmx");
+\endverbatim
+
+at the beginning of your file. Note: to enable the Adobe Times Roman font
+for text, you will also need to say:
+\verbatim
+defaultpen(TimesRoman());
+\endverbatim
+
+
+\question 28jun:internatfonts How can I use international fonts in Asymptote labels?
+
+See \docref{https://asymptote.sourceforge.io/doc/Pens.html\}.
+
+\question 10jul:Fourier How can I use Fourier fonts?
+
+\verbatim
+usepackage("fourier");
+defaultpen(font("T1","fut\textfamilyextension","m","n"));
+\endverbatim
+
+\question 26jun:decsep Is there any way to change the default appearance of the decimal separator, using a comma instead of a dot?
+
+Just set your locale appropriately:
+
+\verbatim
+locale("it_IT");
+usepackage("icomma");
+label(format(0.5));
+\endverbatim
+
+\question 02sep:rotatelabel How can I get a rotated label with the filled box rotated as well so that it fits the text?
+
+\verbatim
+frame f;
+label(f,"This is some text",white,Fill(blue));
+add(rotate(65)*f);
+\endverbatim
+
+
+\question 02sep:rotatelabel3D How can I rotate labels in a 3D figure?
+
+You need to first project the triple to a pair like this:
+
+\verbatim
+import three;
+size(100,100);
+
+draw(rotate(90,project(Z))*"A",O--X);
+\endverbatim
+
+\question 02sep:fixedsize How can I draw some squares and circles of a fixed size and put a label in the middle of them?
+
+Fixed-size objects should be drawn on a separate picture and then added to
+currentpicture. Here is one way (see also \docref{https://asymptote.sourceforge.io/gallery/subpictures.asy\} and \docref{https://asymptote.sourceforge.io/gallery/mosquito.asy\}):
+
+\verbatim
+real u=2cm;
+
+picture square;
+draw(square,scale(u)*shift(-0.5,-0.5)*unitsquare);
+
+picture circle;
+draw(circle,scale(0.5u)*unitcircle);
+
+void add(picture pic=currentpicture, Label L, picture object, pair z) {
+add(pic,object,z);
+label(pic,L,z);
+}
+
+add("square",square,(0,0));
+add("circle",circle,(5cm,0));
+\endverbatim
+
+\question 27jun:colorssaturation The binary operator * can be used to scale the color of a pen by a real number. Does this scaling factor have to be less than 1?
+
+The scaling factor can be greater than 1. But keep in mind that the rgb color
+components saturate at 1.
+
+Try
+\verbatim
+write(cyan); write(0.8*cyan); write(1.5*cyan);
+\endverbatim
+and you will quickly see what is going on.
+
+To get a lighter cyan you can say white+cyan,
+which yields rgb(0.5,1,1). If you want something even lighter specify the
+rgb colors directly,
+for example, rgb(0.9,1,1).
+
+Alternatively, work in cmyk colour space, which is nicer in that it handles
+saturation separately from hue:
+
+0.1*Cyan is light and 0.9*Cyan is dark.
+You can also say 0.1*cmyk(red).
+
+\question 05mar:commadecimalseparator Why is the space after the comma decimal separator in my locale so large?
+
+LaTeX is treating the comma as punctuation and not as a decimal separator.
+The solution is to load the \courier{icomma\} package near the beginning of your file:
+\verbatim
+usepackage("icomma");
+\endverbatim
+
+\question 11mar:hyperref How can I prevent \courier{texpreamble("\\usepackage[pdftex]{hyperref}")\} from changing the page size?
+
+\verbatim
+texpreamble("\usepackage[pdftex,setpagesize=false]{hyperref}");
+\endverbatim
+
+\comment #####################################################################
+
+\section Questions about arrows
+
+\question 02sep:doublearrows How do I draw two arrows at arbitrary positions along a path?
+
+Assuming that at least one of the arrowheads is to be filled, you can do this:
+
+\verbatim
+size(200);
+path g = (0,0)..(1,3)..(3,0);
+draw(g,Arrow(Relative(0.9)));
+add(arrow(g,invisible,FillDraw(black),Relative(0.5)));
+add(arrow(reverse(g),invisible,FillDraw(white,black),Relative(0.9)));
+\endverbatim
+
+If both of the arrowheads are to be drawn with filltype NoFill,
+one will need to create a specialized version of the arrow routine in
+\courier{plain_arrows.asy\}:
+
+\verbatim
+void arrow(frame f, arrowhead arrowhead=DefaultHead,
+ path g, pen p=currentpen, real size=0,
+ real angle=arrowangle, filltype filltype=arrowhead.defaultfilltype,
+ position position=EndPoint, bool forwards=true,
+ margin margin=NoMargin, bool center=false);
+\endverbatim
+
+\question 02sep:reversearrow How do I reverse the direction of an arrowhead?
+
+Simply reverse the direction of the path.
+
+\verbatim
+path g=((0,0)--(5cm,0));
+draw(reverse(g),Arrow(Relative(0.55)));
+\endverbatim
+
+\question 02sep:reversearrow How do I change the size of all arrows?
+
+To override the arrowsize you can give every Arrow drawing attribute a real
+size argument. If you want to do this globally, you can override the
+pen-dependent arrowsize function like this:
+
+\verbatim
+DefaultHead.size=new real(pen p=currentpen) {return 2mm;};
+\endverbatim
+
+\question 26jun:arrowhead Can I create other arrowhead styles?
+
+Yes, you can build custom arrowheads like this (see the predefined
+arrowhead styles in \courier{plain_arrows.asy\} for further examples):
+
+\verbatim
+arrowhead DotHead;
+DotHead.head=new path(path g, position position=EndPoint, pen p=currentpen,
+ real size=0, real angle=arrowangle) {
+ if(size == 0) size=DotHead.size(p);
+ bool relative=position.relative;
+ real position=position.position.x;
+ if(relative) position=reltime(g,position);
+ path r=subpath(g,position,0);
+ pair x=point(r,0);
+ real t=arctime(r,size);
+ pair y=point(r,t);
+ return circle(0.5(x+y),0.5size);
+};
+
+size(100);
+draw((0,0)..(1,1)..(2,0),Arrow(DotHead));
+dot((2,0),red);
+\endverbatim
+
+If you submit your alternate arrowheads to the Forum or the Patch
+Tracking System, we'll consider including them in a future release.
+
+\comment #####################################################################
+
+\section Questions about 2D graphs
+
+\question 02sep:axisticks How can I draw x axis ticks on the right side, with the tick labels on the left side (relative to the axis path)?
+
+\verbatim
+import graph;
+
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+xaxis("$x$",RightTicks(Label(align=left)));
+yaxis("$y$",RightTicks);
+\endverbatim
+
+\question 02sep:axislabel How can I reposition the x axis label to three-quarters along the axis length?
+
+\verbatim
+import graph;
+
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+xaxis(Label("$x$",0.75),LeftTicks);
+yaxis("$y$",RightTicks);
+\endverbatim
+
+\question 02sep:axislabeldown How can I move the x axis label down 10bp?
+
+\verbatim
+import graph;
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+xaxis(shift(0,-10)*"$x$",LeftTicks);
+yaxis("$y$",RightTicks);
+\endverbatim
+
+\question 02sep:threeaxispens Can I use different pens for the axis, the axis label, and the tick labels?
+
+Yes:
+
+\verbatim
+import graph;
+size(300,200,IgnoreAspect);
+
+xlimits(-50,50);
+ylimits(0,100);
+
+xaxis(Label("$x$",MidPoint,red),Bottom,blue,LeftTicks(green));
+yaxis("$y$",Left,RightTicks);
+\endverbatim
+
+\question 02sep:axislabelfont How can I change the font type of the axes label?
+
+\verbatim
+import graph;
+size(300,200,IgnoreAspect);
+
+xlimits(-50,50);
+ylimits(0,100);
+
+xaxis("x",Bottom,Courier("m","n"),LeftTicks);
+yaxis("$y$",Left,RightTicks);
+\endverbatim
+
+\question 02sep:axisticklabelfont How can I change the font type of the tick labels on an axis?
+
+Tick labels are by default typeset in (TeX) math mode, so to use other
+fonts you need to override the default tick format:
+
+\verbatim
+import graph;
+size(300,200,IgnoreAspect);
+
+xlimits(-50,50);
+ylimits(0,100);
+
+xaxis("$x$",Bottom,LeftTicks("%.4g",Courier("m","n")+fontsize(12)));
+yaxis("$y$",Left,RightTicks);
+\endverbatim
+
+\question 26jun:overlappingticklabels How can I prevent axes tick labels from rendering on top of each other?
+
+Either:
+
+(i) give LeftTicks/RightTicks/Ticks the arguments beginlabel=false
+and/or endlabel=false;
+
+(ii) explicitly remove specific ticks and their labels (drawing them manually;
+see \docref{http://www.github.com/vectorgraphics/asymptote/base/graph.asy\} for the definition of NoZero):
+
+\verbatim
+import graph;
+
+size(10cm);
+
+real f(real x) {return x^2;}
+
+draw(graph(f,-2,2));
+
+xaxis(Ticks(NoZero));
+yaxis(Ticks(NoZero));
+
+label("$0$",(0,0),SW);
+\endverbatim
+
+(iii) explicitly remove specific tick labels and draw them manually
+(see \docref{http://www.github.com/vectorgraphics/asymptote/base/graph.asy\} for the definition of NoZeroFormat):
+
+\verbatim
+import graph;
+
+size(10cm);
+
+real f(real x) {return x^2;}
+
+draw(graph(f,-2,2));
+
+xaxis(Ticks(NoZeroFormat));
+yaxis(Ticks(NoZeroFormat));
+
+label("$0$",(0,0),SW);
+\endverbatim
+
+(iv) use the xasy GUI to move overlapping labels;
+
+(v) change the Label argument of LeftTicks, RightTicks, or Ticks to:
+
+\verbatim
+Label(currentpen+overwrite(Move))
+\endverbatim
+
+Solution (v) will move labels that might otherwise overwrite a previous
+label. Other possible overwrite arguments are Allow (allows overlapping
+labels; the default), Suppress (an overlapping label will not be written at
+all), SuppressQuiet, and MoveQuiet. The last two achieve the same result as
+the non-quiet types, but will not notify you which labels are overlapping. See:
+\docref{https://asymptote.sourceforge.io/doc/Pens.html\}.
+
+In the case of a user-specified tick array, you can change which labels get
+suppressed/moved by changing the order of array entries.
+
+\question 04nov:fixedsizegraphs How do I make the plot region of a graph, ignoring labels and legends, have a fixed size?
+
+Either:
+
+i) Specify an explicit unitsize, which overrides any call to \courier{size\}:
+\verbatim
+unitsize(x=1cm,y=2cm);
+\endverbatim
+
+ii) Explicitly tell Asymptote to map the plot region to a specific size:
+\verbatim
+import graph;
+real[] x={0,1,2,3};
+real[] y=x^2;
+draw(graph(x,y),red);
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+
+size(5cm,5cm,point(SW),point(NE));
+
+label("$f_\mathrm{T}$",point(N),2N);
+\endverbatim
+
+iii) Specify the points in user coordinates that should correspond to a
+given picture size:
+
+\verbatim
+import graph;
+
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+
+fixedscaling((-1.5,-0.5),(1.5,3.5));
+\endverbatim
+
+In this example, the user coordinate \courier{(-1.5,-0.5)\} will end up
+being the lower left corner of the figure and \courier{(1.5,3.5)\} will be
+the upper right corner. You can use this option to ensure multiple figures
+have the same scaling and same resulting figure size (just ensure the two
+coordinates given to \courier{fixedscaling()\} leaves room for any labels).
+
+See also
+\docref{https://asymptote.sourceforge.io/doc/Frames-and-pictures.html\}.
+
+\question 26jun:graphlimits How can I plot a function f(x) within [0,1]x[0,2] without explicitly calculating the x values for which f(x) hits the boundary?
+
+Call \courier{limits\} with the \courier{Crop\} option before drawing the graph:
+\verbatim
+import graph;
+
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+limits((0,0),(1,2),Crop);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+\endverbatim
+
+See also \docref{https://asymptote.sourceforge.io/doc/graph.html\}.
+
+\question 26jun:custompalettes Is it possible to define customized palettes?
+
+Yes, you may generate your own pen[] array. For example:
+
+\verbatim
+int NColors=32768;
+pen[] MyPalette=new pen[NColors];
+real step=1/(NColors-1.0);
+// Start at black: rgb(0,0,0)
+// End at yellow: rgb(1,1,0)
+for(int i=0; i < NColors; ++i) {
+ real rgval=i*step;
+ MyPalette[i]=rgb(rgval,rgval,0.0);
+}
+\endverbatim
+
+\question 26jun:factorial Is there an easy way to graph factorial functions nicely?
+
+The example below shows a continuous function and two methods for placing
+markers at integer values of x:
+
+\verbatim
+import graph;
+
+size(200,200,IgnoreAspect);
+
+real factorial(real t) {return gamma(t+1);}
+
+scale(Linear,Log);
+
+// Graph the factorial function.
+draw(graph(factorial,0,10));
+
+// Method 1: Draw nodes, but hide line
+pair F(int t) {return (t,factorial(t));}
+// Graph of factorial function from 0 to 10
+pair[] z=sequence(F,11);
+draw(graph(z),invisible,marker(scale(0.8mm)*unitcircle,blue,Fill));
+
+// Method 2: Nongraphing routines require explicit scaling:
+pair dotloc(int t) {return Scale(F(t));}
+pair[] dotlocs=sequence(dotloc,11);
+dot(dotlocs);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+\endverbatim
+
+\question 26jun:length How do I indicate that a certain length should be exactly the size I prescribe with no rescaling, within a picture which has its own size?
+
+Here's an easy way to do this.
+
+\verbatim
+size(12cm,0);
+
+void distance(picture pic=currentpicture, pair A, pair B, Label L="", real n=0,
+ pen p=currentpen)
+{
+ real d=3mm;
+ path g=A--B;
+ transform T=shift(-n*d*unit(B-A)*I);
+ pic.add(new void(frame f, transform t) {
+ picture opic;
+ path G=T*t*g;
+ draw(opic,Label(L,Center,UnFill(1)),G,p,Arrows(NoFill),Bars,PenMargins);
+ add(f,opic.fit());
+ });
+ pic.addBox(min(g),max(g),T*min(p),T*max(p));
+}
+
+pair A=(0,0), B=(3,3);
+
+dot(A);
+dot(B);
+
+distance(A,B,"$\ell$",1);
+\endverbatim
+
+\question 26jun:log2 How can I make the y axis display base-2 logarithmic values?
+
+See the example \docref{https://asymptote.sourceforge.io/gallery/2D graphs/log2graph.asy\}.
+
+\question 27jun:align How can I align the x axes of two graphs on the same figure?
+
+An easy way to do this, if the axes to be aligned have the same scaling
+and size, is illustrated in the example \docref{https://asymptote.sourceforge.io/gallery/2D graphs/alignedaxis.asy\}.
+
+Here is a more general solution to the problem of aligning two arbitrary axes.
+One fits the second picture to a frame based on the horizontal scaling for
+the first picture:
+
+\verbatim
+import graph;
+
+real width=15cm;
+real aspect=0.3;
+
+picture pic1,pic2;
+
+size(pic1,width,aspect*width,IgnoreAspect);
+size(pic2,width,aspect*width,IgnoreAspect);
+
+scale(pic1,false);
+scale(pic2,false);
+
+real xmin1=6;
+real xmax1=9;
+real xmin2=8;
+real xmax2=16;
+
+real a1=1;
+real a2=0.001;
+
+real f1(real x) {return a1*sin(x/2*pi);}
+real f2(real x) {return a2*sin(x/4*pi);}
+
+draw(pic1,graph(pic1,f1,xmin1,xmax1));
+draw(pic2,graph(pic2,f2,xmin2,xmax2));
+
+xaxis(pic1,Bottom,LeftTicks());
+yaxis(pic1,"$f_1(x)$",Left,RightTicks);
+
+xaxis(pic2,"$x$",Bottom,LeftTicks(Step=4));
+yaxis(pic2,"$f_2(x)$",Left,RightTicks);
+
+yequals(pic1,0,Dotted);
+yequals(pic2,0,Dotted);
+
+pair min1=point(pic1,SW);
+pair max1=point(pic1,NE);
+
+pair min2=point(pic2,SW);
+pair max2=point(pic2,NE);
+
+real scale=(max1.x-min1.x)/(max2.x-min2.x);
+real shift=min1.x/scale-min2.x;
+
+transform t1=pic1.calculateTransform();
+transform t2=pic2.calculateTransform();
+transform T=xscale(scale*t1.xx)*yscale(t2.yy);
+
+add(pic1.fit());
+real height=truepoint(N,user=false).y-truepoint(S,user=false).y;
+add(shift(0,-height)*(shift(shift)*pic2).fit(T));
+\endverbatim
+
+\question 27jun:changeaxis How can I change the direction of the y-axis, such that negatives values are on the upper y-axis?
+
+Here is a simple example (see also the example \docref{https://asymptote.sourceforge.io/gallery/2D graphs/diatom.asy\} or the discussion
+of Linear(-1) in the documentation):
+
+\verbatim
+import graph;
+size(250,200,IgnoreAspect);
+
+scale(Linear,Linear(-1));
+
+draw(graph(log,0.1,10),red);
+
+xaxis("$x$",LeftTicks);
+yaxis("$y$",RightTicks);
+\endverbatim
+
+\question 27jun:functioncolor How can I fill a path with a function that defines the color of each location?
+
+Use \courier{functionshade\} with a PDF tex engine, as illustrated
+by the example {functionshading.asy}.
+
+If you want to produce PostScript output, an approximate solution for now
+would be to superimpose a fine grid and specify colors to
+\courier{latticeshade\} that depend on position as a single pen[][]
+lattice. Alternatively, it may be more efficient to use \courier{tensorshade}.
+
+\question 27jun:nonexplicitfun Is there a way to draw a function that is not explicitly given, such as (y - 2)^2 = x - 1 ?
+
+Yes, use the parametric form
+
+\verbatim
+y=t
+x=(t-2)^2+1
+\endverbatim
+
+See the example \docref{https://asymptote.sourceforge.io/gallery/2D graphs/parametricgraph.asy\}.
+
+\question 27jun:scalesecondaryaxis Is it possible to reverse or stretch an axis?
+
+The real scaling argument to Linear is used to stretch (or reverse) the axis.
+To see the effect of axis stretching, be sure not to specify IgnoreAspect in
+the picture size command.
+
+A secondary axis has the same length as the primary axis, so stretching cannot
+have any effect. But one can still reverse the axis, with Linear(-1).
+
+\question 02sep:emptymarkers Why can't I use the UnFill option to draw graphs with empty markers?
+
+UnFill won't work here because it only affects the local frame the markers
+are initially drawn on, before being added to currentpicture.
+Here is a way of achieving the desired effect (assuming a white background):
+
+\verbatim
+import graph;
+size(10cm,0);
+pair[] z={(0,0),(0.5,0.5),(1,1)};
+path g=graph(z);
+
+draw(shift(0,.5)*g,marker(scale(5)*unitcircle,FillDraw(white)));
+
+xaxis(BottomTop,LeftTicks);
+yaxis(LeftRight,RightTicks);
+\endverbatim
+
+\question 02sep:paletterange How can I force several images to use the same palette range (e.g. the entire 0-255 grayscale range)?
+
+The palette color space corresponds to a range of values specified by the
+argument range, which can be \courier{Full\}, \courier{Automatic\} or an
+explicit range \courier{Range(pair min, pair max)\}. Here \courier{Full}
+specifies a range varying from the minimum to maximum values of the
+function over the sampling interval, while \courier{Automatic\} selects
+"nice" limits.
+
+\comment #####################################################################
+
+\section Questions about programming
+
+\question 27jun:comporint Is Asymptote an interpreter or a compiler?
+
+Asymptote compiles Asymptote commands into its own virtual machine code. It
+then runs this pseudocode on a virtual machine to produce PostScript code.
+
+\question 05sep:framepicture What is the difference between a frame and a picture?
+
+Frames are canvases for drawing in PostScript coordinates. While working
+with frames directly is occasionally necessary for constructing deferred
+drawing routines, pictures are usually more convenient to work with.
+See \qref unitsizes.
+
+\question 05sep:pathguide What is the difference between a path and a guide?
+
+A path is a cubic spline with fixed endpoint conditions.
+
+A guide is an unresolved cubic spline (list of cubic-spline nodes and
+control points). A guide is like a path except that the computation of the cubic
+spline is deferred until drawing time (when it is resolved into a path);
+this allows two guides with free endpoint conditions to be joined together
+smoothly.
+
+\question 27jun:picarray What is a convenient way to declare and initialize an array of pictures?
+
+You could write yourself a routine such as:
+\verbatim
+picture[] picture(int n) {
+ picture[] pic;
+ for(int i=0; i < n; ++i) {
+ pic[i]=new picture;
+ size(pic[i],19cm,0);
+ }
+ return pic;
+}
+
+picture[] pic=picture(6);
+\endverbatim
+
+\question 27jun:genarrays Is there a way to define functions that act on arrays in general (i.e. work for arrays of any type)?
+
+Generic types aren't yet implemented.
+
+But for now you can at least say
+\verbatim
+typedef string T;
+include F;
+
+typedef real T;
+include F;
+\endverbatim
+
+where \courier{F.asy\} contains some type-dependent code like
+\verbatim
+T[] operator $(T A, T B) {return new T[] {A,B};}
+\endverbatim
+
+\question 27jun:cirdep Is there any way to declare structures ahead of their definition, e.g. where struct A performs some operation on struct B, but B contains an A member?
+
+Asymptote does not support forward declaration of types. You can, however,
+nest structures, so that both types are visible for parts of the bodies of
+both structure definitions. For example:
+
+\verbatim
+struct B {
+ typedef void someroutine(B b);
+
+ static struct A {
+ someroutine routine;
+ void operator init(someroutine routine) {
+ this.routine=routine;
+ }
+ }
+
+ string test="Testing";
+}
+
+typedef B.A A;
+
+A a=B.A(new void(B b){write(b.test);});
+
+B b;
+a.routine(b);
+\endverbatim
+
+\question 04nov:static Where are static variables in for loops allocated?
+
+In the example
+
+\verbatim
+void f() {
+ for(int i=0; i < 3; ++i) {
+ static int n;
+ ++n;
+ write(n);
+ }
+}
+
+f(); // Writes 1, 2, 3
+\endverbatim
+
+the static qualifier means that \courier{n\} is allocated not just outside
+of the for loop, but also outside the function. This is clear if you call
+\courier{f\} multiple times; there is still only one instance of \courier{n\}.
+
+The "level" of a variable (where it is allocated) has nothing to do with
+the "scope" of a variable (how long it can be referred to by name).
+The curly braces enclosing a block affect only a variable's scope, not
+its level.
+
+Static modifiers are meaningless at the top level; they generate a warning
+and are simply ignored:
+
+\verbatim
+for(int i=0; i < 3; ++i) {
+ static int n;
+ ++n;
+ write(n);
+}
+// Writes warning about top-level static modifier and then 1, 1, 1
+\endverbatim
+
+Since version 1.22, non-static variables allocated in a loop body are allocated
+anew every iteration. This is only noticable in obscure cases where a variable
+in a loop is accessed in the closure of a function defined in the loop:
+
+\verbatim
+int f();
+
+for(int i=0; i < 10; ++i) {
+ int j=10*i;
+ if(i == 5)
+ f=new int() {return j;};
+}
+
+write(f()); // Writes 50
+\endverbatim
+
+Variables in the body of a loop last as long as that iteration of the loop,
+unless they are kept alive by a function closure as in the example above. In a
+function body, variables will last at least as long as the function call, though
+because of closures and garbage collection, they may last longer than that. If
+defined at the top level of a file or at the interactive prompt, they will last
+at least until the end of the file or prompt's run.
+
+\question 26jun:debug Is there a debugger for asy?
+
+Yes, Asymptote includes a line-based debugger:
+
+\docref{https://asymptote.sourceforge.io/doc/Debugger.html\}
+
+\question 27jun:patches Do you accept patches for Asymptote?
+
+Yes, in fact we would prefer that users submit patches for customized features
+(to \docref{http://sourceforge.net/tracker/?atid=685685&group_id=120000\})
+instead of relying on us to do all of the coding. Development will proceed
+faster that way.
+
+\comment #####################################################################
+
+\section Questions about differences between Asymptote and MetaPost
+
+\question 29jun:interp What is the equivalent of the MetaPost c[a,b] interpolation operator?
+
+\verbatim
+interp(a,b,c);
+\endverbatim
+
+\question 02sep:automaticscaling How does picture scaling differ in Asymptote and MetaPost?
+
+Asymptote includes an optional facility to do automatic scaling of pictures
+to achieve a given overall picture size, whereas Metapost only supports manual
+scaling. Asymptote defers drawing of objects drawn to pictures and
+distinguishes between true-size objects and objects that should scale with
+the picture size. The resulting linear programming problem is solved via
+the Simplex method.
+
+See the \docref{https://asymptote.sourceforge.io/gallery/dimension.asy\} example for an example of how deferred drawing is
+used to accomodate both user and true-size (PostScript) coordinates.
+
+\question 02sep:manualscaling How can I avoid automatic scaling of a picture?
+
+If you really like Metapost-style manual (hard-wired) scaling either:
+
+(i) use the default size(0,0) for the entire picture and do all of the
+scaling by hand, just like in MetaPost;
+
+(ii) draw to a separate picture pic and add(pic.fit());
+
+(iii) use frames.
+
+\question 23jun:mp3dots What is the equivalent of MetaPost ... command?
+
+The connector \courier{::\} is a macro for tension atleast 1:
+
+\verbatim
+size(100);
+pair z0=(0,0);
+pair z1=(1,0.25);
+pair z2=(2,0);
+draw(z0{up}::z1{right}::z2{down});
+\endverbatim
+
+\question 23jun:mppickup What is the equivalent of the MetaPost pickup command?
+
+Just say, for example:
+
+\verbatim
+currentpen=red;
+\endverbatim
+
+\question 29aug:whatever What is the equivalent of the MetaPost whatever command?
+
+Asymptote does not implicitly solve linear equations and therefore does not
+have the notion of a \courier{whatever\} unknown. Such a facility could
+certainly be added (perhaps using the notation \courier{?=\} since
+\courier{=\} means assignment).
+However, the most common uses of \courier{whatever\} in MetaPost are covered by
+functions like \courier{extension\} in \courier{math.asy\}:
+\verbatim
+pair extension(pair P, pair Q, pair p, pair q);
+\endverbatim
+this returns the intersection point of the extensions of the line segments
+\courier{PQ\} and \courier{pq\}. We find using routines like
+\courier{extension\} more explicit and less confusing to new users. But we
+could be persuaded to add something similar if someone can justify the
+need. In the meantime, one can always use the explicit built-in linear
+solver \courier{solve\} (see
+\docref{https://asymptote.sourceforge.io/doc/solve.html\}), which uses LU
+decomposition.
+
+\question 23jun:lray What is the equivalent for the MetaPost command for \courier{lray - horiz*v - verti*u = whatever*(LightSource - R)\}, a system of three linear equations for three unknowns: \courier{horiz, verti, whatever\}?
+
+Since \courier{horiz*v+verti*u\} spans a plane, you could use
+\verbatim
+real intersect(vector P, vector Q, vector n, vector Z);
+\endverbatim
+
+to find the intersection time for the line
+\courier{lray-whatever*(LightSource - R)\}
+and then extract the three desired values from there. (You'll still need to
+use the built-in explicit linear solver to solve a 2x2 system to get
+\courier{horiz\} and \courier{verti\}.)
+
+\question 27jun:unitsizes In MetaPost, it is possible to have a drawing remain the same size in different pictures by defining a unit \courier{u\} and explicitly multiply all the coordinates by \courier{u\}. Is there a better way to do this in Asymptote?
+
+Yes, Asymptote has a better way: you definitely don't want to manually scale
+all of your coordinates. To make the user coordinates represent multiples
+of exactly \courier{1cm\}:
+
+\verbatim
+unitsize(1cm);
+draw(unitsquare);
+\endverbatim
+
+One can also specify different x and y unit sizes:
+
+\verbatim
+unitsize(x=1cm,y=2cm);
+draw(unitsquare);
+\endverbatim
+
+Another way is to draw your fixed size object to a frame and add it to
+currentpicture like this:
+
+\verbatim
+path p=(0,0)--(1,0);
+frame object;
+draw(object,scale(100)*p);
+
+add(object);
+add(object,(0,-10));
+\endverbatim
+
+To understand the difference between frames and pictures, try this:
+
+\verbatim
+size(300,300);
+
+path p=(0,0)--(1,0);
+picture object;
+draw(object,scale(100)*p);
+
+add(object);
+add(object,(0,-10)); // Adds truesize object to currentpicture
+\endverbatim
+
+\question 28jun:tiles In MetaPost, one could produce tiling pictures by generating a picture, and then clipping the picture to a rectangle of fixed dimensions around the center of the picture. How is that done in Asymptote?
+
+If you are using currentpicture the way one would in MetaPost (drawing in
+raw PostScript coordinates), you can simply do something like:
+
+\verbatim
+fill((0,0)--(100,100)--(200,0)--cycle);
+
+pair center(picture pic=currentpicture) {return 0.5*(pic.min()+pic.max());}
+
+real height=100;
+real width=100;
+pair delta=0.5(width,height);
+pair c=center();
+clip(box(c-delta,c+delta));
+\endverbatim
+
+However, drawing in PostScript coordinates is often inconvenient. Here's the
+Asymptote way of doing the same thing, using deferred drawing:
+
+\verbatim
+size(200,100);
+fill((0,0)--(1,1)--(2,0)--cycle);
+
+void clip(picture pic=currentpicture, real width, real height)
+{
+ pic.clip(new void (frame f, transform) {
+ pair center=0.5(min(f)+max(f));
+ pair delta=0.5(width,height);
+ clip(f,box(center-delta,center+delta));
+ });
+}
+
+clip(100,100);
+\endverbatim
+
+See also the discussion of tilings in the documentation:
+\docref{https://asymptote.sourceforge.io/doc/Pens.html\}.
+
+\comment ######################################################################
+
+\section Questions about output
+
+\question 27jun:psviewer How can I disable automatic invocation of the PS viewer after an asy file is done processing?
+
+It's actually not on by default, unless you happen to be using Microsoft
+Windows (because that is what most Microsoft Windows users
+expect). Microsoft Windows users can turn this feature off with the
+command-line option -noV or by putting
+
+\verbatim
+import settings;
+interactiveView=false;
+batchView=false;
+\endverbatim
+
+in their \courier{config.asy\} file. See
+\docref{https://asymptote.sourceforge.io/doc/Options.html\}.
+
+\question 26jun:jpeg How do I output jpeg images?
+
+If you have the ImageMagick convert program installed, simply type
+
+\verbatim
+asy -f jpg test.asy
+\endverbatim
+
+\question 27jun:embedbitmaps Can I embed bitmaps (photos) into my drawings and position and scale them?
+
+Convert them to eps format and use the graphic(string) function just like a
+Label:
+
+\verbatim
+label(graphic("file"),(0,0));
+\endverbatim
+
+See the example \docref{https://asymptote.sourceforge.io/gallery/orthocenter.asy\} and
+\docref{https://asymptote.sourceforge.io/doc/label.html\}.
+
+\question 28jun:directpdf Does Asymptote support direct PDF output?
+
+Yes, PDF output can be produced by the -f pdf option or -tex pdflatex option.
+This supports transparency, annotations, embedded movies, and U3D/PRC content.
+
+\question 28jun:bigpictures How to I produce large pictures of high quality in raster format (e.g. png, giff etc).
+
+Try using some of the options to convert, mainly -geometry and -density. For example:
+\verbatim
+convert -geometry 1000x3000 example.eps example.png
+\endverbatim
+
+You can also change the default resolution of the image with:
+\verbatim
+convert -geometry 1000x3000 -density 300 -units PixelsPerInch example.eps example.png
+\endverbatim
+This does not change the number of pixels in the image, but just gives a hint
+as to how large each pixel should be displayed.
+
+If you include the -density option without the -geometry option, convert will
+keep the image size constant (so a 4cm x 3cm eps figure will generate a 4cm x
+3cm png
+image).
+
+\question 28jun:multipage Is it possible to produce multi-page documents with asymptote?
+
+Yes, simply call the newpage() function. This is used by the
+\courier{slide.asy\} package to produce high-quality slide presentations
+(easier to use than Prosper).
+
+\comment Here it ends!
diff --git a/Build/source/utils/asymptote/doc/FAQ/asy-faq.info b/Build/source/utils/asymptote/doc/FAQ/asy-faq.info
new file mode 100644
index 00000000000..dc69d1917e7
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/asy-faq.info
@@ -0,0 +1,1671 @@
+Info file: asy-faq.info, -*-Text-*-
+produced by bfnnconv.pl from the Bizarre Format With No Name.
+
+INFO-DIR-SECTION Languages
+START-INFO-DIR-ENTRY
+* asymptote FAQ: (asy-faq). Asymptote Frequently Asked Questions.
+END-INFO-DIR-ENTRY
+
+
+File: asy-faq.info, Node: Top, Next: Question 1.1, Up: (dir)
+
+ ASYMPTOTE FREQUENTLY ASKED QUESTIONS
+ 2021-02-19
+
+This is the list of Frequently Asked Questions about Asymptote (asy).
+
+Index
+
+* Menu:
+* Section 1:: About Asymptote
+* Section 2:: Questions about installation and setup
+* Section 3:: Questions about paths
+* Section 4:: Questions about labels
+* Section 5:: Questions about arrows
+* Section 6:: Questions about 2D graphs
+* Section 7:: Questions about programming
+* Section 8:: Questions about differences between Asymptote and
+ MetaPost
+* Section 9:: Questions about output
+
+Section 1, About Asymptote
+* Question 1.1:: What is Asymptote?
+* Question 1.2:: How do I obtain Asymptote?
+* Question 1.3:: Where can I ask questions about Asymptote?
+* Question 1.4:: Why was the name Asymptote chosen?
+* Question 1.5:: In the internal Asymptote source code, what does the
+ name camp refer to?
+
+Section 2, Questions about installation and setup
+* Question 2.1:: Is it possible to install Asymptote on Mac OS X?
+* Question 2.2:: Why do I get the error Bad CPU type in executable on
+ installing Asymptote from the MAC OS binary?
+* Question 2.3:: What do I do if I get the error: Error: pdfetex (file
+ pdftex.cfg): cannot open config file...texinfo.tex
+ appears to be broken?
+* Question 2.4:: What do I do if I get the error: ! Undefined control
+ sequence. l.6 @copying?
+* Question 2.5:: Is it possible to integrate Asymptote into LaTeX?
+* Question 2.6:: Is it possible to integrate Asymptote into latex or
+ pdflatex?
+* Question 2.7:: Do I need the tkinter package to install an Asymptote
+ rpm binary?
+* Question 2.8:: What does the path %USERPROFILE%\.asy\config.asy mean?
+* Question 2.9:: Why do I get the error "string not terminated" when I
+ try to set settings.dir="C:\asymptote\";?
+* Question 2.10:: How do I change environment variables in Microsoft
+ Windows, for example, in order to change the default
+ PostScript viewer?
+* Question 2.11:: Under Microsoft Windows XP, why do I get an error like
+ "Invalid Parameter - 432x432"?
+* Question 2.12:: Why does Asymptote freeze upon trying to draw a label
+ with my MikTex installation under Microsoft Windows?
+
+Section 3, Questions about paths
+* Question 3.1:: Why do I get a syntax error message when I specify an
+ integer value for the path tension?
+* Question 3.2:: Shouldn't dots always be the same size?
+
+Section 4, Questions about labels
+* Question 4.1:: How do I get Greek letters like omega to show up in my
+ labels?
+* Question 4.2:: Can Asymptote use matrices as labels?
+* Question 4.3:: How do I tell Asymptote to load a particular LaTeX
+ package, like mathptmx?
+* Question 4.4:: How can I use international fonts in Asymptote labels?
+* Question 4.5:: How can I use Fourier fonts?
+* Question 4.6:: Is there any way to change the default appearance of
+ the decimal separator, using a comma instead of a dot?
+* Question 4.7:: How can I get a rotated label with the filled box
+ rotated as well so that it fits the text?
+* Question 4.8:: How can I rotate labels in a 3D figure?
+* Question 4.9:: How can I draw some squares and circles of a fixed
+ size and put a label in the middle of them?
+* Question 4.10:: The binary operator * can be used to scale the color
+ of a pen by a real number. Does this scaling factor
+ have to be less than 1?
+* Question 4.11:: Why is the space after the comma decimal separator in
+ my locale so large?
+* Question 4.12:: How can I prevent
+ texpreamble("\usepackage[pdftex]{hyperref}") from
+ changing the page size?
+
+Section 5, Questions about arrows
+* Question 5.1:: How do I draw two arrows at arbitrary positions along
+ a path?
+* Question 5.2:: How do I reverse the direction of an arrowhead?
+* Question 5.3:: How do I change the size of all arrows?
+* Question 5.4:: Can I create other arrowhead styles?
+
+Section 6, Questions about 2D graphs
+* Question 6.1:: How can I draw x axis ticks on the right side, with
+ the tick labels on the left side (relative to the axis
+ path)?
+* Question 6.2:: How can I reposition the x axis label to
+ three-quarters along the axis length?
+* Question 6.3:: How can I move the x axis label down 10bp?
+* Question 6.4:: Can I use different pens for the axis, the axis label,
+ and the tick labels?
+* Question 6.5:: How can I change the font type of the axes label?
+* Question 6.6:: How can I change the font type of the tick labels on
+ an axis?
+* Question 6.7:: How can I prevent axes tick labels from rendering on
+ top of each other?
+* Question 6.8:: How do I make the plot region of a graph, ignoring
+ labels and legends, have a fixed size?
+* Question 6.9:: How can I plot a function f(x) within [0,1]x[0,2]
+ without explicitly calculating the x values for which
+ f(x) hits the boundary?
+* Question 6.10:: Is it possible to define customized palettes?
+* Question 6.11:: Is there an easy way to graph factorial functions
+ nicely?
+* Question 6.12:: How do I indicate that a certain length should be
+ exactly the size I prescribe with no rescaling, within
+ a picture which has its own size?
+* Question 6.13:: How can I make the y axis display base-2 logarithmic
+ values?
+* Question 6.14:: How can I align the x axes of two graphs on the same
+ figure?
+* Question 6.15:: How can I change the direction of the y-axis, such
+ that negatives values are on the upper y-axis?
+* Question 6.16:: How can I fill a path with a function that defines the
+ color of each location?
+* Question 6.17:: Is there a way to draw a function that is not
+ explicitly given, such as (y - 2)^2 = x - 1 ?
+* Question 6.18:: Is it possible to reverse or stretch an axis?
+* Question 6.19:: Why can't I use the UnFill option to draw graphs with
+ empty markers?
+* Question 6.20:: How can I force several images to use the same palette
+ range (e.g. the entire 0-255 grayscale range)?
+
+Section 7, Questions about programming
+* Question 7.1:: Is Asymptote an interpreter or a compiler?
+* Question 7.2:: What is the difference between a frame and a picture?
+* Question 7.3:: What is the difference between a path and a guide?
+* Question 7.4:: What is a convenient way to declare and initialize an
+ array of pictures?
+* Question 7.5:: Is there a way to define functions that act on arrays
+ in general (i.e. work for arrays of any type)?
+* Question 7.6:: Is there any way to declare structures ahead of their
+ definition, e.g. where struct A performs some
+ operation on struct B, but B contains an A member?
+* Question 7.7:: Where are static variables in for loops allocated?
+* Question 7.8:: Is there a debugger for asy?
+* Question 7.9:: Do you accept patches for Asymptote?
+
+Section 8, Questions about differences between Asymptote and
+ MetaPost
+* Question 8.1:: What is the equivalent of the MetaPost c[a,b]
+ interpolation operator?
+* Question 8.2:: How does picture scaling differ in Asymptote and
+ MetaPost?
+* Question 8.3:: How can I avoid automatic scaling of a picture?
+* Question 8.4:: What is the equivalent of MetaPost ... command?
+* Question 8.5:: What is the equivalent of the MetaPost pickup command?
+* Question 8.6:: What is the equivalent of the MetaPost whatever
+ command?
+* Question 8.7:: What is the equivalent for the MetaPost command for
+ lray - horiz*v - verti*u = whatever*(LightSource - R),
+ a system of three linear equations for three unknowns:
+ horiz, verti, whatever?
+* Question 8.8:: In MetaPost, it is possible to have a drawing remain
+ the same size in different pictures by defining a unit
+ u and explicitly multiply all the coordinates by u. Is
+ there a better way to do this in Asymptote?
+* Question 8.9:: In MetaPost, one could produce tiling pictures by
+ generating a picture, and then clipping the picture to
+ a rectangle of fixed dimensions around the center of
+ the picture. How is that done in Asymptote?
+
+Section 9, Questions about output
+* Question 9.1:: How can I disable automatic invocation of the PS
+ viewer after an asy file is done processing?
+* Question 9.2:: How do I output jpeg images?
+* Question 9.3:: Can I embed bitmaps (photos) into my drawings and
+ position and scale them?
+* Question 9.4:: Does Asymptote support direct PDF output?
+* Question 9.5:: How to I produce large pictures of high quality in
+ raster format (e.g. png, giff etc).
+* Question 9.6:: Is it possible to produce multi-page documents with
+ asymptote?
+
+
+
+File: asy-faq.info, Node: Section 1, Next: Section 2, Previous: Top, Up: Top
+
+About Asymptote
+
+* Menu:
+* Question 1.1:: What is Asymptote?
+* Question 1.2:: How do I obtain Asymptote?
+* Question 1.3:: Where can I ask questions about Asymptote?
+* Question 1.4:: Why was the name Asymptote chosen?
+* Question 1.5:: In the internal Asymptote source code, what does the
+ name camp refer to?
+
+
+
+File: asy-faq.info, Node: Question 1.1, Next: Question 1.2, Previous: Top, Up: Section 1
+
+Question 1.1. What is Asymptote?
+
+Asymptote is a vector graphics language designed for technical graphics,
+inspired by MetaPost but with IEEE floating-point numerics, native
+three-dimensional graphics, Grayscale/RGB/CMYK colourspaces, and a
+C++-like syntax. Unlike MetaPost, it natively supports multiple-segment
+paths (and hence regions other than simply connected ones), tiling
+patterns, Gouraud shading, tensor patch shading, and PostScript images.
+
+
+File: asy-faq.info, Node: Question 1.2, Next: Question 1.3, Previous: Question 1.1, Up: Section 1
+
+Question 1.2. How do I obtain Asymptote?
+
+Binary releases are available for Linux, MacOS X, and Microsoft Windows
+platforms, in addition to full source code, from the website
+https://asymptote.sourceforge.io/. Many Linux distributions (such as
+RedHat and Debian) now include an Asymptote package (check your
+distribution's documentation for further information about this).
+
+
+File: asy-faq.info, Node: Question 1.3, Next: Question 1.4, Previous: Question 1.2, Up: Section 1
+
+Question 1.3. Where can I ask questions about Asymptote?
+
+If you have a question, please try to find an answer in this FAQ, in the
+extensive Asymptote documentation at
+https://asymptote.sourceforge.io/doc/, or search the forum:
+http://sourceforge.net/forum/forum.php?forum_id=409349.
+
+
+File: asy-faq.info, Node: Question 1.4, Next: Question 1.5, Previous: Question 1.3, Up: Section 1
+
+Question 1.4. Why was the name Asymptote chosen?
+
+Well, it isn't the perfect graphics package, but we do think it is getting
+there asymptotically...
+
+
+File: asy-faq.info, Node: Question 1.5, Next: Question 2.1, Previous: Question 1.4, Up: Section 1
+
+Question 1.5. In the internal Asymptote source code, what does the name camp refer to?
+
+That was our original tentative name for this project, which stood for
+"C's Answer to MetaPost" (the language that inspired Asymptote). However,
+we eventually decided that the name Asymptote better emphasizes the
+mathematical and graphical nature of this language.
+
+
+File: asy-faq.info, Node: Section 2, Next: Section 3, Previous: Section 1, Up: Top
+
+Questions about installation and setup
+
+* Menu:
+* Question 2.1:: Is it possible to install Asymptote on Mac OS X?
+* Question 2.2:: Why do I get the error Bad CPU type in executable on
+ installing Asymptote from the MAC OS binary?
+* Question 2.3:: What do I do if I get the error: Error: pdfetex (file
+ pdftex.cfg): cannot open config file...texinfo.tex
+ appears to be broken?
+* Question 2.4:: What do I do if I get the error: ! Undefined control
+ sequence. l.6 @copying?
+* Question 2.5:: Is it possible to integrate Asymptote into LaTeX?
+* Question 2.6:: Is it possible to integrate Asymptote into latex or
+ pdflatex?
+* Question 2.7:: Do I need the tkinter package to install an Asymptote
+ rpm binary?
+* Question 2.8:: What does the path %USERPROFILE%\.asy\config.asy mean?
+* Question 2.9:: Why do I get the error "string not terminated" when I
+ try to set settings.dir="C:\asymptote\";?
+* Question 2.10:: How do I change environment variables in Microsoft
+ Windows, for example, in order to change the default
+ PostScript viewer?
+* Question 2.11:: Under Microsoft Windows XP, why do I get an error like
+ "Invalid Parameter - 432x432"?
+* Question 2.12:: Why does Asymptote freeze upon trying to draw a label
+ with my MikTex installation under Microsoft Windows?
+
+
+
+File: asy-faq.info, Node: Question 2.1, Next: Question 2.2, Previous: Question 1.5, Up: Section 2
+
+Question 2.1. Is it possible to install Asymptote on Mac OS X?
+
+It is easy to compile Asymptote directly from the source code at
+http://sourceforge.net/project/showfiles.php?group_id=120000 We recommend
+first upgrading to the latest GNU readline library, unless you don't care
+about interactive readline support (in which case configure will
+automatically detect and disable obsolete versions of the readline
+library). Marius Schamschula also maintains a binary package for various
+MacOS X platforms
+http://www.hmug.org/pub/MacOS_X/X/Applications/Publishing/asymptote.
+
+
+File: asy-faq.info, Node: Question 2.2, Next: Question 2.3, Previous: Question 2.1, Up: Section 2
+
+Question 2.2. Why do I get the error Bad CPU type in executable on installing Asymptote from the MAC OS binary?
+
+This means either that you have a binary distribution for another MAC
+architecture, or (according to Marius Schamschula) that you may have a
+missing library. The simplest solution is to compile Asymptote directly
+from the official source:
+http://sourceforge.net/project/showfiles.php?group_id=120000.
+
+
+File: asy-faq.info, Node: Question 2.3, Next: Question 2.4, Previous: Question 2.2, Up: Section 2
+
+Question 2.3. What do I do if I get the error: Error: pdfetex (file pdftex.cfg): cannot open config file...texinfo.tex appears to be broken?
+
+Simply put https://asymptote.sourceforge.io/asymptote.pdf in the directory
+doc and repeat the command make all. Or, if you don't want to build a
+local copy of the documentation, simply proceed with make install-asy.
+
+
+File: asy-faq.info, Node: Question 2.4, Next: Question 2.5, Previous: Question 2.3, Up: Section 2
+
+Question 2.4. What do I do if I get the error: ! Undefined control sequence. l.6 @copying?
+
+Either upgrade your texinfo package or follow one of the easy work arounds
+in *Note Question 2.3:: `What do I do if I get the error: Error: pdfetex
+(file pdftex.cfg): cannot open config file...texinfo.tex appears to be
+broken?'.
+
+
+File: asy-faq.info, Node: Question 2.5, Next: Question 2.6, Previous: Question 2.4, Up: Section 2
+
+Question 2.5. Is it possible to integrate Asymptote into LaTeX?
+
+Yes, see the example latexusage.tex. Dario Teixeira has also written a
+detailed guide on the topic. You can download it from
+http://dario.dse.nl/projects/asylatex/.
+
+Philippe Ivaldi has contributed an Asymptote mode for Emacs users
+https://asymptote.sourceforge.io/doc/Editing-modes.html, which includes a
+lasy-mode that allows one to compile and view the output of one
+\begin{asy}...\end{asy} section at a time.
+
+
+File: asy-faq.info, Node: Question 2.6, Next: Question 2.7, Previous: Question 2.5, Up: Section 2
+
+Question 2.6. Is it possible to integrate Asymptote into latex or pdflatex?
+
+Yes, as of version 1.14, Asymptote supports latex and pdflatex (both in
+EPS/PDF and inline mode), as illustrated by the example latexusage.tex:
+
+pdflatex latexusage
+asy latexusage
+pdflatex latexusage
+
+File: asy-faq.info, Node: Question 2.7, Next: Question 2.8, Previous: Question 2.6, Up: Section 2
+
+Question 2.7. Do I need the tkinter package to install an Asymptote rpm binary?
+
+No, you don't need tkinter unless you want to try out the GUI xasy. Try
+
+rpm -Uvh --nodeps asymptote-x.xx-1.i386.rpm
+where x.xx represents the version number.
+
+
+File: asy-faq.info, Node: Question 2.8, Next: Question 2.9, Previous: Question 2.7, Up: Section 2
+
+Question 2.8. What does the path %USERPROFILE%\.asy\config.asy mean?
+
+That is the way that Microsoft Windows refers to the user profile
+directory. There's nothing really to understand here, just put your
+configuration commands in the file config.asy in a new folder
+%USERPROFILE%\.asy.
+
+
+File: asy-faq.info, Node: Question 2.9, Next: Question 2.10, Previous: Question 2.8, Up: Section 2
+
+Question 2.9. Why do I get the error "string not terminated" when I try to set settings.dir="C:\asymptote\";?
+
+The backslash is an escape character here, so \" is interpreted as a
+verbatim quotation mark, leaving the string without a terminating
+quotation mark. Fortunately, this is the only escaped character in
+double-quoted strings. A final backslash isn't needed here anyway, but
+should you really want one somewhere, you can say:
+settings.dir="C:\asymptote"+'\\';.
+
+
+File: asy-faq.info, Node: Question 2.10, Next: Question 2.11, Previous: Question 2.9, Up: Section 2
+
+Question 2.10. How do I change environment variables in Microsoft Windows, for example, in order to change the default PostScript viewer?
+
+While it is easier to set the corresponding Asymptote configuration
+variable in your config.asy file, here is the procedure for changing
+Microsoft Windows environment variables:
+
+Click on the [Start] button
+
+* RIGHT-click on 'My Computer'
+
+* Choose 'Properties' from the popup menu
+
+* Click the 'Advanced' tab
+
+* Click the 'Environment Variables' button.
+
+
+File: asy-faq.info, Node: Question 2.11, Next: Question 2.12, Previous: Question 2.10, Up: Section 2
+
+Question 2.11. Under Microsoft Windows XP, why do I get an error like "Invalid Parameter - 432x432"?
+
+This means that ImageMagick wasn't properly installed and you are using
+the MSDOS convert program rather than the ImageMagick one. Or you may have
+installed ImageMagick but ran Asymptote from an existing MSDOS window. In
+that case, simply open a new window and try again. If that doesn't work,
+check that
+
+convert --version
+returns something like
+
+Version: ImageMagick 6.2.8 06/27/06 Q16 http://www.imagemagick.org
+
+File: asy-faq.info, Node: Question 2.12, Next: Question 3.1, Previous: Question 2.11, Up: Section 2
+
+Question 2.12. Why does Asymptote freeze upon trying to draw a label with my MikTex installation under Microsoft Windows?
+
+Likely, this means that latex and dvips are not in your default path. Try
+adding the appropriate paths in your config.asy file, for example:
+
+import settings;
+latex="C:\Program Files\MiKTeX 2.7\miktex\bin\latex.exe";
+dvips="C:\Program Files\MiKTeX 2.7\miktex\bin\dvips.exe";
+
+File: asy-faq.info, Node: Section 3, Next: Section 4, Previous: Section 2, Up: Top
+
+Questions about paths
+
+* Menu:
+* Question 3.1:: Why do I get a syntax error message when I specify an
+ integer value for the path tension?
+* Question 3.2:: Shouldn't dots always be the same size?
+
+
+
+File: asy-faq.info, Node: Question 3.1, Next: Question 3.2, Previous: Question 2.12, Up: Section 3
+
+Question 3.1. Why do I get a syntax error message when I specify an integer value for the path tension?
+
+What is happening here is that
+
+draw((0,0)..tension 2..(0,50)..(100,100));
+is read as
+
+draw((0,0)..tension 2. .(0,50)..(100,100));
+So the first . after the two is treated as a decimal point. Just put a
+space after the integer tension value:
+
+draw((0,0)..tension 2 ..(0,50)..(100,100));
+
+File: asy-faq.info, Node: Question 3.2, Next: Question 4.1, Previous: Question 3.1, Up: Section 3
+
+Question 3.2. Shouldn't dots always be the same size?
+
+From the documentation:
+
+"The dot command defined in the module plain draws a dot having a diameter
+equal to an explicit pen linewidth or the default linewidth magnified by
+dotfactor (6 by default)."
+
+Thus, when you use the default pen, the dot will have size 6*linewidth,
+but when you give a pen with an explicit width specified, you will have a
+dot of size linewidth. If you want the first case to behave like the
+second, you may set dotfactor=1.
+
+
+File: asy-faq.info, Node: Section 4, Next: Section 5, Previous: Section 3, Up: Top
+
+Questions about labels
+
+* Menu:
+* Question 4.1:: How do I get Greek letters like omega to show up in my
+ labels?
+* Question 4.2:: Can Asymptote use matrices as labels?
+* Question 4.3:: How do I tell Asymptote to load a particular LaTeX
+ package, like mathptmx?
+* Question 4.4:: How can I use international fonts in Asymptote labels?
+* Question 4.5:: How can I use Fourier fonts?
+* Question 4.6:: Is there any way to change the default appearance of
+ the decimal separator, using a comma instead of a dot?
+* Question 4.7:: How can I get a rotated label with the filled box
+ rotated as well so that it fits the text?
+* Question 4.8:: How can I rotate labels in a 3D figure?
+* Question 4.9:: How can I draw some squares and circles of a fixed
+ size and put a label in the middle of them?
+* Question 4.10:: The binary operator * can be used to scale the color
+ of a pen by a real number. Does this scaling factor
+ have to be less than 1?
+* Question 4.11:: Why is the space after the comma decimal separator in
+ my locale so large?
+* Question 4.12:: How can I prevent
+ texpreamble("\usepackage[pdftex]{hyperref}") from
+ changing the page size?
+
+
+
+File: asy-faq.info, Node: Question 4.1, Next: Question 4.2, Previous: Question 3.2, Up: Section 4
+
+Question 4.1. How do I get Greek letters like omega to show up in my labels?
+
+In (La)TeX, Greek letters can be obtained in math mode by prepending a
+backslash to the letter name. So for a omega symbol, use "$\omega$".
+Everything between the dollar signs is considered to be a math formula.
+Uppercase Greek letters can be used by capitalizing the first letter of
+the name:
+
+label("$\omega$",(0,0));
+label("$\Omega$",(20,0));
+
+File: asy-faq.info, Node: Question 4.2, Next: Question 4.3, Previous: Question 4.1, Up: Section 4
+
+Question 4.2. Can Asymptote use matrices as labels?
+
+Yes:
+usepackage("amsmath");
+label("$\begin{matrix} 1 & 2 \\\ 1 & 1 \end{matrix}$",(0,0));
+
+File: asy-faq.info, Node: Question 4.3, Next: Question 4.4, Previous: Question 4.2, Up: Section 4
+
+Question 4.3. How do I tell Asymptote to load a particular LaTeX package, like mathptmx?
+
+Put
+
+usepackage("mathptmx");
+at the beginning of your file. Note: to enable the Adobe Times Roman font
+for text, you will also need to say:
+defaultpen(TimesRoman());
+
+File: asy-faq.info, Node: Question 4.4, Next: Question 4.5, Previous: Question 4.3, Up: Section 4
+
+Question 4.4. How can I use international fonts in Asymptote labels?
+
+See https://asymptote.sourceforge.io/doc/Pens.html.
+
+
+File: asy-faq.info, Node: Question 4.5, Next: Question 4.6, Previous: Question 4.4, Up: Section 4
+
+Question 4.5. How can I use Fourier fonts?
+
+usepackage("fourier");
+defaultpen(font("T1","fut\textfamilyextension","m","n"));
+
+File: asy-faq.info, Node: Question 4.6, Next: Question 4.7, Previous: Question 4.5, Up: Section 4
+
+Question 4.6. Is there any way to change the default appearance of the decimal separator, using a comma instead of a dot?
+
+Just set your locale appropriately:
+
+locale("it_IT");
+usepackage("icomma");
+label(format(0.5));
+
+File: asy-faq.info, Node: Question 4.7, Next: Question 4.8, Previous: Question 4.6, Up: Section 4
+
+Question 4.7. How can I get a rotated label with the filled box rotated as well so that it fits the text?
+
+frame f;
+label(f,"This is some text",white,Fill(blue));
+add(rotate(65)*f);
+
+File: asy-faq.info, Node: Question 4.8, Next: Question 4.9, Previous: Question 4.7, Up: Section 4
+
+Question 4.8. How can I rotate labels in a 3D figure?
+
+You need to first project the triple to a pair like this:
+
+import three;
+size(100,100);
+
+draw(rotate(90,project(Z))*"A",O--X);
+
+File: asy-faq.info, Node: Question 4.9, Next: Question 4.10, Previous: Question 4.8, Up: Section 4
+
+Question 4.9. How can I draw some squares and circles of a fixed size and put a label in the middle of them?
+
+Fixed-size objects should be drawn on a separate picture and then added to
+currentpicture. Here is one way (see also
+https://asymptote.sourceforge.io/gallery/subpictures.asy and
+https://asymptote.sourceforge.io/gallery/mosquito.asy):
+
+real u=2cm;
+
+picture square;
+draw(square,scale(u)*shift(-0.5,-0.5)*unitsquare);
+
+picture circle;
+draw(circle,scale(0.5u)*unitcircle);
+
+void add(picture pic=currentpicture, Label L, picture object, pair z) {
+add(pic,object,z);
+label(pic,L,z);
+}
+
+add("square",square,(0,0));
+add("circle",circle,(5cm,0));
+
+File: asy-faq.info, Node: Question 4.10, Next: Question 4.11, Previous: Question 4.9, Up: Section 4
+
+Question 4.10. The binary operator * can be used to scale the color of a pen by a real number. Does this scaling factor have to be less than 1?
+
+The scaling factor can be greater than 1. But keep in mind that the rgb
+color components saturate at 1.
+
+Try
+write(cyan); write(0.8*cyan); write(1.5*cyan);
+and you will quickly see what is going on.
+
+To get a lighter cyan you can say white+cyan, which yields rgb(0.5,1,1).
+If you want something even lighter specify the rgb colors directly, for
+example, rgb(0.9,1,1).
+
+Alternatively, work in cmyk colour space, which is nicer in that it
+handles saturation separately from hue:
+
+0.1*Cyan is light and 0.9*Cyan is dark. You can also say 0.1*cmyk(red).
+
+
+File: asy-faq.info, Node: Question 4.11, Next: Question 4.12, Previous: Question 4.10, Up: Section 4
+
+Question 4.11. Why is the space after the comma decimal separator in my locale so large?
+
+LaTeX is treating the comma as punctuation and not as a decimal separator.
+The solution is to load the icomma package near the beginning of your
+file:
+usepackage("icomma");
+
+File: asy-faq.info, Node: Question 4.12, Next: Question 5.1, Previous: Question 4.11, Up: Section 4
+
+Question 4.12. How can I prevent texpreamble("\usepackage[pdftex]{hyperref}") from changing the page size?
+
+texpreamble("\usepackage[pdftex,setpagesize=false]{hyperref}");
+
+File: asy-faq.info, Node: Section 5, Next: Section 6, Previous: Section 4, Up: Top
+
+Questions about arrows
+
+* Menu:
+* Question 5.1:: How do I draw two arrows at arbitrary positions along
+ a path?
+* Question 5.2:: How do I reverse the direction of an arrowhead?
+* Question 5.3:: How do I change the size of all arrows?
+* Question 5.4:: Can I create other arrowhead styles?
+
+
+
+File: asy-faq.info, Node: Question 5.1, Next: Question 5.2, Previous: Question 4.12, Up: Section 5
+
+Question 5.1. How do I draw two arrows at arbitrary positions along a path?
+
+Assuming that at least one of the arrowheads is to be filled, you can do
+this:
+
+size(200);
+path g = (0,0)..(1,3)..(3,0);
+draw(g,Arrow(Relative(0.9)));
+add(arrow(g,invisible,FillDraw(black),Relative(0.5)));
+add(arrow(reverse(g),invisible,FillDraw(white,black),Relative(0.9)));
+If both of the arrowheads are to be drawn with filltype NoFill, one will
+need to create a specialized version of the arrow routine in
+plain_arrows.asy:
+
+void arrow(frame f, arrowhead arrowhead=DefaultHead,
+ path g, pen p=currentpen, real size=0,
+ real angle=arrowangle, filltype filltype=arrowhead.defaultfilltype,
+ position position=EndPoint, bool forwards=true,
+ margin margin=NoMargin, bool center=false);
+
+File: asy-faq.info, Node: Question 5.2, Next: Question 5.3, Previous: Question 5.1, Up: Section 5
+
+Question 5.2. How do I reverse the direction of an arrowhead?
+
+Simply reverse the direction of the path.
+
+path g=((0,0)--(5cm,0));
+draw(reverse(g),Arrow(Relative(0.55)));
+
+File: asy-faq.info, Node: Question 5.3, Next: Question 5.4, Previous: Question 5.2, Up: Section 5
+
+Question 5.3. How do I change the size of all arrows?
+
+To override the arrowsize you can give every Arrow drawing attribute a
+real size argument. If you want to do this globally, you can override the
+pen-dependent arrowsize function like this:
+
+DefaultHead.size=new real(pen p=currentpen) {return 2mm;};
+
+File: asy-faq.info, Node: Question 5.4, Next: Question 6.1, Previous: Question 5.3, Up: Section 5
+
+Question 5.4. Can I create other arrowhead styles?
+
+Yes, you can build custom arrowheads like this (see the predefined
+arrowhead styles in plain_arrows.asy for further examples):
+
+arrowhead DotHead;
+DotHead.head=new path(path g, position position=EndPoint, pen p=currentpen,
+ real size=0, real angle=arrowangle) {
+ if(size == 0) size=DotHead.size(p);
+ bool relative=position.relative;
+ real position=position.position.x;
+ if(relative) position=reltime(g,position);
+ path r=subpath(g,position,0);
+ pair x=point(r,0);
+ real t=arctime(r,size);
+ pair y=point(r,t);
+ return circle(0.5(x+y),0.5size);
+};
+
+size(100);
+draw((0,0)..(1,1)..(2,0),Arrow(DotHead));
+dot((2,0),red);
+If you submit your alternate arrowheads to the Forum or the Patch
+Tracking System, we'll consider including them in a future release.
+
+
+File: asy-faq.info, Node: Section 6, Next: Section 7, Previous: Section 5, Up: Top
+
+Questions about 2D graphs
+
+* Menu:
+* Question 6.1:: How can I draw x axis ticks on the right side, with
+ the tick labels on the left side (relative to the axis
+ path)?
+* Question 6.2:: How can I reposition the x axis label to
+ three-quarters along the axis length?
+* Question 6.3:: How can I move the x axis label down 10bp?
+* Question 6.4:: Can I use different pens for the axis, the axis label,
+ and the tick labels?
+* Question 6.5:: How can I change the font type of the axes label?
+* Question 6.6:: How can I change the font type of the tick labels on
+ an axis?
+* Question 6.7:: How can I prevent axes tick labels from rendering on
+ top of each other?
+* Question 6.8:: How do I make the plot region of a graph, ignoring
+ labels and legends, have a fixed size?
+* Question 6.9:: How can I plot a function f(x) within [0,1]x[0,2]
+ without explicitly calculating the x values for which
+ f(x) hits the boundary?
+* Question 6.10:: Is it possible to define customized palettes?
+* Question 6.11:: Is there an easy way to graph factorial functions
+ nicely?
+* Question 6.12:: How do I indicate that a certain length should be
+ exactly the size I prescribe with no rescaling, within
+ a picture which has its own size?
+* Question 6.13:: How can I make the y axis display base-2 logarithmic
+ values?
+* Question 6.14:: How can I align the x axes of two graphs on the same
+ figure?
+* Question 6.15:: How can I change the direction of the y-axis, such
+ that negatives values are on the upper y-axis?
+* Question 6.16:: How can I fill a path with a function that defines the
+ color of each location?
+* Question 6.17:: Is there a way to draw a function that is not
+ explicitly given, such as (y - 2)^2 = x - 1 ?
+* Question 6.18:: Is it possible to reverse or stretch an axis?
+* Question 6.19:: Why can't I use the UnFill option to draw graphs with
+ empty markers?
+* Question 6.20:: How can I force several images to use the same palette
+ range (e.g. the entire 0-255 grayscale range)?
+
+
+
+File: asy-faq.info, Node: Question 6.1, Next: Question 6.2, Previous: Question 5.4, Up: Section 6
+
+Question 6.1. How can I draw x axis ticks on the right side, with the tick labels on the left side (relative to the axis path)?
+
+import graph;
+
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+xaxis("$x$",RightTicks(Label(align=left)));
+yaxis("$y$",RightTicks);
+
+File: asy-faq.info, Node: Question 6.2, Next: Question 6.3, Previous: Question 6.1, Up: Section 6
+
+Question 6.2. How can I reposition the x axis label to three-quarters along the axis length?
+
+import graph;
+
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+xaxis(Label("$x$",0.75),LeftTicks);
+yaxis("$y$",RightTicks);
+
+File: asy-faq.info, Node: Question 6.3, Next: Question 6.4, Previous: Question 6.2, Up: Section 6
+
+Question 6.3. How can I move the x axis label down 10bp?
+
+import graph;
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+xaxis(shift(0,-10)*"$x$",LeftTicks);
+yaxis("$y$",RightTicks);
+
+File: asy-faq.info, Node: Question 6.4, Next: Question 6.5, Previous: Question 6.3, Up: Section 6
+
+Question 6.4. Can I use different pens for the axis, the axis label, and the tick labels?
+
+Yes:
+
+import graph;
+size(300,200,IgnoreAspect);
+
+xlimits(-50,50);
+ylimits(0,100);
+
+xaxis(Label("$x$",MidPoint,red),Bottom,blue,LeftTicks(green));
+yaxis("$y$",Left,RightTicks);
+
+File: asy-faq.info, Node: Question 6.5, Next: Question 6.6, Previous: Question 6.4, Up: Section 6
+
+Question 6.5. How can I change the font type of the axes label?
+
+import graph;
+size(300,200,IgnoreAspect);
+
+xlimits(-50,50);
+ylimits(0,100);
+
+xaxis("x",Bottom,Courier("m","n"),LeftTicks);
+yaxis("$y$",Left,RightTicks);
+
+File: asy-faq.info, Node: Question 6.6, Next: Question 6.7, Previous: Question 6.5, Up: Section 6
+
+Question 6.6. How can I change the font type of the tick labels on an axis?
+
+Tick labels are by default typeset in (TeX) math mode, so to use other
+fonts you need to override the default tick format:
+
+import graph;
+size(300,200,IgnoreAspect);
+
+xlimits(-50,50);
+ylimits(0,100);
+
+xaxis("$x$",Bottom,LeftTicks("%.4g",Courier("m","n")+fontsize(12)));
+yaxis("$y$",Left,RightTicks);
+
+File: asy-faq.info, Node: Question 6.7, Next: Question 6.8, Previous: Question 6.6, Up: Section 6
+
+Question 6.7. How can I prevent axes tick labels from rendering on top of each other?
+
+Either:
+
+(i) give LeftTicks/RightTicks/Ticks the arguments beginlabel=false and/or
+endlabel=false;
+
+(ii) explicitly remove specific ticks and their labels (drawing them
+manually; see
+http://www.github.com/vectorgraphics/asymptote/base/graph.asy for the
+definition of NoZero):
+
+import graph;
+
+size(10cm);
+
+real f(real x) {return x^2;}
+
+draw(graph(f,-2,2));
+
+xaxis(Ticks(NoZero));
+yaxis(Ticks(NoZero));
+
+label("$0$",(0,0),SW);
+(iii) explicitly remove specific tick labels and draw them manually (see
+http://www.github.com/vectorgraphics/asymptote/base/graph.asy for the
+definition of NoZeroFormat):
+
+import graph;
+
+size(10cm);
+
+real f(real x) {return x^2;}
+
+draw(graph(f,-2,2));
+
+xaxis(Ticks(NoZeroFormat));
+yaxis(Ticks(NoZeroFormat));
+
+label("$0$",(0,0),SW);
+(iv) use the xasy GUI to move overlapping labels;
+
+(v) change the Label argument of LeftTicks, RightTicks, or Ticks to:
+
+Label(currentpen+overwrite(Move))
+Solution (v) will move labels that might otherwise overwrite a previous
+label. Other possible overwrite arguments are Allow (allows overlapping
+labels; the default), Suppress (an overlapping label will not be written
+at all), SuppressQuiet, and MoveQuiet. The last two achieve the same
+result as the non-quiet types, but will not notify you which labels are
+overlapping. See: https://asymptote.sourceforge.io/doc/Pens.html.
+
+In the case of a user-specified tick array, you can change which labels
+get suppressed/moved by changing the order of array entries.
+
+
+File: asy-faq.info, Node: Question 6.8, Next: Question 6.9, Previous: Question 6.7, Up: Section 6
+
+Question 6.8. How do I make the plot region of a graph, ignoring labels and legends, have a fixed size?
+
+Either:
+
+i) Specify an explicit unitsize, which overrides any call to size:
+unitsize(x=1cm,y=2cm);
+ii) Explicitly tell Asymptote to map the plot region to a specific size:
+import graph;
+real[] x={0,1,2,3};
+real[] y=x^2;
+draw(graph(x,y),red);
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+
+size(5cm,5cm,point(SW),point(NE));
+
+label("$f_\mathrm{T}$",point(N),2N);
+iii) Specify the points in user coordinates that should correspond to a
+given picture size:
+
+import graph;
+
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+
+fixedscaling((-1.5,-0.5),(1.5,3.5));
+In this example, the user coordinate (-1.5,-0.5) will end up being the
+lower left corner of the figure and (1.5,3.5) will be the upper right
+corner. You can use this option to ensure multiple figures have the same
+scaling and same resulting figure size (just ensure the two coordinates
+given to fixedscaling() leaves room for any labels).
+
+See also https://asymptote.sourceforge.io/doc/Frames-and-pictures.html.
+
+
+File: asy-faq.info, Node: Question 6.9, Next: Question 6.10, Previous: Question 6.8, Up: Section 6
+
+Question 6.9. How can I plot a function f(x) within [0,1]x[0,2] without explicitly calculating the x values for which f(x) hits the boundary?
+
+Call limits with the Crop option before drawing the graph:
+import graph;
+
+size(250,200,IgnoreAspect);
+
+draw(graph(exp,-1,1),red);
+
+limits((0,0),(1,2),Crop);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+See also https://asymptote.sourceforge.io/doc/graph.html.
+
+
+File: asy-faq.info, Node: Question 6.10, Next: Question 6.11, Previous: Question 6.9, Up: Section 6
+
+Question 6.10. Is it possible to define customized palettes?
+
+Yes, you may generate your own pen[] array. For example:
+
+int NColors=32768;
+pen[] MyPalette=new pen[NColors];
+real step=1/(NColors-1.0);
+// Start at black: rgb(0,0,0)
+// End at yellow: rgb(1,1,0)
+for(int i=0; i < NColors; ++i) {
+ real rgval=i*step;
+ MyPalette[i]=rgb(rgval,rgval,0.0);
+}
+
+File: asy-faq.info, Node: Question 6.11, Next: Question 6.12, Previous: Question 6.10, Up: Section 6
+
+Question 6.11. Is there an easy way to graph factorial functions nicely?
+
+The example below shows a continuous function and two methods for placing
+markers at integer values of x:
+
+import graph;
+
+size(200,200,IgnoreAspect);
+
+real factorial(real t) {return gamma(t+1);}
+
+scale(Linear,Log);
+
+// Graph the factorial function.
+draw(graph(factorial,0,10));
+
+// Method 1: Draw nodes, but hide line
+pair F(int t) {return (t,factorial(t));}
+// Graph of factorial function from 0 to 10
+pair[] z=sequence(F,11);
+draw(graph(z),invisible,marker(scale(0.8mm)*unitcircle,blue,Fill));
+
+// Method 2: Nongraphing routines require explicit scaling:
+pair dotloc(int t) {return Scale(F(t));}
+pair[] dotlocs=sequence(dotloc,11);
+dot(dotlocs);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+
+File: asy-faq.info, Node: Question 6.12, Next: Question 6.13, Previous: Question 6.11, Up: Section 6
+
+Question 6.12. How do I indicate that a certain length should be exactly the size I prescribe with no rescaling, within a picture which has its own size?
+
+Here's an easy way to do this.
+
+size(12cm,0);
+
+void distance(picture pic=currentpicture, pair A, pair B, Label L="", real n=0,
+ pen p=currentpen)
+{
+ real d=3mm;
+ path g=A--B;
+ transform T=shift(-n*d*unit(B-A)*I);
+ pic.add(new void(frame f, transform t) {
+ picture opic;
+ path G=T*t*g;
+ draw(opic,Label(L,Center,UnFill(1)),G,p,Arrows(NoFill),Bars,PenMargins);
+ add(f,opic.fit());
+ });
+ pic.addBox(min(g),max(g),T*min(p),T*max(p));
+}
+
+pair A=(0,0), B=(3,3);
+
+dot(A);
+dot(B);
+
+distance(A,B,"$\ell$",1);
+
+File: asy-faq.info, Node: Question 6.13, Next: Question 6.14, Previous: Question 6.12, Up: Section 6
+
+Question 6.13. How can I make the y axis display base-2 logarithmic values?
+
+See the example https://asymptote.sourceforge.io/gallery/2D
+graphs/log2graph.asy.
+
+
+File: asy-faq.info, Node: Question 6.14, Next: Question 6.15, Previous: Question 6.13, Up: Section 6
+
+Question 6.14. How can I align the x axes of two graphs on the same figure?
+
+An easy way to do this, if the axes to be aligned have the same scaling
+and size, is illustrated in the example
+https://asymptote.sourceforge.io/gallery/2D graphs/alignedaxis.asy.
+
+Here is a more general solution to the problem of aligning two arbitrary
+axes. One fits the second picture to a frame based on the horizontal
+scaling for the first picture:
+
+import graph;
+
+real width=15cm;
+real aspect=0.3;
+
+picture pic1,pic2;
+
+size(pic1,width,aspect*width,IgnoreAspect);
+size(pic2,width,aspect*width,IgnoreAspect);
+
+scale(pic1,false);
+scale(pic2,false);
+
+real xmin1=6;
+real xmax1=9;
+real xmin2=8;
+real xmax2=16;
+
+real a1=1;
+real a2=0.001;
+
+real f1(real x) {return a1*sin(x/2*pi);}
+real f2(real x) {return a2*sin(x/4*pi);}
+
+draw(pic1,graph(pic1,f1,xmin1,xmax1));
+draw(pic2,graph(pic2,f2,xmin2,xmax2));
+
+xaxis(pic1,Bottom,LeftTicks());
+yaxis(pic1,"$f_1(x)$",Left,RightTicks);
+
+xaxis(pic2,"$x$",Bottom,LeftTicks(Step=4));
+yaxis(pic2,"$f_2(x)$",Left,RightTicks);
+
+yequals(pic1,0,Dotted);
+yequals(pic2,0,Dotted);
+
+pair min1=point(pic1,SW);
+pair max1=point(pic1,NE);
+
+pair min2=point(pic2,SW);
+pair max2=point(pic2,NE);
+
+real scale=(max1.x-min1.x)/(max2.x-min2.x);
+real shift=min1.x/scale-min2.x;
+
+transform t1=pic1.calculateTransform();
+transform t2=pic2.calculateTransform();
+transform T=xscale(scale*t1.xx)*yscale(t2.yy);
+
+add(pic1.fit());
+real height=truepoint(N,user=false).y-truepoint(S,user=false).y;
+add(shift(0,-height)*(shift(shift)*pic2).fit(T));
+
+File: asy-faq.info, Node: Question 6.15, Next: Question 6.16, Previous: Question 6.14, Up: Section 6
+
+Question 6.15. How can I change the direction of the y-axis, such that negatives values are on the upper y-axis?
+
+Here is a simple example (see also the example
+https://asymptote.sourceforge.io/gallery/2D graphs/diatom.asy or the
+discussion of Linear(-1) in the documentation):
+
+import graph;
+size(250,200,IgnoreAspect);
+
+scale(Linear,Linear(-1));
+
+draw(graph(log,0.1,10),red);
+
+xaxis("$x$",LeftTicks);
+yaxis("$y$",RightTicks);
+
+File: asy-faq.info, Node: Question 6.16, Next: Question 6.17, Previous: Question 6.15, Up: Section 6
+
+Question 6.16. How can I fill a path with a function that defines the color of each location?
+
+Use functionshade with a PDF tex engine, as illustrated by the example
+{functionshading.asy}.
+
+If you want to produce PostScript output, an approximate solution for now
+would be to superimpose a fine grid and specify colors to latticeshade
+that depend on position as a single pen[][] lattice. Alternatively, it may
+be more efficient to use tensorshade}.
+
+
+File: asy-faq.info, Node: Question 6.17, Next: Question 6.18, Previous: Question 6.16, Up: Section 6
+
+Question 6.17. Is there a way to draw a function that is not explicitly given, such as (y - 2)^2 = x - 1 ?
+
+Yes, use the parametric form
+
+y=t
+x=(t-2)^2+1
+See the example https://asymptote.sourceforge.io/gallery/2D
+graphs/parametricgraph.asy.
+
+
+File: asy-faq.info, Node: Question 6.18, Next: Question 6.19, Previous: Question 6.17, Up: Section 6
+
+Question 6.18. Is it possible to reverse or stretch an axis?
+
+The real scaling argument to Linear is used to stretch (or reverse) the
+axis. To see the effect of axis stretching, be sure not to specify
+IgnoreAspect in the picture size command.
+
+A secondary axis has the same length as the primary axis, so stretching
+cannot have any effect. But one can still reverse the axis, with
+Linear(-1).
+
+
+File: asy-faq.info, Node: Question 6.19, Next: Question 6.20, Previous: Question 6.18, Up: Section 6
+
+Question 6.19. Why can't I use the UnFill option to draw graphs with empty markers?
+
+UnFill won't work here because it only affects the local frame the markers
+are initially drawn on, before being added to currentpicture. Here is a
+way of achieving the desired effect (assuming a white background):
+
+import graph;
+size(10cm,0);
+pair[] z={(0,0),(0.5,0.5),(1,1)};
+path g=graph(z);
+
+draw(shift(0,.5)*g,marker(scale(5)*unitcircle,FillDraw(white)));
+
+xaxis(BottomTop,LeftTicks);
+yaxis(LeftRight,RightTicks);
+
+File: asy-faq.info, Node: Question 6.20, Next: Question 7.1, Previous: Question 6.19, Up: Section 6
+
+Question 6.20. How can I force several images to use the same palette range (e.g. the entire 0-255 grayscale range)?
+
+The palette color space corresponds to a range of values specified by the
+argument range, which can be Full, Automatic or an explicit range
+Range(pair min, pair max). Here Full} specifies a range varying from the
+minimum to maximum values of the function over the sampling interval,
+while Automatic selects "nice" limits.
+
+
+File: asy-faq.info, Node: Section 7, Next: Section 8, Previous: Section 6, Up: Top
+
+Questions about programming
+
+* Menu:
+* Question 7.1:: Is Asymptote an interpreter or a compiler?
+* Question 7.2:: What is the difference between a frame and a picture?
+* Question 7.3:: What is the difference between a path and a guide?
+* Question 7.4:: What is a convenient way to declare and initialize an
+ array of pictures?
+* Question 7.5:: Is there a way to define functions that act on arrays
+ in general (i.e. work for arrays of any type)?
+* Question 7.6:: Is there any way to declare structures ahead of their
+ definition, e.g. where struct A performs some
+ operation on struct B, but B contains an A member?
+* Question 7.7:: Where are static variables in for loops allocated?
+* Question 7.8:: Is there a debugger for asy?
+* Question 7.9:: Do you accept patches for Asymptote?
+
+
+
+File: asy-faq.info, Node: Question 7.1, Next: Question 7.2, Previous: Question 6.20, Up: Section 7
+
+Question 7.1. Is Asymptote an interpreter or a compiler?
+
+Asymptote compiles Asymptote commands into its own virtual machine code.
+It then runs this pseudocode on a virtual machine to produce PostScript
+code.
+
+
+File: asy-faq.info, Node: Question 7.2, Next: Question 7.3, Previous: Question 7.1, Up: Section 7
+
+Question 7.2. What is the difference between a frame and a picture?
+
+Frames are canvases for drawing in PostScript coordinates. While working
+with frames directly is occasionally necessary for constructing deferred
+drawing routines, pictures are usually more convenient to work with. See
+*Note Question 8.8:: `In MetaPost, it is possible to have a drawing remain
+the same size in different pictures by defining a unit u and explicitly
+multiply all the coordinates by u. Is there a better way to do this in
+Asymptote?'.
+
+
+File: asy-faq.info, Node: Question 7.3, Next: Question 7.4, Previous: Question 7.2, Up: Section 7
+
+Question 7.3. What is the difference between a path and a guide?
+
+A path is a cubic spline with fixed endpoint conditions.
+
+A guide is an unresolved cubic spline (list of cubic-spline nodes and
+control points). A guide is like a path except that the computation of the
+cubic spline is deferred until drawing time (when it is resolved into a
+path); this allows two guides with free endpoint conditions to be joined
+together smoothly.
+
+
+File: asy-faq.info, Node: Question 7.4, Next: Question 7.5, Previous: Question 7.3, Up: Section 7
+
+Question 7.4. What is a convenient way to declare and initialize an array of pictures?
+
+You could write yourself a routine such as:
+picture[] picture(int n) {
+ picture[] pic;
+ for(int i=0; i < n; ++i) {
+ pic[i]=new picture;
+ size(pic[i],19cm,0);
+ }
+ return pic;
+}
+
+picture[] pic=picture(6);
+
+File: asy-faq.info, Node: Question 7.5, Next: Question 7.6, Previous: Question 7.4, Up: Section 7
+
+Question 7.5. Is there a way to define functions that act on arrays in general (i.e. work for arrays of any type)?
+
+Generic types aren't yet implemented.
+
+But for now you can at least say
+typedef string T;
+include F;
+
+typedef real T;
+include F;
+where F.asy contains some type-dependent code like
+T[] operator $(T A, T B) {return new T[] {A,B};}
+
+File: asy-faq.info, Node: Question 7.6, Next: Question 7.7, Previous: Question 7.5, Up: Section 7
+
+Question 7.6. Is there any way to declare structures ahead of their definition, e.g. where struct A performs some operation on struct B, but B contains an A member?
+
+Asymptote does not support forward declaration of types. You can, however,
+nest structures, so that both types are visible for parts of the bodies of
+both structure definitions. For example:
+
+struct B {
+ typedef void someroutine(B b);
+
+ static struct A {
+ someroutine routine;
+ void operator init(someroutine routine) {
+ this.routine=routine;
+ }
+ }
+
+ string test="Testing";
+}
+
+typedef B.A A;
+
+A a=B.A(new void(B b){write(b.test);});
+
+B b;
+a.routine(b);
+
+File: asy-faq.info, Node: Question 7.7, Next: Question 7.8, Previous: Question 7.6, Up: Section 7
+
+Question 7.7. Where are static variables in for loops allocated?
+
+In the example
+
+void f() {
+ for(int i=0; i < 3; ++i) {
+ static int n;
+ ++n;
+ write(n);
+ }
+}
+
+f(); // Writes 1, 2, 3
+the static qualifier means that n is allocated not just outside of the for
+loop, but also outside the function. This is clear if you call f multiple
+times; there is still only one instance of n.
+
+The "level" of a variable (where it is allocated) has nothing to do with
+the "scope" of a variable (how long it can be referred to by name). The
+curly braces enclosing a block affect only a variable's scope, not its
+level.
+
+Static modifiers are meaningless at the top level; they generate a warning
+and are simply ignored:
+
+for(int i=0; i < 3; ++i) {
+ static int n;
+ ++n;
+ write(n);
+}
+// Writes warning about top-level static modifier and then 1, 1, 1
+Since version 1.22, non-static variables allocated in a loop body are
+allocated anew every iteration. This is only noticable in obscure cases
+where a variable in a loop is accessed in the closure of a function
+defined in the loop:
+
+int f();
+
+for(int i=0; i < 10; ++i) {
+ int j=10*i;
+ if(i == 5)
+ f=new int() {return j;};
+}
+
+write(f()); // Writes 50
+Variables in the body of a loop last as long as that iteration of the
+loop, unless they are kept alive by a function closure as in the example
+above. In a function body, variables will last at least as long as the
+function call, though because of closures and garbage collection, they may
+last longer than that. If defined at the top level of a file or at the
+interactive prompt, they will last at least until the end of the file or
+prompt's run.
+
+
+File: asy-faq.info, Node: Question 7.8, Next: Question 7.9, Previous: Question 7.7, Up: Section 7
+
+Question 7.8. Is there a debugger for asy?
+
+Yes, Asymptote includes a line-based debugger:
+
+https://asymptote.sourceforge.io/doc/Debugger.html
+
+
+File: asy-faq.info, Node: Question 7.9, Next: Question 8.1, Previous: Question 7.8, Up: Section 7
+
+Question 7.9. Do you accept patches for Asymptote?
+
+Yes, in fact we would prefer that users submit patches for customized
+features (to http://sourceforge.net/tracker/?atid=685685&group_id=120000)
+instead of relying on us to do all of the coding. Development will proceed
+faster that way.
+
+
+File: asy-faq.info, Node: Section 8, Next: Section 9, Previous: Section 7, Up: Top
+
+Questions about differences between Asymptote and MetaPost
+
+* Menu:
+* Question 8.1:: What is the equivalent of the MetaPost c[a,b]
+ interpolation operator?
+* Question 8.2:: How does picture scaling differ in Asymptote and
+ MetaPost?
+* Question 8.3:: How can I avoid automatic scaling of a picture?
+* Question 8.4:: What is the equivalent of MetaPost ... command?
+* Question 8.5:: What is the equivalent of the MetaPost pickup command?
+* Question 8.6:: What is the equivalent of the MetaPost whatever
+ command?
+* Question 8.7:: What is the equivalent for the MetaPost command for
+ lray - horiz*v - verti*u = whatever*(LightSource - R),
+ a system of three linear equations for three unknowns:
+ horiz, verti, whatever?
+* Question 8.8:: In MetaPost, it is possible to have a drawing remain
+ the same size in different pictures by defining a unit
+ u and explicitly multiply all the coordinates by u. Is
+ there a better way to do this in Asymptote?
+* Question 8.9:: In MetaPost, one could produce tiling pictures by
+ generating a picture, and then clipping the picture to
+ a rectangle of fixed dimensions around the center of
+ the picture. How is that done in Asymptote?
+
+
+
+File: asy-faq.info, Node: Question 8.1, Next: Question 8.2, Previous: Question 7.9, Up: Section 8
+
+Question 8.1. What is the equivalent of the MetaPost c[a,b] interpolation operator?
+
+interp(a,b,c);
+
+File: asy-faq.info, Node: Question 8.2, Next: Question 8.3, Previous: Question 8.1, Up: Section 8
+
+Question 8.2. How does picture scaling differ in Asymptote and MetaPost?
+
+Asymptote includes an optional facility to do automatic scaling of
+pictures to achieve a given overall picture size, whereas Metapost only
+supports manual scaling. Asymptote defers drawing of objects drawn to
+pictures and distinguishes between true-size objects and objects that
+should scale with the picture size. The resulting linear programming
+problem is solved via the Simplex method.
+
+See the https://asymptote.sourceforge.io/gallery/dimension.asy example for
+an example of how deferred drawing is used to accomodate both user and
+true-size (PostScript) coordinates.
+
+
+File: asy-faq.info, Node: Question 8.3, Next: Question 8.4, Previous: Question 8.2, Up: Section 8
+
+Question 8.3. How can I avoid automatic scaling of a picture?
+
+If you really like Metapost-style manual (hard-wired) scaling either:
+
+(i) use the default size(0,0) for the entire picture and do all of the
+scaling by hand, just like in MetaPost;
+
+(ii) draw to a separate picture pic and add(pic.fit());
+
+(iii) use frames.
+
+
+File: asy-faq.info, Node: Question 8.4, Next: Question 8.5, Previous: Question 8.3, Up: Section 8
+
+Question 8.4. What is the equivalent of MetaPost ... command?
+
+The connector :: is a macro for tension atleast 1:
+
+size(100);
+pair z0=(0,0);
+pair z1=(1,0.25);
+pair z2=(2,0);
+draw(z0{up}::z1{right}::z2{down});
+
+File: asy-faq.info, Node: Question 8.5, Next: Question 8.6, Previous: Question 8.4, Up: Section 8
+
+Question 8.5. What is the equivalent of the MetaPost pickup command?
+
+Just say, for example:
+
+currentpen=red;
+
+File: asy-faq.info, Node: Question 8.6, Next: Question 8.7, Previous: Question 8.5, Up: Section 8
+
+Question 8.6. What is the equivalent of the MetaPost whatever command?
+
+Asymptote does not implicitly solve linear equations and therefore does
+not have the notion of a whatever unknown. Such a facility could certainly
+be added (perhaps using the notation ?= since = means assignment).
+However, the most common uses of whatever in MetaPost are covered by
+functions like extension in math.asy:
+pair extension(pair P, pair Q, pair p, pair q);
+this returns the intersection point of the extensions of the line segments
+PQ and pq. We find using routines like extension more explicit and less
+confusing to new users. But we could be persuaded to add something similar
+if someone can justify the need. In the meantime, one can always use the
+explicit built-in linear solver solve (see
+https://asymptote.sourceforge.io/doc/solve.html), which uses LU
+decomposition.
+
+
+File: asy-faq.info, Node: Question 8.7, Next: Question 8.8, Previous: Question 8.6, Up: Section 8
+
+Question 8.7. What is the equivalent for the MetaPost command for lray - horiz*v - verti*u = whatever*(LightSource - R), a system of three linear equations for three unknowns: horiz, verti, whatever?
+
+Since horiz*v+verti*u spans a plane, you could use
+real intersect(vector P, vector Q, vector n, vector Z);
+to find the intersection time for the line lray-whatever*(LightSource -
+R) and then extract the three desired values from there. (You'll still
+need to use the built-in explicit linear solver to solve a 2x2 system to
+get horiz and verti.)
+
+
+File: asy-faq.info, Node: Question 8.8, Next: Question 8.9, Previous: Question 8.7, Up: Section 8
+
+Question 8.8. In MetaPost, it is possible to have a drawing remain the same size in different pictures by defining a unit u and explicitly multiply all the coordinates by u. Is there a better way to do this in Asymptote?
+
+Yes, Asymptote has a better way: you definitely don't want to manually
+scale all of your coordinates. To make the user coordinates represent
+multiples of exactly 1cm:
+
+unitsize(1cm);
+draw(unitsquare);
+One can also specify different x and y unit sizes:
+
+unitsize(x=1cm,y=2cm);
+draw(unitsquare);
+Another way is to draw your fixed size object to a frame and add it to
+currentpicture like this:
+
+path p=(0,0)--(1,0);
+frame object;
+draw(object,scale(100)*p);
+
+add(object);
+add(object,(0,-10));
+To understand the difference between frames and pictures, try this:
+
+size(300,300);
+
+path p=(0,0)--(1,0);
+picture object;
+draw(object,scale(100)*p);
+
+add(object);
+add(object,(0,-10)); // Adds truesize object to currentpicture
+
+File: asy-faq.info, Node: Question 8.9, Next: Question 9.1, Previous: Question 8.8, Up: Section 8
+
+Question 8.9. In MetaPost, one could produce tiling pictures by generating a picture, and then clipping the picture to a rectangle of fixed dimensions around the center of the picture. How is that done in Asymptote?
+
+If you are using currentpicture the way one would in MetaPost (drawing in
+raw PostScript coordinates), you can simply do something like:
+
+fill((0,0)--(100,100)--(200,0)--cycle);
+
+pair center(picture pic=currentpicture) {return 0.5*(pic.min()+pic.max());}
+
+real height=100;
+real width=100;
+pair delta=0.5(width,height);
+pair c=center();
+clip(box(c-delta,c+delta));
+However, drawing in PostScript coordinates is often inconvenient. Here's
+the Asymptote way of doing the same thing, using deferred drawing:
+
+size(200,100);
+fill((0,0)--(1,1)--(2,0)--cycle);
+
+void clip(picture pic=currentpicture, real width, real height)
+{
+ pic.clip(new void (frame f, transform) {
+ pair center=0.5(min(f)+max(f));
+ pair delta=0.5(width,height);
+ clip(f,box(center-delta,center+delta));
+ });
+}
+
+clip(100,100);
+See also the discussion of tilings in the documentation:
+https://asymptote.sourceforge.io/doc/Pens.html.
+
+
+File: asy-faq.info, Node: Section 9, Previous: Section 8, Up: Top
+
+Questions about output
+
+* Menu:
+* Question 9.1:: How can I disable automatic invocation of the PS
+ viewer after an asy file is done processing?
+* Question 9.2:: How do I output jpeg images?
+* Question 9.3:: Can I embed bitmaps (photos) into my drawings and
+ position and scale them?
+* Question 9.4:: Does Asymptote support direct PDF output?
+* Question 9.5:: How to I produce large pictures of high quality in
+ raster format (e.g. png, giff etc).
+* Question 9.6:: Is it possible to produce multi-page documents with
+ asymptote?
+
+
+
+File: asy-faq.info, Node: Question 9.1, Next: Question 9.2, Previous: Question 8.9, Up: Section 9
+
+Question 9.1. How can I disable automatic invocation of the PS viewer after an asy file is done processing?
+
+It's actually not on by default, unless you happen to be using Microsoft
+Windows (because that is what most Microsoft Windows users expect).
+Microsoft Windows users can turn this feature off with the command-line
+option -noV or by putting
+
+import settings;
+interactiveView=false;
+batchView=false;
+in their config.asy file. See
+https://asymptote.sourceforge.io/doc/Options.html.
+
+
+File: asy-faq.info, Node: Question 9.2, Next: Question 9.3, Previous: Question 9.1, Up: Section 9
+
+Question 9.2. How do I output jpeg images?
+
+If you have the ImageMagick convert program installed, simply type
+
+asy -f jpg test.asy
+
+File: asy-faq.info, Node: Question 9.3, Next: Question 9.4, Previous: Question 9.2, Up: Section 9
+
+Question 9.3. Can I embed bitmaps (photos) into my drawings and position and scale them?
+
+Convert them to eps format and use the graphic(string) function just like
+a Label:
+
+label(graphic("file"),(0,0));
+See the example https://asymptote.sourceforge.io/gallery/orthocenter.asy
+and https://asymptote.sourceforge.io/doc/label.html.
+
+
+File: asy-faq.info, Node: Question 9.4, Next: Question 9.5, Previous: Question 9.3, Up: Section 9
+
+Question 9.4. Does Asymptote support direct PDF output?
+
+Yes, PDF output can be produced by the -f pdf option or -tex pdflatex
+option. This supports transparency, annotations, embedded movies, and
+U3D/PRC content.
+
+
+File: asy-faq.info, Node: Question 9.5, Next: Question 9.6, Previous: Question 9.4, Up: Section 9
+
+Question 9.5. How to I produce large pictures of high quality in raster format (e.g. png, giff etc).
+
+Try using some of the options to convert, mainly -geometry and -density.
+For example:
+convert -geometry 1000x3000 example.eps example.png
+You can also change the default resolution of the image with:
+convert -geometry 1000x3000 -density 300 -units PixelsPerInch example.eps example.png
+This does not change the number of pixels in the image, but just gives a
+hint as to how large each pixel should be displayed.
+
+If you include the -density option without the -geometry option, convert
+will keep the image size constant (so a 4cm x 3cm eps figure will
+generate a 4cm x 3cm png image).
+
+
+File: asy-faq.info, Node: Question 9.6, Previous: Question 9.5, Up: Section 9
+
+Question 9.6. Is it possible to produce multi-page documents with asymptote?
+
+Yes, simply call the newpage() function. This is used by the slide.asy
+package to produce high-quality slide presentations (easier to use than
+Prosper).
+
diff --git a/Build/source/utils/asymptote/doc/FAQ/bfnnconv.pl b/Build/source/utils/asymptote/doc/FAQ/bfnnconv.pl
new file mode 100755
index 00000000000..35a636b55e5
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/bfnnconv.pl
@@ -0,0 +1,302 @@
+#!/usr/bin/perl --
+# Copyright (C) 1993-1995 Ian Jackson.
+
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# It is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# (Note: I do not consider works produced using these BFNN processing
+# tools to be derivative works of the tools, so they are NOT covered
+# by the GPL. However, I would appreciate it if you credited me if
+# appropriate in any documents you format using BFNN.)
+
+@outputs=('ascii','info','html');
+
+while ($ARGV[0] =~ m/^\-/) {
+ $_= shift(@ARGV);
+ if (m/^-only/) {
+ @outputs= (shift(@ARGV));
+ } else {
+ warn "unknown option `$_' ignored";
+ }
+}
+
+$prefix= $ARGV[0];
+$prefix= 'stdin' unless length($prefix);
+$prefix =~ s/\.bfnn$//;
+
+if (open(O,"$prefix.xrefdb")) {
+ @xrefdb= <O>;
+ close(O);
+} else {
+ warn "no $prefix.xrefdb ($!)";
+}
+
+$section= -1;
+for $thisxr (@xrefdb) {
+ $_= $thisxr;
+ chop;
+ if (m/^Q (\w+) ((\d+)\.(\d+)) (.*)$/) {
+ $qrefn{$1}= $2;
+ $qreft{$1}= $5;
+ $qn2ref{$3,$4}= $1;
+ $maxsection= $3;
+ $maxquestion[$3]= $4;
+ } elsif (m/^S (\d+) /) {
+ $maxsection= $1;
+ $sn2title{$1}=$';
+ }
+}
+
+open(U,">$prefix.xrefdb-new");
+
+for $x (@outputs) { require("./m-$x.pl"); }
+
+&call('init');
+
+while (<>) {
+ chop;
+ next if m/^\\comment\b/;
+ if (!m/\S/) {
+ &call('endpara');
+ next;
+ }
+ if (s/^\\section +//) {
+ $line= $_;
+ $section++; $question=0;
+ print U "S $section $line\n";
+ $|=1; print "S$section",' 'x10,"\r"; $|=0;
+ &call('endpara');
+ &call('startmajorheading',"$section",
+ "Section $section",
+ $section<$maxsection ? "Section ".($section+1) : '',
+ $section>1 ? 'Section '.($section-1) : 'Top');
+ &text($line);
+ &call('endmajorheading');
+ if ($section) {
+ &call('endpara');
+ &call('startindex');
+ for $thisxr (@xrefdb) {
+ $_= $thisxr;
+ chop;
+ if (m/^Q (\w+) (\d+)\.(\d+) (.*)$/) {
+ $ref= $1; $num1= $2; $num2= $3; $text= $4;
+ next unless $num1 == $section;
+ &call('startindexitem',$ref,"Q$num1.$num2","Question $num1.$num2");
+ &text($text);
+ &call('endindexitem');
+ }
+ }
+ &call('endindex');
+ }
+ } elsif (s/^\\question \d{2}[a-z]{3}((:\w+)?) +//) {
+ $line= $_;
+ $question++;
+ $qrefstring= $1;
+ $qrefstring= "q_${section}_$question" unless $qrefstring =~ s/^://;
+ print U "Q $qrefstring $section.$question $line\n";
+ $|=1; print "Q$section.$question",' 'x10,"\r"; $|=0;
+ &call('endpara');
+ &call('startminorheading',$qrefstring,
+ "Question $section.$question",
+ $question < $maxquestion[$section] ? "Question $section.".($question+1) :
+ $section < $maxsection ? "Question ".($section+1).".1" : '',
+ $question > 1 ? "Question $section.".($question-1) :
+ $section > 1 ? "Question ".($section-1).'.'.($maxquestion[$section-1]) :
+ 'Top',
+ "Section $section");
+ &text("Question $section.$question. $line");
+ &call('endminorheading');
+ } elsif (s/^\\only +//) {
+ @saveoutputs= @outputs;
+ @outputs=();
+ for $x (split(/\s+/,$_)) {
+ push(@outputs,$x) if grep($x eq $_, @saveoutputs);
+ }
+ } elsif (s/^\\endonly$//) {
+ @outputs= @saveoutputs;
+ } elsif (s/^\\copyto +//) {
+ $fh= $';
+ while(<>) {
+ last if m/^\\endcopy$/;
+ while (s/^([^\`]*)\`//) {
+ print $fh $1;
+ m/([^\\])\`/ || warn "`$_'";
+ $_= $';
+ $cmd= $`.$1;
+ if($cmd =~ s/^%perl //) {
+ $it= eval($cmd);
+ } else {
+ $it= `$cmd`; chop $it;
+ }
+ print $fh $it;
+ }
+ print $fh $_;
+ }
+ } elsif (m/\\index$/) {
+ &call('startindex');
+ for $thisxr (@xrefdb) {
+ $_= $thisxr;
+ chop;
+ if (m/^Q (\w+) (\d+\.\d+) (.*)$/) {
+ $ref= $1; $num= $2; $text= $3;
+ &call('startindexitem',$ref,"Q$num","Question $num");
+ &text($text);
+ &call('endindexitem');
+ } elsif (m/^S (\d+) (.*)$/) {
+ $num= $1; $text= $2;
+ next unless $num;
+ &call('startindexmainitem',"s_$num",
+ "Section $num.","Section $num");
+ &text($text);
+ &call('endindexitem');
+ } else {
+ warn $_;
+ }
+ }
+ &call('endindex');
+ } elsif (m/^\\call-(\w+) +(\w+)\s*(.*)$/) {
+ $fn= $1.'_'.$2;
+ eval { &$fn($3); };
+ warn $@ if length($@);
+ } elsif (m/^\\call +(\w+)\s*(.*)$/) {
+ eval { &call($1,$2); };
+ warn $@ if length($@);
+ } elsif (s/^\\set +(\w+)\s*//) {
+ $svalue= $'; $svari= $1;
+ eval("\$user_$svari=\$svalue"); $@ && warn "setting $svalue failed: $@\n";
+ } elsif (m/^\\verbatim$/) {
+ &call('startverbatim');
+ while (<>) {
+ chop;
+ last if m/^\\endverbatim$/;
+ &call('verbatim',$_);
+ }
+ &call('endverbatim');
+ } else {
+ s/\.$/\. /;
+ &text($_." ");
+ }
+}
+
+print ' 'x25,"\r";
+&call('finish');
+rename("$prefix.xrefdb-new","$prefix.xrefdb") || warn "rename xrefdb: $!";
+exit 0;
+
+
+sub text {
+ local($in,$rhs,$word,$refn,$reft,$fn,$style);
+ $in= "$holdover$_[0]";
+ $holdover= '';
+ while ($in =~ m/\\/) {
+#print STDERR ">$`##$'\n";
+ $rhs=$';
+ &call('text',$`);
+ $_= $rhs;
+ if (m/^\w+ $/) {
+ $holdover= "\\$&";
+ $in= '';
+ } elsif (s/^fn\s+([^\s\\]*\w)//) {
+ $in= $_;
+ $word= $1;
+ &call('courier');
+ &call('text',$word);
+ &call('endcourier');
+ } elsif (s/^tab\s+(\d+)\s+//) {
+ $in= $_; &call('tab',$1);
+ } elsif (s/^nl\s+//) {
+ $in= $_; &call('newline');
+ } elsif (s/^qref\s+(\w+)//) {
+ $refn= $qrefn{$1};
+ $reft= $qreft{$1};
+ if (!length($refn)) {
+ warn "unknown question `$1'";
+ }
+ $in= "$`\\pageref:$1:$refn:$reft\\endpageref.$_";
+ } elsif (s/^pageref:(\w+):([^:\n]+)://) {
+ $in= $_;
+ &call('pageref',$1,$2);
+ } elsif (s/^endpageref\.//) {
+ $in= $_; &call('endpageref');
+ } elsif (s/^(\w+)\{//) {
+ $in= $_; $fn= $1;
+ eval { &call("$fn"); };
+ if (length($@)) { warn $@; $fn= 'x'; }
+ push(@styles,$fn);
+ } elsif (s/^\}//) {
+ $in= $_;
+ $fn= pop(@styles);
+ if ($fn ne 'x') { &call("end$fn"); }
+ } elsif (s/^\\//) {
+ $in= $_;
+ &call('text',"\\");
+ } elsif (s,^(\w+)\s+([-A-Za-z0-9.\@:/]*\w),,) {
+#print STDERR "**$&**$_\n";
+ $in= $_;
+ $style=$1; $word= $2;
+ &call($style);
+ &call('text',$word);
+ &call("end$style");
+ } else {
+ warn "unknown control `\\$_'";
+ $in= $_;
+ }
+ }
+ &call('text',$in);
+}
+
+
+sub call {
+ local ($fnbase, @callargs) = @_;
+ local ($coutput);
+ for $coutput (@outputs) {
+ if ($fnbase eq 'text' && eval("\@${coutput}_cmds")) {
+#print STDERR "special handling text (@callargs) for $coutput\n";
+ $evstrg= "\$${coutput}_args[\$#${coutput}_args].=\"\@callargs\"";
+ eval($evstrg);
+ length($@) && warn "call adding for $coutput (($evstrg)): $@";
+ } else {
+ $fntc= $coutput.'_'.$fnbase;
+ &$fntc(@callargs);
+ }
+ }
+}
+
+
+sub recurse {
+ local (@outputs) = $coutput;
+ local ($holdover);
+ &text($_[0]);
+}
+
+
+sub arg {
+#print STDERR "arg($_[0]) from $coutput\n";
+ $cmd= $_[0];
+ eval("push(\@${coutput}_cmds,\$cmd); push(\@${coutput}_args,'')");
+ length($@) && warn "arg setting up for $coutput: $@";
+}
+
+sub endarg {
+#print STDERR "endarg($_[0]) from $coutput\n";
+ $evstrg= "\$${coutput}_cmd= \$cmd= pop(\@${coutput}_cmds); ".
+ "\$${coutput}_arg= \$arg= pop(\@${coutput}_args); ";
+ eval($evstrg);
+ length($@) && warn "endarg extracting for $coutput (($evstrg)): $@";
+#print STDERR ">call $coutput $cmd $arg< (($evstrg))\n";
+ $evstrg= "&${coutput}_do_${cmd}(\$arg)";
+ eval($evstrg);
+ length($@) && warn "endarg running ${coutput}_do_${cmd} (($evstrg)): $@";
+}
diff --git a/Build/source/utils/asymptote/doc/FAQ/install-sh b/Build/source/utils/asymptote/doc/FAQ/install-sh
new file mode 100755
index 00000000000..6781b987bdb
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/install-sh
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/Build/source/utils/asymptote/doc/FAQ/m-ascii.pl b/Build/source/utils/asymptote/doc/FAQ/m-ascii.pl
new file mode 100644
index 00000000000..d05f8ed80d2
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/m-ascii.pl
@@ -0,0 +1,189 @@
+## ASCII output
+# Copyright (C) 1993-1995 Ian Jackson.
+
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# It is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# (Note: I do not consider works produced using these BFNN processing
+# tools to be derivative works of the tools, so they are NOT covered
+# by the GPL. However, I would appreciate it if you credited me if
+# appropriate in any documents you format using BFNN.)
+
+sub ascii_init {
+ open(ASCII,">$prefix.ascii");
+}
+
+sub ascii_startmajorheading {
+ print ASCII '='x79,"\n\n";
+ $ascii_status= 'h';
+ &ascii_text($_[0] ? "Section $_[0]. " : '');
+}
+
+sub ascii_startminorheading {
+ print ASCII '-'x79,"\n\n";
+ $ascii_status= 'h';
+}
+
+sub ascii_italic { &ascii_text('*'); }
+sub ascii_enditalic { $ascii_para .= '*'; }
+
+sub ascii_email { &ascii_text('<'); } sub ascii_endemail { &ascii_text('>'); }
+
+sub ascii_ftpon { } sub ascii_endftpon { }
+sub ascii_ftpin { } sub ascii_endftpin { }
+sub ascii_docref { } sub ascii_enddocref { }
+sub ascii_courier { } sub ascii_endcourier { }
+sub ascii_newsgroup { } sub ascii_endnewsgroup { }
+sub ascii_ftpsilent { $ascii_ignore++; }
+sub ascii_endftpsilent { $ascii_ignore--; }
+
+sub ascii_text {
+ return if $ascii_ignore;
+ if ($ascii_status eq '') {
+ $ascii_status= 'p';
+ }
+ $ascii_para .= $_[0];
+}
+
+sub ascii_tab {
+ local ($n) = $_[0]-length($ascii_para);
+ $ascii_para .= ' 'x$n if $n>0;
+}
+
+sub ascii_newline {
+ return unless $ascii_status eq 'p';
+ &ascii_writepara;
+}
+
+sub ascii_writepara {
+ local ($thisline, $thisword, $rest);
+ for (;;) {
+ last unless $ascii_para =~ m/\S/;
+ $thisline= $ascii_indentstring;
+ for (;;) {
+ last unless $ascii_para =~ m/^(\s*\S+)/;
+ unless (length($1) + length($thisline) < 75 ||
+ length($thisline) == length($ascii_indentstring)) {
+ last;
+ }
+ $thisline .= $1;
+ $ascii_para= $';
+ }
+ $ascii_para =~ s/^\s*//;
+ print ASCII $thisline,"\n";
+ $ascii_indentstring= $ascii_nextindent;
+ last unless length($ascii_para);
+ }
+ $ascii_status= ''; $ascii_para= '';
+}
+
+sub ascii_endpara {
+ return unless $ascii_status eq 'p';
+ &ascii_writepara;
+ print ASCII "\n";
+}
+
+sub ascii_endheading {
+ $ascii_para =~ s/\s*$//;
+ print ASCII "$ascii_para\n\n";
+ $ascii_status= '';
+ $ascii_para= '';
+}
+
+sub ascii_endmajorheading { &ascii_endheading(@_); }
+sub ascii_endminorheading { &ascii_endheading(@_); }
+
+sub ascii_startverbatim {
+ $ascii_vstatus= $ascii_status;
+ &ascii_writepara;
+}
+
+sub ascii_verbatim {
+ print ASCII $_[0],"\n";
+}
+
+sub ascii_endverbatim {
+ $ascii_status= $ascii_vstatus;
+}
+
+sub ascii_finish {
+ close(ASCII);
+}
+
+sub ascii_startindex { $ascii_status= ''; }
+sub ascii_endindex { $ascii_status= 'p'; }
+
+sub ascii_endindexitem {
+ printf ASCII " %-11s %-.66s\n",$ascii_left,$ascii_para;
+ $ascii_status= 'p';
+ $ascii_para= '';
+}
+
+sub ascii_startindexitem {
+ $ascii_left= $_[1];
+}
+
+sub ascii_startindexmainitem {
+ $ascii_left= $_[1];
+ print ASCII "\n" if $ascii_status eq 'p';
+}
+
+sub ascii_startindent {
+ $ascii_istatus= $ascii_status;
+ &ascii_writepara;
+ $ascii_indentstring= " $ascii_indentstring";
+ $ascii_nextindent= " $ascii_nextindent";
+}
+
+sub ascii_endindent {
+ $ascii_indentstring =~ s/^ //;
+ $ascii_nextindent =~ s/^ //;
+ $ascii_status= $ascii_istatus;
+}
+
+sub ascii_startpackedlist { $ascii_plc=0; }
+sub ascii_endpackedlist { &ascii_newline if !$ascii_plc; }
+sub ascii_packeditem {
+ &ascii_newline if !$ascii_plc;
+ &ascii_tab($ascii_plc*40+5);
+ $ascii_plc= !$ascii_plc;
+}
+
+sub ascii_startlist {
+ &ascii_endpara;
+ $ascii_indentstring= " $ascii_indentstring";
+ $ascii_nextindent= " $ascii_nextindent";
+}
+
+sub ascii_endlist {
+ &ascii_endpara;
+ $ascii_indentstring =~ s/^ //;
+ $ascii_nextindent =~ s/^ //;
+}
+
+sub ascii_item {
+ &ascii_newline;
+ $ascii_indentstring =~ s/ $/* /;
+}
+
+sub ascii_pageref {
+ &ascii_text("Q$_[1] \`");
+}
+
+sub ascii_endpageref {
+ &ascii_text("'");
+}
+
+1;
diff --git a/Build/source/utils/asymptote/doc/FAQ/m-html.pl b/Build/source/utils/asymptote/doc/FAQ/m-html.pl
new file mode 100644
index 00000000000..77cc2575040
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/m-html.pl
@@ -0,0 +1,344 @@
+## HTML output
+# Copyright (C) 1993-1995 Ian Jackson.
+# Modified by John Bowman 02Sep06: simply docref usage
+
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# It is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# (Note: I do not consider works produced using these BFNN processing
+# tools to be derivative works of the tools, so they are NOT covered
+# by the GPL. However, I would appreciate it if you credited me if
+# appropriate in any documents you format using BFNN.)
+
+use POSIX;
+
+%saniarray= ('<','lt', '>','gt', '&','amp', '"','quot');
+
+sub html_init {
+ $html_prefix = './'.$prefix;
+ $html_prefix =~ s:^\.//:/:;
+ system('rm','-r',"$html_prefix.html");
+ system('mkdir',"$html_prefix.html");
+ open(HTML,">$html_prefix.html/index.html");
+ print HTML "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n";
+ print HTML "<html>\n";
+ $html_needpara= -1;
+ $html_end='';
+ my $epoch=$ENV{SOURCE_DATE_EPOCH} || time;
+ $html_date=POSIX::strftime("%Y-%m-%d", gmtime($epoch));
+ $html_year=POSIX::strftime("%Y", gmtime($epoch));
+}
+
+sub html_startup {
+ print HTML <<END;
+<head><title>
+$user_title
+</title>
+<link rev="made" href="mailto:$user_authormail">
+<link rel="Contents" href="index.html">
+<link rel="Start" href="index.html">
+<META name="description"
+ content="Frequently asked questions and answers (FAQ) for Asymptote.">
+<link rel="Bookmark" title="Asymptote FAQ" href="index.html">
+<LINK rel="Bookmark" title="Asymptote Home Page"
+ href="https://asymptote.sourceforge.io">
+<LINK rel="Bookmark" title="Asymptote Manual"
+ href="https://asymptote.sourceforge.io/doc/">
+</head><body text="#000000" bgcolor="#FFFFFF"><h1>
+$user_title
+</h1>
+END
+ &html_readrefs($_[0]);
+ if (length($user_copyrightref)) {
+ local ($refn) = $qrefn{$user_copyrightref};
+ if (!length($refn)) {
+ warn "unknown question (copyright) `$user_copyrightref'";
+ }
+ $refn =~ m/(\d+)\.(\d+)/;
+ local ($s,$n) = ($1,$2);
+ $html_copyrighthref= ($s == $html_sectionn)?'':"section$s.html";
+ $html_copyrighthref.= "#$qn2ref{$s,$n}";
+ }
+}
+
+sub html_close {
+ print HTML $html_end,"<address>\n$user_author\n";
+ print HTML "- $html_date\n</address><br>\n";
+ print HTML "Extracted from $user_title,\n";
+ print HTML "<A href=\"$html_copyrighthref\">" if length($html_copyrighthref);
+ print HTML "Copyright &copy; $html_year $user_copyholder.";
+ print HTML "</A>" if length($html_copyrighthref);
+ print HTML "\n</body></html>\n";
+ close(HTML);
+}
+
+sub html_startmajorheading {
+ local ($ref, $this,$next,$back) = @_;
+ local ($nextt,$backt);
+ $this =~ s/^Section /section/; $html_sectionn= $ref;
+ $next =~ s/^Section /section/ && ($nextt= $sn2title{$'});
+ $back =~ s/^Section /section/ ? ($backt= $sn2title{$'}) : ($back='');
+ if ($html_sectionn) {
+ &html_close;
+ open(HTML,">$html_prefix.html/$this.html");
+ print HTML "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n";
+ print HTML "<html>\n";
+ $html_end= "<hr>\n";
+ $html_end.= "Next: <a href=\"$next.html\" rel=precedes>$nextt</a>.<br>\n"
+ if $next;
+ $html_end.= "Back: <a href=\"$back.html\" rev=precedes>$backt</a>.<br>\n"
+ if $back;
+ $html_end.= "<a href=\"index.html\" rev=subdocument>";
+ $html_end.= "Return to contents</a>.<p>\n";
+ print HTML <<END;
+<head><title>
+$user_brieftitle - Section $html_sectionn
+</title>
+<link rev="made" href="mailto:$user_authormail">
+<link rel="Contents" href="index.html">
+<link rel="Start" href="index.html">
+END
+ print HTML "<link rel=\"Next\" href=\"$next.html\">" if $next;
+ print HTML "<link rel=\"Previous\" href=\"$back.html\">" if $back;
+ print HTML <<END;
+<link rel="Bookmark" title="Asymptote FAQ" href="index.html">
+</head><body text="#000000" bgcolor="#FFFFFF"><h1>
+$user_brieftitle - Section $html_sectionn <br>
+END
+ $html_needpara= -1;
+ }
+ else {
+ print HTML "\n<h1>\n";
+ $html_needpara=-1;
+ }
+}
+
+sub html_endmajorheading {
+ print HTML "\n</h1>\n\n";
+ $html_needpara=-1;
+}
+
+sub html_startminorheading {
+ local ($ref, $this) = @_;
+ $html_needpara=0;
+ $this =~ m/^Question (\d+)\.(\d+)/;
+ local ($s,$n) = ($1,$2);
+ print HTML "\n<h2><A name=\"$qn2ref{$s,$n}\">\n";
+}
+
+sub html_endminorheading {
+ print HTML "\n</A></h2>\n\n";
+ $html_needpara=-1;
+}
+
+sub html_newsgroup { &arg('newsgroup'); }
+sub html_endnewsgroup { &endarg('newsgroup'); }
+sub html_do_newsgroup {
+ print HTML "<A href=\"news:$_[0]\"><code>$_[0]</code></A>";
+}
+
+sub html_email { &arg('email'); }
+sub html_endemail { &endarg('email'); }
+sub html_do_email {
+ print HTML "<A href=\"mailto:$_[0]\"><code>$_[0]</code></A>";
+}
+
+sub html_courier { print HTML "<code>" ; }
+sub html_endcourier { print HTML "</code>"; }
+sub html_italic { print HTML "<i>" ; }
+sub html_enditalic { print HTML "</i>" ; }
+
+sub html_docref { &arg('docref'); }
+sub html_enddocref { &endarg('docref'); }
+sub html_do_docref {
+ if (!defined($html_refval{$_[0]})) {
+# Modified by John Bowman 02Sep06: interpret the argument as an html reference
+# warn "undefined HTML reference $_[0]";
+# $html_refval{$n}='UNDEFINED';
+ print HTML "<A href=\"$_[0]\">";
+ } else {
+ print HTML "<A href=\"$html_refval{$_[0]}\">";
+ }
+ &recurse($_[0]);
+ print HTML "</A>";
+}
+
+sub html_readrefs {
+ local ($p);
+ open(HTMLREFS,"<$_[0]") || (warn("failed to open HTML refs $_[0]: $!"),return);
+ while(<HTMLREFS>) {
+ next if m/^\\\s/;
+ s/\s*\n$//;
+ if (s/^\\prefix\s*//) {
+ $p= $'; next;
+ } elsif (s/^\s*(\S.*\S)\s*\\\s*//) {
+ $_=$1; $v=$';
+ s/\\\\/\\/g;
+ $html_refval{$_}= $p.$v;
+ } else {
+ warn("cannot understand line in HTML refs >$_<");
+ }
+ }
+ close(HTMLREFS);
+}
+
+sub html_ftpsilent { &arg('ftpsilent'); }
+sub html_endftpsilent { &endarg('ftpsilent'); }
+sub html_do_ftpsilent {
+ if ($_[0] =~ m/:/) {
+ $html_ftpsite= $`;
+ $html_ftpdir= $'.'/';
+ } else {
+ $html_ftpsite= $_[0];
+ $html_ftpdir= '';
+ }
+}
+
+sub html_ftpon { &arg('ftpon'); }
+sub html_endftpon { &endarg('ftpon'); }
+sub html_do_ftpon {
+#print STDERR "ftpon($_[0])\n";
+ $html_ftpsite= $_[0]; $html_ftpdir= '';
+ print HTML "<code>";
+ &recurse($_[0]);
+ print HTML "</code>";
+}
+
+sub html_ftpin { &arg('ftpin'); }
+sub html_endftpin { &endarg('ftpin'); }
+sub html_do_ftpin {
+#print STDERR "ftpin($_[0])\n";
+ print HTML "<A href=\"ftp://$html_ftpsite$html_ftpdir$_[0]\"><code>";
+ &recurse($_[0]);
+ print HTML "</code></A>";
+}
+
+sub html_text {
+ print HTML "\n<p>\n" if $html_needpara > 0;
+ $html_needpara=0;
+ $html_stuff= &html_sanitise($_[0]);
+ while ($html_stuff =~ s/^(.{40,70}) //) {
+ print HTML "$1\n";
+ }
+ print HTML $html_stuff;
+}
+
+sub html_tab {
+ $htmltabignore++ || warn "html tab ignored";
+}
+
+sub html_newline { print HTML "<br>\n" ; }
+sub html_startverbatim { print HTML "<pre>\n" ; }
+sub html_verbatim { print HTML &html_sanitise($_[0]),"\n"; }
+sub html_endverbatim { print HTML "</pre>\n" ; $html_needpara= -1; }
+
+sub html_endpara {
+ $html_needpara || $html_needpara++;
+}
+
+sub html_finish {
+ &html_close;
+}
+
+sub html_startindex {
+ print HTML "<ul>\n";
+}
+
+sub html_endindex {
+ print HTML "</ul><hr>\n";
+}
+
+sub html_startindexitem {
+ local ($ref,$qval) = @_;
+ $qval =~ m/Q(\d+)\.(\d+)/;
+ local ($s,$n) = ($1,$2);
+ print HTML "<li><a href=\"";
+ print HTML ($s == $html_sectionn)?'':"section$s.html";
+ print HTML "#$qn2ref{$s,$n}\" rel=subdocument>Q$s.$n. ";
+ $html_indexunhead='';
+}
+
+sub html_startindexmainitem {
+ local ($ref,$s) = @_;
+ $s =~ m/\d+/; $s= $&;
+ print HTML "<br><br>" if ($s > 1);
+ print HTML "<li><b><font size=\"+2\"><a href=\"section$s.html\" rel=subdocument>Section $s. ";
+ $html_indexunhead='</font></b>';
+}
+
+sub html_endindexitem {
+ print HTML "</a>$html_indexunhead\n";
+}
+
+sub html_startlist {
+ print HTML "\n";
+ $html_itemend="<ul>";
+}
+
+sub html_endlist {
+ print HTML "$html_itemend\n</ul>\n";
+ $html_needpara=-1
+}
+
+sub html_item {
+ print HTML "$html_itemend\n<li>";
+ $html_itemend="";
+ $html_needpara=-1;
+}
+
+sub html_startpackedlist {
+ print HTML "\n";
+ $html_itemend="<dir>";
+}
+
+sub html_endpackedlist {
+ print HTML "$html_itemend\n</dir>\n";
+ $html_needpara=-1;
+}
+
+sub html_packeditem {
+ print HTML "$html_itemend\n<li>";
+ $html_itemend="";
+ $html_needpara=-1;
+}
+
+sub html_startindent { print HTML "<blockquote>\n"; }
+sub html_endindent { print HTML "</blockquote>\n"; }
+
+sub html_pageref {
+ local ($ref,$sq) = @_;
+ $sq =~ m/(\d+)\.(\d+)/;
+ local ($s,$n) = ($1,$2);
+ print HTML "<A href=\"";
+ print HTML ($s == $html_sectionn)?'':"section$s.html";
+ print HTML "#$qn2ref{$s,$n}\">Q$sq \`";
+}
+
+sub html_endpageref {
+ print HTML "'</A>";
+}
+
+sub html_sanitise {
+ local ($in) = @_;
+ local ($out);
+ while ($in =~ m/[<>&"]/) {
+ $out.= $`. '&'. $saniarray{$&}. ';';
+ $in=$';
+ }
+ $out.= $in;
+ $out;
+}
+
+1;
diff --git a/Build/source/utils/asymptote/doc/FAQ/m-info.pl b/Build/source/utils/asymptote/doc/FAQ/m-info.pl
new file mode 100644
index 00000000000..cfa2515ae11
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/m-info.pl
@@ -0,0 +1,226 @@
+## Info output
+# Copyright (C) 1993-1995 Ian Jackson.
+
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# It is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# (Note: I do not consider works produced using these BFNN processing
+# tools to be derivative works of the tools, so they are NOT covered
+# by the GPL. However, I would appreciate it if you credited me if
+# appropriate in any documents you format using BFNN.)
+
+sub info_init {
+ open(INFO,">$prefix.info");
+ print INFO <<END;
+Info file: $prefix.info, -*-Text-*-
+produced by bfnnconv.pl from the Bizarre Format With No Name.
+
+END
+}
+
+sub info_heading {
+ # refstring Node Next Previous Up
+ print INFO "\nFile: $prefix.info, Node: $_[1]";
+ print INFO ", Next: $_[2]" if length($_[2]);
+ print INFO ", Previous: $_[3]" if length($_[3]);
+ print INFO ", Up: $_[4]" if length($_[4]);
+ print INFO "\n\n";
+ $info_status= '';
+}
+
+sub info_startmajorheading {
+ return if $_[0] eq '0';
+ &info_heading('s_'.$_[0],@_[1..$#_],'Top');
+}
+
+sub info_startminorheading {
+ &info_heading(@_);
+}
+
+sub info_italic { &info_text('*'); }
+sub info_enditalic { $info_para .= '*'; }
+
+sub info_email { &info_text('<'); } sub info_endemail { &info_text('>'); }
+
+sub info_ftpon { } sub info_endftpon { }
+sub info_ftpin { } sub info_endftpin { }
+sub info_docref { } sub info_enddocref { }
+sub info_courier { } sub info_endcourier { }
+sub info_newsgroup { } sub info_endnewsgroup { }
+sub info_ftpsilent { $info_ignore++; }
+sub info_endftpsilent { $info_ignore--; }
+
+sub info_text {
+ return if $info_ignore;
+ if ($info_status eq '') {
+ $info_status= 'p';
+ }
+ $info_para .= $_[0];
+}
+
+sub info_tab {
+ local ($n) = $_[0]-length($info_para);
+ $info_para .= ' 'x$n if $n>0;
+}
+
+sub info_newline {
+ return unless $info_status eq 'p';
+ print INFO &info_writepara;
+}
+
+sub info_writepara {
+ local ($thisline, $thisword, $rest, $output);
+ for (;;) {
+ last unless $info_para =~ m/\S/;
+ $thisline= $info_indentstring;
+ for (;;) {
+ last unless $info_para =~ m/^(\s*\S+)/;
+ unless (length($1) + length($thisline) < 75 ||
+ length($thisline) == length($info_indentstring)) {
+ last;
+ }
+ $thisline .= $1;
+ $info_para= $';
+ }
+ $info_para =~ s/^\s*//;
+ $output.= $thisline."\n";
+ $info_indentstring= $info_nextindent;
+ last unless length($info_para);
+ }
+ $info_status= ''; $info_para= '';
+ return $output;
+}
+
+sub info_endpara {
+ return unless $info_status eq 'p';
+ print INFO &info_writepara;
+ print INFO "\n";
+}
+
+sub info_endheading {
+ $info_para =~ s/\s*$//;
+ print INFO "$info_para\n\n";
+ $info_status= '';
+ $info_para= '';
+}
+
+sub info_endmajorheading { &info_endheading(@_); }
+sub info_endminorheading { &info_endheading(@_); }
+
+sub info_startverbatim {
+ print INFO &info_writepara;
+}
+
+sub info_verbatim {
+ print INFO $_[0],"\n";
+}
+
+sub info_endverbatim {
+ $info_status= $info_vstatus;
+}
+
+sub info_finish {
+ close(INFO);
+}
+
+sub info_startindex {
+ &info_endpara;
+ $info_moredetail= '';
+ $info_status= '';
+}
+
+sub info_endindex {
+ print INFO "$info_moredetail\n" if length($info_moredetail);
+}
+
+sub info_endindexitem {
+ $info_indentstring= sprintf("* %-17s ",$info_label.'::');
+ $info_nextindent= ' 'x20;
+ local ($txt);
+ $txt= &info_writepara;
+ if ($info_main) {
+ print INFO $label.$txt;
+ $txt =~ s/^.{20}//;
+ $info_moredetail.= $txt;
+ } else {
+ $info_moredetail.= $label.$txt;
+ }
+ $info_indentstring= $info_nextindent= '';
+ $info_status='p';
+}
+
+sub info_startindexitem {
+ print INFO "* Menu:\n" if $info_status eq '';
+ $info_status= '';
+ $info_label= $_[2];
+ $info_main= 0;
+}
+
+sub info_startindexmainitem {
+ print INFO "* Menu:\n" if $info_status eq '';
+ $info_label= $_[2];
+ $info_main= 1;
+ $info_moredetail .= "\n$_[2], ";
+ $info_status= '';
+}
+
+sub info_startindent {
+ $info_istatus= $info_status;
+ print INFO &info_writepara;
+ $info_indentstring= " $info_indentstring";
+ $info_nextindent= " $info_nextindent";
+}
+
+sub info_endindent {
+ $info_indentstring =~ s/^ //;
+ $info_nextindent =~ s/^ //;
+ $info_status= $info_istatus;
+}
+
+sub info_startpackedlist { $info_plc=0; }
+sub info_endpackedlist { &info_newline if !$info_plc; }
+sub info_packeditem {
+ &info_newline if !$info_plc;
+ &info_tab($info_plc*40+5);
+ $info_plc= !$info_plc;
+}
+
+sub info_startlist {
+ $info_istatus= $info_status;
+ print INFO &info_writepara;
+ $info_indentstring= " $info_indentstring";
+ $info_nextindent= " $info_nextindent";
+}
+
+sub info_endlist {
+ $info_indentstring =~ s/^ //;
+ $info_nextindent =~ s/^ //;
+ $info_status= $info_lstatus;
+}
+
+sub info_item {
+ &info_newline;
+ $info_indentstring =~ s/ $/* /;
+}
+
+sub info_pageref {
+ &info_text("*Note Question $_[1]:: \`");
+}
+
+sub info_endpageref {
+ &info_text("'");
+}
+
+1;
diff --git a/Build/source/utils/asymptote/doc/FAQ/m-lout.pl b/Build/source/utils/asymptote/doc/FAQ/m-lout.pl
new file mode 100644
index 00000000000..5c44852c750
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/m-lout.pl
@@ -0,0 +1,242 @@
+## Lout output
+# Copyright (C) 1993-1995 Ian Jackson.
+
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# It is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# (Note: I do not consider works produced using these BFNN processing
+# tools to be derivative works of the tools, so they are NOT covered
+# by the GPL. However, I would appreciate it if you credited me if
+# appropriate in any documents you format using BFNN.)
+
+sub lout_init {
+ open(LOUT,">$prefix.lout");
+ chop($dprint= `date '+%d %B %Y'`);
+ $dprint =~ s/^0//;
+}
+
+sub lout_startup {
+ local ($lbs) = &lout_sanitise($user_brieftitle);
+ print LOUT <<END;
+\@SysInclude{ fontdefs }
+\@SysInclude{ langdefs }
+\@SysInclude{ dl }
+\@SysInclude{ docf }
+\@Use { \@DocumentLayout
+ \@OddTop { \@Null }
+ \@EvenTop { \@Null }
+ \@StartOddTop { \@Null }
+ \@StartEvenTop { \@Null }
+ \@OddFoot { { $lbs } \@Centre{ - \@PageNum - } \@Right{ $dprint } }
+ \@EvenFoot { { $lbs } \@Centre{ - \@PageNum - } \@Right{ $dprint } }
+ \@StartOddFoot { { $lbs } \@Centre{ - \@PageNum - } \@Right{ $dprint } }
+ \@StartEvenFoot { { $lbs } \@Centre{ - \@PageNum - } \@Right{ $dprint } }
+ \@ParaGap { 1.70vx }
+ \@InitialBreak { 1.0fx ragged hyphen }
+}
+\@Use { \@OrdinaryLayout }
+END
+ $lout_textstatus= 'p';
+}
+
+sub lout_pageref {
+ print LOUT "Q$_[1] (page {\@PageOf{$_[0]}}) ";
+ &lout_text("\`");
+}
+
+sub lout_endpageref {
+ &lout_text("'");
+}
+
+sub lout_finish {
+ print LOUT "\@End \@Text\n";
+ close(L);
+}
+
+sub lout_startmajorheading {
+ $lout_styles .= 'h';
+ print LOUT <<END
+\@CNP
+{
+ newpath 0 ysize 0.3 ft sub moveto
+ xsize 0 rlineto
+ 0 0.2 ft rlineto
+ xsize neg 0 rlineto
+ closepath fill
+} \@Graphic { //1.6f \@HAdjust \@Heading{
+END
+ ;
+ $endh= "}\n{\@PageMark s_$_[0]}\n/1.0fo\n";
+ &lout_text($_[0] ? "Section $_[0]. " : '');
+}
+
+sub lout_startminorheading {
+ $lout_styles .= 'h';
+ print LOUT "//0.2f \@CNP {\@PageMark $_[0]} \@Heading{\n";
+ $endh= '';
+}
+
+sub lout_endheading {
+ $lout_styles =~ s/.$//; print LOUT "}\n$endh";
+ $lout_status= 'p';
+}
+
+sub lout_endmajorheading { &lout_endheading(@_); }
+sub lout_endminorheading { &lout_endheading(@_); }
+
+sub lout_courier {
+ $lout_styles .= 'f';
+ print LOUT "{{0.7 1.0} \@Scale {Courier Bold} \@Font {";
+}
+
+sub lout_endcourier {
+ $lout_styles =~ s/.$//; print LOUT "}}";
+}
+
+sub lout_italic { $lout_styles .= 'f'; print LOUT "{Slope \@Font {"; }
+sub lout_enditalic { $lout_styles =~ s/.$//; print LOUT "}}"; }
+
+sub lout_startindent { $lout_styles .= 'i'; print LOUT "\@IndentedDisplay {\n"; }
+
+sub lout_endindent {
+ &lout_endpara;
+ $lout_styles =~ s/.$//; print LOUT "}\n\@LP\n";
+}
+
+sub lout_startpackedlist { $lout_plc=-1; }
+sub lout_endpackedlist { &lout_newline if !$lout_plc; }
+sub lout_packeditem {
+ &lout_newline if !$lout_plc;
+ &lout_tab(($lout_plc>0)*40+5);
+ $lout_plc= !$lout_plc;
+}
+
+sub lout_startlist {
+ &lout_endpara;
+ print LOUT "\@RawIndentedList style {\@Bullet} indent {0.5i} gap {1.1vx}\n";
+ $lout_styles .= 'l';
+ $lout_status= '';
+}
+
+sub lout_endlist {
+ &lout_endpara;
+ print LOUT "\@EndList\n\n";
+ $lout_styles =~ s/.$//;
+}
+
+sub lout_item {
+ &lout_endpara;
+ print LOUT "\@ListItem{";
+ $lout_styles.= 'I';
+}
+
+sub lout_startindex {
+ print LOUT "//0.0fe\n";
+}
+
+sub lout_endindex {
+ $lout_status='p';
+}
+
+sub lout_startindexmainitem {
+ $lout_marker= $_[0];
+ $lout_status= '';
+ print LOUT "//0.3vx Bold \@Font \@HAdjust { \@HContract { { $_[1] } |3cx {";
+ $lout_iiendheight= '1.00';
+ $lout_styles .= 'X';
+}
+
+sub lout_startindexitem {
+ $lout_marker= $_[0];
+ print LOUT "\@HAdjust { \@HContract { { $_[1] } |3cx {";
+ $lout_iiendheight= '0.95';
+ $lout_styles .= 'X';
+}
+
+sub lout_endindexitem {
+ print LOUT "} } |0c \@PageOf { $lout_marker } } //${lout_iiendheight}vx\n";
+ $lout_styles =~ s/.$//;
+}
+
+sub lout_email { &lout_courier; &lout_text('<'); }
+sub lout_endemail { &lout_text('>'); &lout_endcourier; }
+
+sub lout_ftpon { &lout_courier; } sub lout_endftpon { &lout_endcourier; }
+sub lout_ftpin { &lout_courier; } sub lout_endftpin { &lout_endcourier; }
+sub lout_docref { } sub lout_enddocref { }
+sub lout_ftpsilent { $lout_ignore++; }
+sub lout_endftpsilent { $lout_ignore--; }
+
+sub lout_newsgroup { &lout_courier; }
+sub lout_endnewsgroup { &lout_endcourier; }
+
+sub lout_text {
+ return if $lout_ignore;
+ $lout_status= 'p';
+ $_= &lout_sanitise($_[0]);
+ s/ $/\n/ unless $lout_styles =~ m/[fhX]/;
+ print LOUT $_;
+}
+
+sub lout_tab {
+ local ($size) = $_[0]*0.5;
+ print LOUT " |${size}ft ";
+}
+
+sub lout_newline {
+ print LOUT " //1.0vx\n";
+}
+
+sub lout_sanitise {
+ local ($in) = @_;
+ local ($out);
+ $in= ' '.$in.' ';
+ $out='';
+ while ($in =~ m/(\s)(\S*[\@\/|\\\"\^\&\{\}\#]\S*)(\s)/) {
+ $out .= $`.$1;
+ $in = $3.$';
+ $_= $2;
+ s/[\\\"]/\\$&/g;
+ $out .= '"'.$_.'"';
+ }
+ $out .= $in;
+ $out =~ s/^ //; $out =~ s/ $//;
+ $out;
+}
+
+sub lout_endpara {
+ return if $lout_status eq '';
+ if ($lout_styles eq '') {
+ print LOUT "\@LP\n\n";
+ } elsif ($lout_styles =~ s/I$//) {
+ print LOUT "}\n";
+ }
+ $lout_status= '';
+}
+
+sub lout_startverbatim {
+ print LOUT "//0.4f\n\@RawIndentedDisplay lines \@Break".
+ " { {0.7 1.0} \@Scale {Courier Bold} \@Font {\n";
+}
+
+sub lout_verbatim {
+ $_= $_[0];
+ s/^\s*//;
+ print LOUT &lout_sanitise($_),"\n";
+}
+
+sub lout_endverbatim { print LOUT "}\n}\n//0.4f\n"; }
+
+1;
diff --git a/Build/source/utils/asymptote/doc/FAQ/m-post.pl b/Build/source/utils/asymptote/doc/FAQ/m-post.pl
new file mode 100644
index 00000000000..e41c8d84fe4
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/FAQ/m-post.pl
@@ -0,0 +1,189 @@
+## POST output
+# Copyright (C) 1993-1995 Ian Jackson.
+
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# It is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# (Note: I do not consider works produced using these BFNN processing
+# tools to be derivative works of the tools, so they are NOT covered
+# by the GPL. However, I would appreciate it if you credited me if
+# appropriate in any documents you format using BFNN.)
+
+sub post_init {
+ open(POST,">$prefix.post");
+}
+
+sub post_startmajorheading {
+ print POST '='x79,"\n\n";
+ $post_status= 'h';
+ &post_text($_[0] ? "Section $_[0]. " : '');
+}
+
+sub post_startminorheading {
+ print POST '-'x77,"\n\n";
+ $post_status= 'h';
+}
+
+sub post_italic { &post_text('*'); }
+sub post_enditalic { $post_para .= '*'; }
+
+sub post_email { &post_text('<'); } sub post_endemail { &post_text('>'); }
+
+sub post_ftpon { } sub post_endftpon { }
+sub post_ftpin { } sub post_endftpin { }
+sub post_docref { } sub post_enddocref { }
+sub post_courier { } sub post_endcourier { }
+sub post_newsgroup { } sub post_endnewsgroup { }
+sub post_ftpsilent { $post_ignore++; }
+sub post_endftpsilent { $post_ignore--; }
+
+sub post_text {
+ return if $post_ignore;
+ if ($post_status eq '') {
+ $post_status= 'p';
+ }
+ $post_para .= $_[0];
+}
+
+sub post_tab {
+ local ($n) = $_[0]-length($post_para);
+ $post_para .= ' 'x$n if $n>0;
+}
+
+sub post_newline {
+ return unless $post_status eq 'p';
+ &post_writepara;
+}
+
+sub post_writepara {
+ local ($thisline, $thisword, $rest);
+ for (;;) {
+ last unless $post_para =~ m/\S/;
+ $thisline= $post_indentstring;
+ for (;;) {
+ last unless $post_para =~ m/^(\s*\S+)/;
+ unless (length($1) + length($thisline) < 75 ||
+ length($thisline) == length($post_indentstring)) {
+ last;
+ }
+ $thisline .= $1;
+ $post_para= $';
+ }
+ $post_para =~ s/^\s*//;
+ print POST $thisline,"\n";
+ $post_indentstring= $post_nextindent;
+ last unless length($post_para);
+ }
+ $post_status= ''; $post_para= '';
+}
+
+sub post_endpara {
+ return unless $post_status eq 'p';
+ &post_writepara;
+ print POST "\n";
+}
+
+sub post_endheading {
+ $post_para =~ s/\s*$//;
+ print POST "$post_para\n\n";
+ $post_status= '';
+ $post_para= '';
+}
+
+sub post_endmajorheading { &post_endheading(@_); }
+sub post_endminorheading { &post_endheading(@_); }
+
+sub post_startverbatim {
+ $post_vstatus= $post_status;
+ &post_writepara;
+}
+
+sub post_verbatim {
+ print POST $_[0],"\n";
+}
+
+sub post_endverbatim {
+ $post_status= $post_vstatus;
+}
+
+sub post_finish {
+ close(POST);
+}
+
+sub post_startindex { $post_status= ''; }
+sub post_endindex { $post_status= 'p'; }
+
+sub post_endindexitem {
+ printf POST " %-11s %-.66s\n",$post_left,$post_para;
+ $post_status= 'p';
+ $post_para= '';
+}
+
+sub post_startindexitem {
+ $post_left= $_[1];
+}
+
+sub post_startindexmainitem {
+ $post_left= $_[1];
+ print POST "\n" if $post_status eq 'p';
+}
+
+sub post_startindent {
+ $post_istatus= $post_status;
+ &post_writepara;
+ $post_indentstring= " $post_indentstring";
+ $post_nextindent= " $post_nextindent";
+}
+
+sub post_endindent {
+ $post_indentstring =~ s/^ //;
+ $post_nextindent =~ s/^ //;
+ $post_status= $post_istatus;
+}
+
+sub post_startpackedlist { $post_plc=0; }
+sub post_endpackedlist { &post_newline if !$post_plc; }
+sub post_packeditem {
+ &post_newline if !$post_plc;
+ &post_tab($post_plc*40+5);
+ $post_plc= !$post_plc;
+}
+
+sub post_startlist {
+ &post_endpara;
+ $post_indentstring= " $post_indentstring";
+ $post_nextindent= " $post_nextindent";
+}
+
+sub post_endlist {
+ &post_endpara;
+ $post_indentstring =~ s/^ //;
+ $post_nextindent =~ s/^ //;
+}
+
+sub post_item {
+ &post_newline;
+ $post_indentstring =~ s/ $/* /;
+}
+
+sub post_pageref {
+ &post_text("Q$_[1] \`");
+}
+
+sub post_endpageref {
+ &post_text("'");
+}
+
+1;
diff --git a/Build/source/utils/asymptote/doc/GaussianSurface.asy b/Build/source/utils/asymptote/doc/GaussianSurface.asy
new file mode 100644
index 00000000000..bf198a6a243
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/GaussianSurface.asy
@@ -0,0 +1,21 @@
+import graph3;
+
+size(200,0);
+
+currentprojection=perspective(10,8,4);
+
+real f(pair z) {return 0.5+exp(-abs(z)^2);}
+
+draw((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle);
+
+draw(arc(0.12Z,0.2,90,60,90,25),ArcArrow3);
+
+surface s=surface(f,(-1,-1),(1,1),nx=5,Spline);
+
+xaxis3(Label("$x$"),red,Arrow3);
+yaxis3(Label("$y$"),red,Arrow3);
+zaxis3(XYZero(extend=true),red,Arrow3);
+
+draw(s,lightgray,meshpen=black+thick(),nolight,render(merge=true));
+
+label("$O$",O,-Z+Y,red);
diff --git a/Build/source/utils/asymptote/doc/HermiteSpline.asy b/Build/source/utils/asymptote/doc/HermiteSpline.asy
new file mode 100644
index 00000000000..86e66f9edd2
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/HermiteSpline.asy
@@ -0,0 +1,14 @@
+import graph;
+
+size(140mm,70mm,IgnoreAspect);
+scale(false);
+real[] x={1,3,4,5,6};
+real[] y={1,5,2,0,4};
+
+marker mark=marker(scale(1mm)*cross(6,false,r=0.35),red,Fill);
+
+draw(graph(x,y,Hermite),"Hermite Spline",mark);
+xaxis("$x$",Bottom,LeftTicks(x));
+yaxis("$y$",Left,LeftTicks);
+attach(legend(),point(NW),40S+30E,UnFill);
+
diff --git a/Build/source/utils/asymptote/doc/Hobbycontrol.asy b/Build/source/utils/asymptote/doc/Hobbycontrol.asy
new file mode 100644
index 00000000000..50662988e04
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/Hobbycontrol.asy
@@ -0,0 +1,20 @@
+size(200);
+pair z0=(0,0);
+pair z1=(0.5,3);
+pair z2=(2,1);
+
+path g=z0..z1..z2;
+
+pair d0=dir(g,0);
+pair d1=dir(g,1);
+draw(Label("$\omega_0$",1),z0-d0..z0+d0,blue+dashed,Arrow);
+draw(Label("$\omega_1$",1),z1-d1..z1+1.5d1,blue+dashed,Arrow);
+draw(z0--interp(z0,z1,1.5),dashed);
+draw(subpath(g,0,1),blue);
+draw("$\theta$",arc(z0,0.4,degrees(z1-z0),degrees(d0)),red,Arrow,
+ EndPenMargin);
+draw("$\phi$",arc(z1,1.05,degrees(z1-z0),degrees(d1)),red,Arrow,
+ EndPenMargin);
+
+dot("$z_0$",z0,SW,red);
+dot("$z_1$",z1,SE,red);
diff --git a/Build/source/utils/asymptote/doc/Hobbydir.asy b/Build/source/utils/asymptote/doc/Hobbydir.asy
new file mode 100644
index 00000000000..01d8a2e0ed0
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/Hobbydir.asy
@@ -0,0 +1,21 @@
+size(200);
+pair z0=(0,0);
+pair z1=(1,2);
+pair z2=(2,1);
+
+path g=z0..z1..z2;
+
+label("$\ell_k$",z0--z1);
+draw("$\ell_{k+1}$",z1--z2,dashed);
+draw(z0--interp(z0,z1,1.5),dashed);
+pair d1=dir(g,1);
+draw(z1-d1..z1+d1,blue+dashed);
+draw(g,blue);
+draw(Label("$\theta_k$",0.4),arc(z1,0.4,degrees(z2-z1),degrees(d1)),blue,Arrow,
+ EndPenMargin);
+draw("$\phi_k$",arc(z1,0.4,degrees(d1),degrees(z1-z0),CCW),Arrow,
+ EndPenMargin);
+
+dot("$z_{k-1}$",z0,red);
+dot("$z_k$",z1,NW,red);
+dot("$z_{k+1}$",z2,red);
diff --git a/Build/source/utils/asymptote/doc/Makefile.in b/Build/source/utils/asymptote/doc/Makefile.in
new file mode 100644
index 00000000000..8888df01453
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/Makefile.in
@@ -0,0 +1,126 @@
+MANFILES = asy.1 xasy.1x
+ASYFILES = $(filter-out $(wildcard latexusage-*.asy),$(wildcard *.asy))
+SOURCE = asymptote.texi version.texi options
+ASY = ../asy -dir ../base -config "" -render=0
+DOCFILES = asymptote.pdf asy-latex.pdf CAD.pdf TeXShopAndAsymptote.pdf \
+ asyRefCard.pdf
+
+docdir = $(DESTDIR)@docdir@
+infodir = $(DESTDIR)@infodir@
+datarootdir = @datarootdir@
+INSTALL = @INSTALL@
+TEXI2DVI = @TEXI2DVI@
+PERL5LIB = ./
+
+export docdir infodir INSTALL PERL5LIB
+
+all: doc
+
+asy-latex.pdf:
+ pdflatex asy-latex.dtx
+
+asymptote.sty:
+ pdflatex asy-latex.dtx
+
+dvi: doc asymptote.dvi
+
+doc: $(DOCFILES) asy.1 faq
+ cd png && $(MAKE) all
+
+manpage: $(MANFILES)
+
+man: $(DOCFILES) manpage
+ cd png && $(MAKE) asymptote.info
+
+faq:
+ cd FAQ && $(MAKE) faq
+
+%.eps: %.asy
+ $(ASY) -f eps $<
+
+%.pdf: %.asy
+ $(ASY) -f pdf -noprc $<
+
+latexusage.pdf: latexusage.tex asymptote.sty
+ rm -f latexusage-*
+ rm -f latexusage.pre
+ rm -f latexusage.aux
+ pdflatex latexusage
+ $(ASY) -noprc latexusage-*.asy
+ pdflatex latexusage
+
+options: ../settings.cc
+ $(ASY) -h 2>&1 | grep -iv Asymptote > options
+
+asy.1: options asy.1.begin asy.1.end
+ cat options | grep \^- | \
+ sed -e "s/-\(.*\) \([a-zA-Z0-9].*\)/.TP\n.B -\1\n\2\./" | \
+ sed -e "/^.B/ s/-/\\\\-/g" | cat asy.1.begin - asy.1.end > asy.1
+
+asymptote.dvi: $(SOURCE) $(ASYFILES:.asy=.eps) latexusage.pdf
+ ln -sf asymptote.texi asymptote_.texi
+ -$(TEXI2DVI) asymptote_.texi
+ mv asymptote_.dvi asymptote.dvi
+
+asymptote.pdf: $(SOURCE) $(ASYFILES:.asy=.pdf) latexusage.pdf
+ -$(TEXI2DVI) --pdf asymptote.texi
+
+CAD.pdf: CAD.tex CAD1.eps
+ pdflatex CAD
+ pdflatex CAD
+ pdflatex CAD
+
+TeXShopAndAsymptote.pdf: TeXShopAndAsymptote.tex
+ pdflatex TeXShopAndAsymptote
+ pdflatex TeXShopAndAsymptote
+
+asyRefCard.pdf: asyRefCard.tex
+ pdftex asyRefCard
+
+clean: FORCE
+ -rm -f asy-latex.{aux,idx,ins,log,toc}
+ -rm -f $(ASYFILES:.asy=.pdf)
+ -rm -f *.eps latexusage.{dvi,eps,pdf,log,aux,*.eps} latexusage-* \
+ latexusage.pre
+ -rm -f \
+ {asymptote,asymptote_}.{aux,cp,cps,dvi,fn,info,ky,log,pg,toc,tp,vr}
+ -rm -f asymptote_.texi
+ -rm -f {CAD,TeXShopAndAsymptote,asyRefCard}.{aux,dvi,log,toc}
+ -rm -f options asy.1
+ cd png && $(MAKE) clean
+
+install-man:
+ ${INSTALL} -d -m 755 $(docdir) $(mandir)/man1
+ ${INSTALL} -p -m 644 $(DOCFILES) $(docdir)
+ ${INSTALL} -p -m 644 $(MANFILES) $(mandir)/man1
+
+install: man faq install-man
+ cd png && $(MAKE) install
+ cd FAQ && $(MAKE) install
+
+install-prebuilt: install-man options
+ touch png/asymptote.info
+ cd png && $(MAKE) install
+ cd FAQ && $(MAKE) install-prebuilt
+
+install-all: $(DOCFILES) $(MANFILES) faq install-man
+ cd png && $(MAKE) install-all
+ cd FAQ && $(MAKE) install-info
+
+uninstall: uninstall-all
+
+uninstall-all:
+ cd png && $(MAKE) uninstall
+ cd FAQ && $(MAKE) uninstall
+ -cd $(mandir)/man1 && rm -f $(MANFILES)
+ -rm -f $(addprefix $(docdir)/,$(DOCFILES))
+
+distclean: FORCE clean
+ -rm -f version.texi Makefile
+ -rm -f $(DOCFILES)
+ cd png && $(MAKE) distclean
+ cd FAQ && $(MAKE) distclean
+FORCE:
+
+Makefile: Makefile.in
+ cd ..; config.status
diff --git a/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.pdf b/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.pdf
new file mode 100644
index 00000000000..157796687b0
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.pdf
Binary files differ
diff --git a/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.tex b/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.tex
new file mode 100644
index 00000000000..06ca7341524
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.tex
@@ -0,0 +1,94 @@
+\documentclass[11pt]{article}
+\usepackage{geometry}
+\geometry{letterpaper}
+
+\usepackage[parfill]{parskip}
+\usepackage{graphicx}
+\usepackage{amssymb}
+
+\title{Integrating Asymptote and TeXShop for Mac OS X}
+\author{Vishaal Rajani \& Cole Zmurchok \\ University of Alberta}
+\date{\today}
+
+
+\begin{document}
+\maketitle
+\begin{enumerate}
+\item Download Asymptote and place the \emph{asymptote-x.xx.src.tgz} file
+on the desktop.
+\item Open Terminal and type the following. Note that you will
+have to enter the root password for the final command.
+\begin{verbatim}
+cd Desktop
+gunzip asymptote-x.xx.src.tgz
+tar -xf asymptote-x.xx.src.tar
+cd asymptote-x.xx
+./configure
+make all
+sudo make install
+\end{verbatim}
+If you get an error at the \verb+./configure+ step, stating that you there
+is \verb+no acceptable C+ \verb+compiler found in $PATH+, a solution
+is to download and install Xcode here: \\
+\verb+http://developer.apple.com/TOOLS/Xcode/+.
+
+\item We now create the engine that will typeset Asymptote in TeXShop. The
+easiest way to create this engine, which we will
+call \emph{asyEngine.engine}, is to navigate
+to \verb+~/Library/TeXShop/Engines+ and duplicate one of the
+existing \emph{.engine} files. Open the duplicate file and delete the code
+there. Type the following:
+\begin{verbatim}
+#!/bin/sh
+location=$(dirname "$1")
+basename="${1%.tex}"
+#process
+cd $location
+pdflatex "$1"
+asy "${basename}"-*.asy
+pdflatex "$1"
+\end{verbatim}
+Save this file as \emph{asyEngine.engine}.
+
+\item Now we set our engine to be executable. In the terminal, navigate to
+the Engines directory and type:
+
+\begin{verbatim}
+chmod +x asyEngine.engine
+\end{verbatim}
+
+\item Finally, in the terminal, type:
+
+\begin{verbatim}
+defaults write TeXShop OtherTeXExtensions -array-add "asy"
+\end{verbatim}
+
+This last command allows you choose the \emph{asyEngine} option from the
+drop-down menu when you wish to typeset a document that includes asymptote.
+\end{enumerate}
+
+Now, if you wish to typeset something simple, like the following red line,
+create a new document in TeXShop and type:
+
+\begin{verbatim}
+\documentclass[letterpaper,12pt]{article}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage{asymptote}
+
+\begin{document}
+\begin{asy}
+ size(300);
+ draw((0,0)--(1,1),red);
+\end{asy}
+\end{document}
+\end{verbatim}
+
+Choose the \emph{asyEngine} option from the drop-down menu and
+press \emph{Typeset}. Your red line will be created in a PDF Document.
+
+On a final note, it is best to avoid using filenames with spaces in them.
+For example, avoid filenames such as \verb+asy test.tex+ and instead use
+filenames without spaces, such as \verb+asyTest.tex+.
+
+\end{document}
diff --git a/Build/source/utils/asymptote/doc/asy-latex.dtx b/Build/source/utils/asymptote/doc/asy-latex.dtx
new file mode 100644
index 00000000000..7cdc5c5771b
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asy-latex.dtx
@@ -0,0 +1,714 @@
+% \iffalse
+%
+%<*internal>
+\begingroup
+%</internal>
+%<*batchfile>
+\input docstrip.tex
+\keepsilent
+\preamble
+____________________________
+The ASYMPTOTE package
+
+(C) 2003 Tom Prince
+(C) 2003-2021 John Bowman
+(C) 2010 Will Robertson
+
+Adapted from comment.sty
+
+Licence: GPL2+
+
+\endpreamble
+\nopostamble
+\askforoverwritefalse
+\generate{\file{asymptote.sty}{\from{\jobname.dtx}{pkg}}}
+%</batchfile>
+%<batchfile>\endbatchfile
+%<*internal>
+\generate{\file{\jobname.ins}{\from{\jobname.dtx}{batchfile}}}
+\edef\tmpa{plain}
+\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
+\endgroup
+\immediate\write18{makeindex -s gind.ist -o \jobname.ind \jobname.idx}
+\immediate\write18{makeindex -s gglo.ist -o \jobname.gls \jobname.glo}
+%</internal>
+%
+%<*driver>
+\ProvidesFile{asy-latex.dtx}
+%</driver>
+%<pkg>\ProvidesPackage{asymptote}
+%<*pkg>
+ [2021/02/06 v1.36 Asymptote style file for LaTeX]
+%</pkg>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{asy-latex.dtx}
+% \title{The \textsf{asymptote} package}
+% \author{%
+% John Bowman, Tom Prince, and Will Robertson
+% }
+% \date{\filedate\qquad\fileversion}
+% \maketitle
+% \begin{abstract}
+% This package provides integration of inline and external Asymptote
+% graphics within a \LaTeX\ document.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Introduction}
+%
+% This is the documentation for the \LaTeX\ package \texttt{asymptote}
+% which accompanies the Asymptote drawing package. For further details on
+% Asymptote, please see its documentation in \texttt{asymptote.pdf}.
+%
+% \section{User syntax}
+%
+% \subsection{Package loading and options}
+%
+% The package may take two options at load time: \texttt{inline} or
+% \texttt{attach}.
+% These options can also be set at any time with the
+% \cmd\asysetup\marg{options} command, or specified individually in the
+% optional argument to each \texttt{asy} environment or \texttt{asyinclude}
+% command.
+%
+% The \texttt{inline} option uses Asymptote's `inline' mode whereby
+% included graphics have their labels typeset in the environment of the
+% document they are contained within. Otherwise the Asymptote graphics are
+% self-contained and their formatting is independent of the document.
+%
+% The \texttt{attach} option allows generated graphics to be embedded
+% within the PDF using the \texttt{attachfile2} package; please load that
+% package separately if you wish to use it. The \texttt{attach} option
+% takes precedence over the \texttt{inline} option.
+%
+% This package produces quite a number of output files, which by default
+% are created in the same directory as the \LaTeX\ document that is being
+% compiled. To keep things more tidy, you can specify an output directory
+% for these files by defining the \cmd\asydir\ command. For example, if you
+% wish to store the figure files in the subdirectory \texttt{asytmp/}, the
+% you would write \verb|\renewcommand\asydir{asytmp}|.
+%
+% Alternatively (and tentatively), you may write \verb|dir=asytmp| in
+% either the \texttt{asy} environment options or the options to
+% \cmd\asysetup.
+%
+% \subsection{Commands for inserting Asymptote graphics}
+%
+% The main environment defined by the package is the \texttt{asy}
+% environment, in which verbatim Asymptote code is placed that will be
+% compiled for generating a graphic in the document. For example,
+% \begin{verbatim}
+% \begin{figure}
+% \begin{asy}[ <options> ]
+% <ASYMPTOTE CODE>
+% \end{asy}
+% \caption{...}\label{...}
+% \end{verbatim}
+%
+% If you have Asymptote code in a separate file, you can include it with
+% the \cmd\asyinclude\oarg{options}\marg{filename}\ command.
+%
+% For Asymptote code that should be included in \emph{every} graphic,
+% define it using the \texttt{asydef} environment.
+%
+% \subsection{Graphics options}
+%
+% Both the \texttt{asy} environment and the \cmd\asyinclude\ command take
+% optional parameters for controlling aspects of the graphics creation. In
+% addition to locally setting \texttt{inline} and \texttt{attach}, the
+% following options may also be used:
+% \begin{description}
+% \item[width] Width of the figure
+% \item[height] Height of the figure
+% \item[keepAspect] Maintain aspect ratio [default true]
+% \item[viewportwidth] Viewport width for 3D figures
+% \item[viewportheight] Viewport height for 3D figures
+% \end{description}
+% These may also be set globally using the \cmd\asysetup\ command.
+%
+% \section{Processing the document}
+%
+% After running \LaTeX\ on the document, it is necessary to process the
+% Asymptote graphics so they can be included in the next compilation. The
+% simplest procedure is a recipe such as
+% \begin{verbatim}
+% pdflatex mydoc
+% asy mydoc-*.asy
+% pdflatex mydoc
+% \end{verbatim}
+% This technique will recompile each graphic every time, however. To only
+% recompile graphics that have changed, use the \texttt{latexmk}
+% tool. Asymptote is distributed with a \texttt{latexmkrc} configuration
+% file; place this file in a place where \texttt{latexmk} will find it and
+% your document may be compiled, including the \texttt{asy} compilations,
+% with \texttt{latexmk mydoc} or \texttt{latexmk --pdf mydoc}.
+%
+% \section{Implementation}
+%
+% \iffalse
+%<*pkg>
+% \fi
+%
+% \begin{macrocode}
+\def\Asymptote{{\tt Asymptote}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\InputIfFileExists{\jobname.pre}{}{}
+% \end{macrocode}
+%
+% \subsection{Allocations}
+%
+% \paragraph{Allocations}
+%
+% \begin{macrocode}
+\newbox\ASYbox
+\newdimen\ASYdimen
+\newcounter{asy}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newwrite\AsyStream
+\newwrite\AsyPreStream
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newif\ifASYinline
+\newif\ifASYattach
+\newif\ifASYkeepAspect
+\ASYkeepAspecttrue
+% \end{macrocode}
+%
+% \subsection{Packages}
+%
+% \begin{macrocode}
+\RequirePackage{keyval}
+\RequirePackage{ifthen}
+\RequirePackage{color,graphicx}
+% \end{macrocode}
+%
+% \paragraph{Emulating packages}
+% We cannot assume that Asymptote users have recent
+% \TeX\ distributions. (E.g., Fedora until recently still shipped teTeX.)
+% So load \textsf{ifpdf} and \textsf{ifxetex} if they exist; otherwise,
+% emulate them.
+%
+% In due course, delete this code and just load the packages.
+% \begin{macrocode}
+\IfFileExists{ifpdf.sty}{
+ \RequirePackage{ifpdf}
+}{
+ \expandafter\newif\csname ifpdf\endcsname
+ \ifx\pdfoutput\@undefined\else
+ \ifcase\pdfoutput\else
+ \pdftrue
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\IfFileExists{ifxetex.sty}{
+ \RequirePackage{ifxetex}
+}{
+ \expandafter\newif\csname ifxetex\endcsname
+ \ifx\XeTeXversion\@undefined\else
+ \xetextrue
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macro}{\CatchFileDef}
+% Used for \cmd\asyinclude.
+% Note that the fallback definition is not as robust as the one provided by catchfile.
+% \begin{macrocode}
+\IfFileExists{catchfile.sty}{
+ \RequirePackage{catchfile}
+}{
+ \newcommand\CatchFileDef[3]{%
+ \begingroup
+ \everyeof{%
+ \ENDCATCHFILEMARKER
+ \noexpand
+ }%
+ \long\def\@tempa####1\ENDCATCHFILEMARKER{%
+ \endgroup
+ \def##1{####1}%
+ }%
+ ##3%
+ \expandafter\@tempa\@@input ##2\relax
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Ensuring attachfile2 is loaded if [attach] is requested}
+% \begin{macrocode}
+\newif\if@asy@attachfile@loaded
+% \end{macrocode}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifpackageloaded{attachfile2}{\@asy@attachfile@loadedtrue}{}%
+ \let\asy@check@attachfile\asy@check@attachfile@loaded
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand\asy@check@attachfile@loaded{%
+ \if@asy@attachfile@loaded\else
+ \PackageError{asymptote}{You must load the attachfile2 package}{^^J%
+ You have requested the [attach] option for some or all of your^^J%
+ Asymptote graphics, which requires the attachfile2 package.^^J%
+ Please load it in the document preamble.^^J%
+ }%
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand\asy@check@attachfile{%
+ \AtBeginDocument{\asy@check@attachfile@loaded}%
+ \let\asy@check@attachfile\@empty
+}
+% \end{macrocode}
+%
+% \paragraph{Macros}
+% \begin{macrocode}
+\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
+% \end{macrocode}
+%
+% \subsection{Package options}
+%
+% \begin{macrocode}
+\DeclareOption{inline}{%
+ \ASYinlinetrue
+}
+\DeclareOption{attach}{%
+ \asy@check@attachfile
+ \ASYattachtrue
+}
+\ProcessOptions*
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\asylatexdir{}
+\def\asydir{}
+\def\ASYasydir{}
+\def\ASYprefix{}
+% \end{macrocode}
+%
+%
+% \subsection{Testing for PDF output}
+% Note this is not quite the same as \cs{ifpdf}, since we still want PDF
+% output when using XeTeX.
+% \begin{macrocode}
+\newif\ifASYPDF
+\ifxetex
+ \ASYPDFtrue
+\else
+ \ifpdf
+ \ASYPDFtrue
+ \fi
+\fi
+\ifASYPDF
+ \def\AsyExtension{pdf}
+\else
+ \def\AsyExtension{eps}
+\fi
+% \end{macrocode}
+%
+% \subsection{Bug squashing}
+%
+% \begin{macrocode}
+\def\unquoteJobname#1"#2"#3\relax{%
+ \def\rawJobname{#1}%
+ \ifx\rawJobname\empty
+ \def\rawJobname{#2}%
+ \fi
+}
+\expandafter\unquoteJobname\jobname""\relax
+% \end{macrocode}
+% Work around jobname bug in MiKTeX 2.5 and 2.6:
+% Turn stars in file names (resulting from spaces, etc.) into minus signs
+% \begin{macrocode}
+\def\fixstar#1*#2\relax{%
+ \def\argtwo{#2}%
+ \ifx\argtwo\empty
+ \gdef\Jobname{#1}%
+ \else
+ \fixstar#1-#2\relax
+ \fi
+}
+\expandafter\fixstar\rawJobname*\relax
+% \end{macrocode}
+%
+% Work around bug in dvips.def: allow spaces in file names.
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \message{<#1>}%
+ \bgroup
+ \def\@tempa{!}%
+ \dimen@\Gin@req@width
+ \dimen@ii.1bp\relax
+ \divide\dimen@\dimen@ii
+ \@tempdima\Gin@req@height
+ \divide\@tempdima\dimen@ii
+ \special{PSfile=#1\space
+ llx=\Gin@llx\space
+ lly=\Gin@lly\space
+ urx=\Gin@urx\space
+ ury=\Gin@ury\space
+ \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
+ \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
+ \ifGin@clip clip\fi}%
+ \egroup
+}
+% \end{macrocode}
+%
+% \subsection{Input/Output}
+%
+% \begin{macrocode}
+\immediate\openout\AsyPreStream=\jobname.pre\relax
+\AtEndDocument{\immediate\closeout\AsyPreStream}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\WriteAsyLine#1{%
+ \immediate\write\AsyStream{\detokenize{#1}}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\globalASYdefs{}
+\def\WriteGlobalAsyLine#1{%
+ \expandafter\g@addto@macro
+ \expandafter\globalASYdefs
+ \expandafter{\detokenize{#1^^J}}%
+}
+% \end{macrocode}
+%
+% \subsection{Commands for verbatim processing environments}
+%
+% \begin{macrocode}
+\def\ProcessAsymptote#1{%
+ \begingroup
+ \def\CurrentAsymptote{#1}%
+ \let\do\@makeother \dospecials
+ \@makeother\^^L% and whatever other special cases
+ \catcode`\ =10
+ \endlinechar`\^^M \catcode`\^^M=12 \xAsymptote
+}
+% \end{macrocode}
+% Need lots of comment chars here because \meta{line end} is no longer a
+% space character.
+% \begin{macrocode}
+\begingroup
+ \catcode`\^^M=12 \endlinechar=-1\relax%
+ \gdef\xAsymptote{%
+ \expandafter\ProcessAsymptoteLine%
+ }
+ \gdef\ProcessAsymptoteLine#1^^M{%
+ \def\@tempa{#1}%
+ {%
+ \escapechar=-1\relax%
+ \xdef\@tempb{\string\\end\string\{\CurrentAsymptote\string\}}%
+ }%
+ \ifx\@tempa\@tempb%
+ \edef\next{\endgroup\noexpand\end{\CurrentAsymptote}}%
+ \else%
+ \ThisAsymptote{#1}%
+ \let\next\ProcessAsymptoteLine%
+ \fi%
+ \next%
+ }
+\endgroup
+\def\asy@init{%
+ \def\ASYlatexdir{}%
+ \ifx\asylatexdir\empty\else
+ \def\ASYlatexdir{\asylatexdir/}%
+ \fi
+ \ifx\asydir\empty\else
+ \def\ASYasydir{\asydir/}%
+ \fi
+ \def\ASYprefix{\ASYlatexdir\ASYasydir}%
+}
+% \end{macrocode}
+%
+% \subsection{User interface}
+%
+% \begin{macrocode}
+\newcommand\asy[1][]{%
+ \stepcounter{asy}%
+ \setkeys{ASYkeys}{#1}%
+% \end{macrocode}
+% Disable the "inline" option if "attach" is enabled:
+% \begin{macrocode}
+ \ifASYattach
+ \ASYinlinefalse
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \asy@init
+ \immediate\write\AsyPreStream{%
+ \noexpand\InputIfFileExists{%
+ \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}%
+ }%
+ \asy@write@graphic@header
+ \let\ThisAsymptote\WriteAsyLine
+ \ProcessAsymptote{asy}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\endasy{%
+ \asy@finalise@stream
+ \asy@input@graphic
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\asy@write@graphic@header{%
+ \immediate\openout\AsyStream=\ASYasydir\jobname-\the\c@asy.asy\relax
+ \gdef\AsyFile{\ASYprefix\Jobname-\the\c@asy}%
+ \immediate\write\AsyStream{%
+ if(!settings.multipleView) settings.batchView=false;^^J%
+ \ifxetex
+ settings.tex="xelatex";^^J%
+ \else\ifASYPDF
+ settings.tex="pdflatex";^^J%
+ \fi\fi
+ \ifASYinline
+ settings.inlinetex=true;^^J%
+ deletepreamble();^^J%
+ \fi
+ defaultfilename="\Jobname-\the\c@asy";^^J%
+ if(settings.render < 0) settings.render=4;^^J%
+ settings.outformat="";^^J%
+ \ifASYattach
+ settings.inlineimage=false;^^J%
+ settings.embed=false;^^J%
+ settings.toolbar=true;^^J%
+ \else
+ settings.inlineimage=true;^^J%
+ settings.embed=true;^^J%
+ settings.toolbar=false;^^J%
+ viewportmargin=(2,2);^^J%
+ \fi
+ \globalASYdefs
+ }%
+}
+\def\asy@expand@keepAspect{%
+ \ifASYkeepAspect keepAspect=true%
+ \else keepAspect=false%
+ \fi%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\asy@finalise@stream{%
+% \end{macrocode}
+% Setting \verb|size()|. Only inserted if one of the dimensions is
+% set explicitly (i.e., if both height and width are not empty).
+% \begin{macrocode}
+ \ifx\ASYwidth\@empty
+ \ifx\ASYheight\@empty
+ % write nothing!
+ \else
+ \immediate\write\AsyStream{size(0,\ASYheight,\asy@expand@keepAspect);}%
+ \fi
+ \else
+ \ifx\ASYheight\@empty
+ \immediate\write\AsyStream{size(\ASYwidth,0,\asy@expand@keepAspect);}%
+ \else
+ \immediate\write\AsyStream{size(\ASYwidth,\ASYheight,\asy@expand@keepAspect);}%
+ \fi
+ \fi
+% \end{macrocode}
+% Setting \verb|viewportsize=()|. Same logic as for \verb|size()|.
+% \begin{macrocode}
+ \ifx\ASYviewportwidth\@empty
+ \ifx\ASYviewportheight\@empty
+ % write nothing!
+ \else
+ \immediate\write\AsyStream{viewportsize=(0,\ASYviewportheight);}%
+ \fi
+ \else
+ \ifx\ASYviewportheight\@empty
+ \immediate\write\AsyStream{viewportsize=(\ASYviewportwidth,0);}%
+ \else
+ \immediate\write\AsyStream{%
+ viewportsize=(\ASYviewportwidth,\ASYviewportheight);}%
+ \fi
+ \fi
+ \immediate\closeout\AsyStream
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\asy@input@graphic{%
+ \ifASYinline
+ \IfFileExists{"\AsyFile.tex"}{%
+ \catcode`:=12\relax
+ \@@input"\AsyFile.tex"\relax
+ }{%
+ \PackageWarning{asymptote}{file `\AsyFile.tex' not found}%
+ }%
+ \else
+ \IfFileExists{"\AsyFile.\AsyExtension"}{%
+ \ifASYattach
+ \ifASYPDF
+ \IfFileExists{"\AsyFile+0.pdf"}{%
+ \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile+0.pdf}}%
+ }{%
+ \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile.pdf}}%
+ }%
+ \else
+ \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile.eps}}%
+ \fi
+ \textattachfile{\AsyFile.\AsyExtension}{\phantom{\copy\ASYbox}}%
+ \vskip-\ht\ASYbox
+ \indent
+ \box\ASYbox
+ \else
+ \ifASYPDF
+ \includegraphics[hiresbb]{\AsyFile.pdf}%
+ \else
+ \includegraphics[hiresbb]{\AsyFile.eps}%
+ \fi
+ \fi
+ }{%
+% \end{macrocode}
+% 3D PRC figures require inline mode.
+% \begin{macrocode}
+ \IfFileExists{"\AsyFile.tex"}{%
+ \catcode`:=12
+ \@@input"\AsyFile.tex"\relax
+ }{%
+ \PackageWarning{asymptote}{%
+ file `\AsyFile.\AsyExtension' not found%
+ }%
+ }%
+ }%
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\asydef{%
+ \let\ThisAsymptote\WriteGlobalAsyLine
+ \ProcessAsymptote{asydef}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand\asyinclude[2][]{%
+ \begingroup
+ \stepcounter{asy}%
+ \setkeys{ASYkeys}{#1}%
+ \ifASYattach
+ \ASYinlinefalse
+ \fi
+ \asy@init
+ \immediate\write\AsyPreStream{%
+ \noexpand\InputIfFileExists{%
+ \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}%
+ }%
+ \asy@write@graphic@header
+ \IfFileExists{#2.asy}{%
+ \CatchFileDef\@tempa{#2.asy}{%
+ \let\do\@makeother
+ \dospecials
+ \endlinechar=10\relax
+ }%
+ }{%
+ \IfFileExists{#2}{%
+ \CatchFileDef\@tempa{#2}{%
+ \let\do\@makeother
+ \dospecials
+ \endlinechar=10\relax
+ }%
+ }{%
+ \PackageWarning{asymptote}{file #2 not found}%
+ \def\@tempa{}%
+ }%
+ }%
+ \immediate\write\AsyStream{\unexpanded\expandafter{\@tempa}}%
+ \asy@finalise@stream
+ \asy@input@graphic
+ \endgroup
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand{\ASYanimategraphics}[5][]{%
+ \IfFileExists{_#3.pdf}{%
+ \animategraphics[{#1}]{#2}{_#3}{#4}{#5}%
+ }{}%
+}
+% \end{macrocode}
+%
+% \subsection{Keys for graphics processing}
+%
+% \begin{macrocode}
+\newcommand\asysetup[1]{\setkeys{ASYkeys}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\define@key{ASYkeys}{dir}{%
+ \def\asydir{#1}%
+}
+\def\ASYwidth{}
+\define@key{ASYkeys}{width}{%
+ \edef\ASYwidth{\the\dimexpr#1\relax}%
+}
+\def\ASYheight{}
+\define@key{ASYkeys}{height}{%
+ \edef\ASYheight{\the\dimexpr#1\relax}%
+}
+\define@key{ASYkeys}{keepAspect}[true]{%
+ \ifthenelse{\equal{#1}{true}}
+ {\ASYkeepAspecttrue}
+ {\ASYkeepAspectfalse}%
+}
+\def\ASYviewportwidth{}
+\define@key{ASYkeys}{viewportwidth}{%
+ \edef\ASYviewportwidth{\the\dimexpr#1\relax}%
+}
+\def\ASYviewportheight{}
+\define@key{ASYkeys}{viewportheight}{%
+ \edef\ASYviewportheight{\the\dimexpr#1\relax}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\define@key{ASYkeys}{inline}[true]{%
+ \ifthenelse{\equal{#1}{true}}
+ {\ASYinlinetrue}
+ {\ASYinlinefalse}%
+}
+\define@key{ASYkeys}{attach}[true]{%
+ \ifthenelse{\equal{#1}{true}}
+ {\ASYattachtrue}
+ {\ASYattachfalse}%
+}
+% \end{macrocode}
+%
+% \iffalse
+%</pkg>
+% \fi
+%
+% \Finale
+%
diff --git a/Build/source/utils/asymptote/doc/asy-latex.pdf b/Build/source/utils/asymptote/doc/asy-latex.pdf
new file mode 100644
index 00000000000..628bccc4dde
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asy-latex.pdf
Binary files differ
diff --git a/Build/source/utils/asymptote/doc/asy.1 b/Build/source/utils/asymptote/doc/asy.1
new file mode 100644
index 00000000000..4ad758ce371
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asy.1
@@ -0,0 +1,333 @@
+.\" Hey, EMACS: -*- nroff -*-
+.TH ASY 1 "1 Dec 2004"
+.SH NAME
+asy \- Asymptote: a script-based vector graphics language
+.SH SYNOPSIS
+.B asy
+.RI [ options ]
+.RI [ file \ ...]
+.SH DESCRIPTION
+\fBAsymptote\fP is a powerful descriptive vector graphics language for
+technical drawings, inspired by MetaPost but with an improved C++-like syntax.
+Asymptote provides for figures the same high-quality level of typesetting that
+LaTeX does for scientific text.
+.SH OPTIONS
+If no arguments are given, Asymptote runs in interactive mode.
+.PP
+If "\-" is given as the file argument, Asymptote reads from standard input.
+.PP
+A summary of options is included below. The effect of most options
+can be negated by prepending
+.B no
+to the option name.
+Default values for most options may also be entered in the
+file
+.B .asy/config.asy
+in the user's home directory using the long form:
+.PP
+ import settings;
+ batchView=true;
+.PP
+For a complete
+description, see the Info files.
+.TP
+.B \-V,\-View
+View output; command-line only.
+.TP
+.B \-absolute
+Use absolute WebGL dimensions [false].
+.TP
+.B \-a,\-align C|B|T|Z
+Center, Bottom, Top, or Zero page alignment [C].
+.TP
+.B \-aligndir pair
+Directional page alignment (overrides align) [(0,0)].
+.TP
+.B \-antialias n
+Antialiasing width for rasterized output [2].
+.TP
+.B \-auto3D
+Automatically activate 3D scene [true].
+.TP
+.B \-autobillboard
+3D labels always face viewer by default [true].
+.TP
+.B \-autoimport string
+Module to automatically import.
+.TP
+.B \-autoplain
+Enable automatic importing of plain [true].
+.TP
+.B \-autoplay
+Autoplay 3D animations [false].
+.TP
+.B \-autorotate
+Enable automatic PDF page rotation [false].
+.TP
+.B \-axes3
+Show 3D axes in PDF output [true].
+.TP
+.B \-batchMask
+Mask fpu exceptions in batch mode [false].
+.TP
+.B \-batchView
+View output in batch mode [false].
+.TP
+.B \-bw
+Convert all colors to black and white [false].
+.TP
+.B \-cd directory
+Set current directory; command-line only.
+.TP
+.B \-cmyk
+Convert rgb colors to cmyk [false].
+.TP
+.B \-c,\-command string
+Command to autoexecute.
+.TP
+.B \-compact
+Conserve memory at the expense of speed [false].
+.TP
+.B \-compress
+Compress images in PDF output [true].
+.TP
+.B \-d,\-debug
+Enable debugging messages [false].
+.TP
+.B \-devicepixelratio n
+Ratio of physical to logical pixels [1].
+.TP
+.B \-digits n
+Default output file precision [7].
+.TP
+.B \-divisor n
+Garbage collect using purge(divisor=n) [2].
+.TP
+.B \-embed
+Embed rendered preview image [true].
+.TP
+.B \-envmap
+Enable environment map image-based lighting (Experimental) [false].
+.TP
+.B \-exitonEOF
+Exit interactive mode on EOF [true].
+.TP
+.B \-fitscreen
+Fit rendered image to screen [true].
+.TP
+.B \-framedelay ms
+Additional frame delay [0].
+.TP
+.B \-framerate frames/s
+Animation speed [30].
+.TP
+.B \-globalread
+Allow read from other directory [true].
+.TP
+.B \-globalwrite
+Allow write to other directory [false].
+.TP
+.B \-gray
+Convert all colors to grayscale [false].
+.TP
+.B \-h,\-help
+Show summary of options; command-line only.
+.TP
+.B \-historylines n
+Retain n lines of history [1000].
+.TP
+.B \-iconify
+Iconify rendering window [false].
+.TP
+.B \-inlineimage
+Generate inline embedded image [false].
+.TP
+.B \-inlinetex
+Generate inline TeX code [false].
+.TP
+.B \-interactiveMask
+Mask fpu exceptions in interactive mode [true].
+.TP
+.B \-interactiveView
+View output in interactive mode [true].
+.TP
+.B \-interactiveWrite
+Write expressions entered at the prompt to stdout [true].
+.TP
+.B \-k,\-keep
+Keep intermediate files [false].
+.TP
+.B \-keepaux
+Keep intermediate LaTeX .aux files [false].
+.TP
+.B \-level n
+Postscript level [3].
+.TP
+.B \-l,\-listvariables
+List available global functions and variables [false].
+.TP
+.B \-localhistory
+Use a local interactive history file [false].
+.TP
+.B \-loop
+Loop 3D animations [false].
+.TP
+.B \-m,\-mask
+Mask fpu exceptions; command-line only.
+.TP
+.B \-maxtile pair
+Maximum rendering tile size [(1024,768)].
+.TP
+.B \-maxviewport pair
+Maximum viewport size [(0,0)].
+.TP
+.B \-multiline
+Input code over multiple lines at the prompt [false].
+.TP
+.B \-multipleView
+View output from multiple batch-mode files [false].
+.TP
+.B \-multisample n
+Multisampling width for screen images [4].
+.TP
+.B \-offline
+Produce offline html files [false].
+.TP
+.B \-O,\-offset pair
+PostScript offset [(0,0)].
+.TP
+.B \-f,\-outformat format
+Convert each output file to specified format.
+.TP
+.B \-o,\-outname name
+Alternative output directory/filename.
+.TP
+.B \-p,\-parseonly
+Parse file [false].
+.TP
+.B \-pdfreload
+Automatically reload document in pdfviewer [false].
+.TP
+.B \-pdfreloaddelay usec
+Delay before attempting initial pdf reload [750000].
+.TP
+.B \-position pair
+Initial 3D rendering screen position [(0,0)].
+.TP
+.B \-prc
+Embed 3D PRC graphics in PDF output [true].
+.TP
+.B \-prompt string
+Prompt [> ].
+.TP
+.B \-prompt2 string
+Continuation prompt for multiline input [..].
+.TP
+.B \-q,\-quiet
+Suppress welcome text and noninteractive stdout [false].
+.TP
+.B \-render n
+Render 3D graphics using n pixels per bp (-1=auto) [-1].
+.TP
+.B \-resizestep step
+Resize step [1.2].
+.TP
+.B \-reverse
+reverse 3D animations [false].
+.TP
+.B \-rgb
+Convert cmyk colors to rgb [false].
+.TP
+.B \-safe
+Disable system call [true].
+.TP
+.B \-scroll n
+Scroll standard output n lines at a time [0].
+.TP
+.B \-shiftHoldDistance n
+WebGL touch screen distance limit for shift mode [20].
+.TP
+.B \-shiftWaitTime ms
+WebGL touch screen shift mode delay [200].
+.TP
+.B \-spinstep deg/s
+Spin speed [60].
+.TP
+.B \-svgemulation
+Emulate unimplemented SVG shading [true].
+.TP
+.B \-tabcompletion
+Interactive prompt auto-completion [true].
+.TP
+.B \-tex engine
+latex|pdflatex|xelatex|lualatex|tex|pdftex|luatex|context|none [latex].
+.TP
+.B \-thick
+Render thick 3D lines [true].
+.TP
+.B \-thin
+Render thin 3D lines [true].
+.TP
+.B \-threads
+Use POSIX threads for 3D rendering [true].
+.TP
+.B \-toolbar
+Show 3D toolbar in PDF output [true].
+.TP
+.B \-s,\-translate
+Show translated virtual machine code [false].
+.TP
+.B \-twice
+Run LaTeX twice (to resolve references) [false].
+.TP
+.B \-twosided
+Use two-sided 3D lighting model for rendering [true].
+.TP
+.B \-u,\-user string
+General purpose user string.
+.TP
+.B \-v,\-verbose
+Increase verbosity level (can specify multiple times) [0].
+.TP
+.B \-version
+Show version; command-line only.
+.TP
+.B \-vibrateTime ms
+WebGL shift mode vibrate duration [25].
+.TP
+.B \-viewportmargin pair
+Horizontal and vertical 3D viewport margin [(0.5,0.5)].
+.TP
+.B \-wait
+Wait for child processes to finish before exiting [false].
+.TP
+.B \-warn string
+Enable warning; command-line only.
+.TP
+.B \-where
+Show where listed variables are declared [false].
+.TP
+.B \-xasy
+Special interactive mode for xasy [false].
+.TP
+.B \-zoomPinchCap limit
+WebGL maximum zoom pinch [100].
+.TP
+.B \-zoomPinchFactor n
+WebGL zoom pinch sensitivity [10].
+.TP
+.B \-zoomfactor factor
+Zoom step factor [1.05].
+.TP
+.B \-zoomstep step
+Mouse motion zoom step [0.1].
+
+.SH SEE ALSO
+Asymptote is documented fully in the asymptote Info page.
+The manual can also be accessed in interactive mode with the "help" command.
+
+.SH AUTHOR
+Asymptote was written by Andy Hammerlindl, John Bowman, and Tom Prince.
+.PP
+This manual page was written by Hubert Chan for the Debian project (but may
+be used by others).
diff --git a/Build/source/utils/asymptote/doc/asy.1.begin b/Build/source/utils/asymptote/doc/asy.1.begin
new file mode 100644
index 00000000000..1a2232968ee
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asy.1.begin
@@ -0,0 +1,32 @@
+.\" Hey, EMACS: -*- nroff -*-
+.TH ASY 1 "1 Dec 2004"
+.SH NAME
+asy \- Asymptote: a script-based vector graphics language
+.SH SYNOPSIS
+.B asy
+.RI [ options ]
+.RI [ file \ ...]
+.SH DESCRIPTION
+\fBAsymptote\fP is a powerful descriptive vector graphics language for
+technical drawings, inspired by MetaPost but with an improved C++-like syntax.
+Asymptote provides for figures the same high-quality level of typesetting that
+LaTeX does for scientific text.
+.SH OPTIONS
+If no arguments are given, Asymptote runs in interactive mode.
+.PP
+If "\-" is given as the file argument, Asymptote reads from standard input.
+.PP
+A summary of options is included below. The effect of most options
+can be negated by prepending
+.B no
+to the option name.
+Default values for most options may also be entered in the
+file
+.B .asy/config.asy
+in the user's home directory using the long form:
+.PP
+ import settings;
+ batchView=true;
+.PP
+For a complete
+description, see the Info files.
diff --git a/Build/source/utils/asymptote/doc/asy.1.end b/Build/source/utils/asymptote/doc/asy.1.end
new file mode 100644
index 00000000000..24586d9d403
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asy.1.end
@@ -0,0 +1,10 @@
+
+.SH SEE ALSO
+Asymptote is documented fully in the asymptote Info page.
+The manual can also be accessed in interactive mode with the "help" command.
+
+.SH AUTHOR
+Asymptote was written by Andy Hammerlindl, John Bowman, and Tom Prince.
+.PP
+This manual page was written by Hubert Chan for the Debian project (but may
+be used by others).
diff --git a/Build/source/utils/asymptote/doc/asyRefCard.pdf b/Build/source/utils/asymptote/doc/asyRefCard.pdf
new file mode 100644
index 00000000000..ee61f55ceb2
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asyRefCard.pdf
Binary files differ
diff --git a/Build/source/utils/asymptote/doc/asyRefCard.tex b/Build/source/utils/asymptote/doc/asyRefCard.tex
new file mode 100644
index 00000000000..134acc4b88f
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asyRefCard.tex
@@ -0,0 +1,558 @@
+% Reference Card for Asymptote
+
+% Copyright (c) 2011 John C. Bowman. May be freely distributed.
+% Thanks to Stephen Gildea for the multicolumn macro package
+% and Joseph H. Silverman for the C Reference card.
+
+%**start of header
+\newcount\columnsperpage
+
+\overfullrule=0pt
+
+% This file can be printed with 1, 2, or 3 columns per page (see below).
+% [For 2 or 3 columns, you'll need 6 and 8 point fonts.]
+% Specify how many you want here. Nothing else needs to be changed.
+
+\columnsperpage=2
+
+% This reference card is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+% This file is intended to be processed by plain TeX (TeX82).
+%
+% The final reference card has six columns, three on each side.
+% This file can be used to produce it in any of three ways:
+% 1 column per page
+% produces six separate pages, each of which needs to be reduced to 80%.
+% This gives the best resolution.
+% 2 columns per page
+% produces three already-reduced pages.
+% You will still need to cut and paste.
+% 3 columns per page
+% produces two pages which must be printed sideways to make a
+% ready-to-use 8.5 x 11 inch reference card.
+% For this you need a dvi device driver that can print sideways.
+% Which mode to use is controlled by setting \columnsperpage above.
+%
+% (reference card macros due to Stephen Gildea)
+%
+
+\def\versionnumber{1.1} % Version of this reference card
+\def\year{2014}
+\def\month{May}
+\def\version{\month\ \year\ v\versionnumber}
+
+\def\shortcopyrightnotice{\vskip .5ex plus 2 fill
+ \centerline{\small \copyright\ \year\ John C. Bowman
+ Permissions on back. v\versionnumber}}
+
+\def\copyrightnotice{
+\vskip 1ex plus 100 fill\begingroup\small
+\centerline{\version. Copyright \copyright\ \year\ John C. Bowman}
+
+Permission is granted to make and distribute copies of this card, with
+or without modifications, provided the copyright notice and this
+permission notice are preserved on all copies.
+\endgroup}
+
+% make \bye not \outer so that the \def\bye in the \else clause below
+% can be scanned without complaint.
+\def\bye{\par\vfill\supereject\end}
+
+\newdimen\intercolumnskip
+\newbox\columna
+\newbox\columnb
+
+\def\ncolumns{\the\columnsperpage}
+
+\message{[\ncolumns\space
+ column\if 1\ncolumns\else s\fi\space per page]}
+
+\def\scaledmag#1{ scaled \magstep #1}
+
+% This multi-way format was designed by Stephen Gildea
+% October 1986.
+\if 1\ncolumns
+ \hsize 4in
+ \vsize 10in
+ \voffset -.7in
+ \font\titlefont=\fontname\tenbf \scaledmag3
+ \font\headingfont=\fontname\tenbf \scaledmag2
+ \font\headingfonttt=\fontname\tentt \scaledmag2
+ \font\smallfont=\fontname\sevenrm
+ \font\smallsy=\fontname\sevensy
+
+ \footline{\hss\folio}
+ \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
+\else
+ \hsize 3.2in
+ \vsize 7.95in
+ \hoffset -.75in
+ \voffset -.745in
+ \font\titlefont=cmbx10 \scaledmag2
+ \font\headingfont=cmbx10 \scaledmag1
+ \font\headingfonttt=cmtt10 \scaledmag1
+ \font\smallfont=cmr6
+ \font\smallsy=cmsy6
+ \font\eightrm=cmr8
+ \font\eightbf=cmbx8
+ \font\eightit=cmti8
+ \font\eighttt=cmtt8
+ \font\eightsy=cmsy8
+ \font\eightsl=cmsl8
+ \font\eighti=cmmi8
+ \font\eightex=cmex10 at 8pt
+ \textfont0=\eightrm
+ \textfont1=\eighti
+ \textfont2=\eightsy
+ \textfont3=\eightex
+ \def\rm{\fam0 \eightrm}
+ \def\bf{\eightbf}
+ \def\it{\eightit}
+ \def\tt{\eighttt}
+ \def\sl{\eightsl}
+ \normalbaselineskip=.8\normalbaselineskip
+ \normallineskip=.8\normallineskip
+ \normallineskiplimit=.8\normallineskiplimit
+ \normalbaselines\rm %make definitions take effect
+
+ \if 2\ncolumns
+ \let\maxcolumn=b
+ \footline{\hss\rm\folio\hss}
+ \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
+ \else \if 3\ncolumns
+ \let\maxcolumn=c
+ \nopagenumbers
+ \else
+ \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
+ \errmessage{Illegal number of columns per page}
+ \fi\fi
+
+ \intercolumnskip=.46in
+ \def\abc{a}
+ \output={%
+ % This next line is useful when designing the layout.
+ %\immediate\write16{Column \folio\abc\space starts with \firstmark}
+ \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
+ \else\if a\abc
+ \global\setbox\columna\columnbox \global\def\abc{b}
+ %% in case we never use \columnb (two-column mode)
+ \global\setbox\columnb\hbox to -\intercolumnskip{}
+ \else
+ \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
+ \def\multicolumnformat{\shipout\vbox{\makeheadline
+ \hbox{\box\columna\hskip\intercolumnskip
+ \box\columnb\hskip\intercolumnskip\columnbox}
+ \makefootline}\advancepageno}
+ \def\columnbox{\leftline{\pagebody}}
+
+ \def\bye{\par\vfill\supereject
+ \if a\abc \else\null\vfill\eject\fi
+ \if a\abc \else\null\vfill\eject\fi
+ \end}
+\fi
+
+% we won't be using math mode much, so redefine some of the characters
+% we might want to talk about
+\catcode`\^=12
+%\catcode`\_=12
+\catcode`\~=12
+
+\chardef\\=`\\
+\chardef\{=`\{
+\chardef\}=`\}
+\chardef\underscore=`\_
+
+\hyphenation{}
+
+\parindent 0pt
+\parskip .85ex plus .35ex minus .5ex
+
+\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
+
+\outer\def\newcolumn{\vfill\eject}
+
+\outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
+
+\outer\def\section#1{\par\filbreak
+ \vskip .5ex minus .1ex {\headingfont #1}\mark{#1}%
+ \vskip .3ex minus .1ex}
+
+\outer\def\librarysection#1#2{\par\filbreak
+ \vskip .5ex minus .1ex {\headingfont #1}\quad{\headingfonttt<#2>}\mark{#1}%
+ \vskip .3ex minus .1ex}
+
+
+\newdimen\keyindent
+
+\def\beginindentedkeys{\keyindent=1em}
+\def\endindentedkeys{\keyindent=0em}
+\def\begindoubleindentedkeys{\keyindent=2em}
+\def\enddoubleindentedkeys{\keyindent=1em}
+\endindentedkeys
+
+\def\paralign{\vskip\parskip\halign}
+
+\def\<#1>{$\langle${\rm #1}$\rangle$}
+
+\def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
+
+\def\beginexample{\par\vskip1\jot
+\hrule width.5\hsize
+\vskip1\jot
+\begingroup\parindent=2em
+ \obeylines\obeyspaces\parskip0pt\tt}
+{\obeyspaces\global\let =\ }
+\def\endexample{\endgroup}
+
+\def\Example{\qquad{\sl Example\/}.\enspace\ignorespaces}
+
+\def\key#1#2{\leavevmode\hbox to \hsize{\vtop
+ {\hsize=.75\hsize\rightskip=1em
+ \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
+
+\newbox\metaxbox
+\setbox\metaxbox\hbox{\kbd{M-x }}
+\newdimen\metaxwidth
+\metaxwidth=\wd\metaxbox
+
+\def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
+ {\hskip\keyindent\relax#1\hfil}%
+ \hskip -\metaxwidth minus 1fil
+ \kbd{#2}\hfil}}
+
+\def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
+ &\kbd{#3}\quad\cr}
+
+% Define Italic Names
+\def\makedef#1 {%
+\expandafter\edef\csname#1\endcsname{\hbox{\it#1\/}}}
+\makedef array
+\makedef arg
+\makedef const
+\makedef dim
+\makedef expr
+\makedef filename
+\makedef f
+\makedef format
+\makedef member
+\makedef name
+\makedef statement
+\makedef statements
+\makedef string
+\makedef type
+\makedef value
+\makedef var
+
+%**end of header
+
+
+\title{Asymptote Reference Card}
+
+\section{Program structure/functions}
+\halign{\tt#\hfil&\qquad#\hfil\cr
+import "\filename"&import module\cr
+import "\filename" as name&import filename as module name\cr
+include "\filename"&include verbatim text from file\cr
+\type\ \f(\type,\dots);&optional function declaration\cr
+\type\ \name;&variable declaration\cr
+\type\ \f(\type\ \arg,\dots) \{&function definition\cr
+\quad\statements\cr
+\quad return \value;\cr
+\}\cr
+}
+
+\section{Data types/declarations}
+\key{boolean (true or false)}{bool}
+\key{tri-state boolean (true, default, or false)}{bool3}
+\key{integer}{int}
+\key{float (double precision)}{real}
+\key{ordered pair (complex number)}{pair}
+\key{character string}{string}
+\key{fixed piecewise cubic Bezier spline}{path}
+\key{unresolved piecewise cubic Bezier spline}{guide}
+\key{color, line type/width/cap, font, fill rule}{pen}
+\key{label with position, alignment, pen attributes}{Label}
+\key{drawing canvas}{picture}
+\key{affine transform}{transform}
+\key{constant (unchanging) value}{const}
+\key{allocate in higher scope}{static}
+\key{no value}{void}
+\key{inhibit implicit argument casting}{explicit}
+\key{structure}{struct}
+\key{create name by data type}{typedef \type\ \name}
+
+\section{3D data types (import three;)}
+\key{ordered triple}{triple}
+\key{3D path}{path3}
+\key{3D guide}{guide3}
+\key{3D affine transform}{transform3}
+
+\section{Constants}
+\key{exponential form}{6.02e23}
+\key{\TeX\ string constant}{"abc\dots de"}
+\key{\TeX\ strings: special characters}{\\\\, \\"}
+\key{C strings: constant}{'abc\dots de'}
+\key{C strings: special characters}{\\\\, \\" \\' \\?}
+\key{C strings: newline, cr, tab, backspace}{\\n \\r \\t \\b}
+\key{C strings: octal, hexadecimal bytes}{\\0-\\377 \\x0-\\xFF}
+
+\section{Operators}
+\key{arithmetic operations}{+ - * /}
+\key{modulus (remainder)}{\%}
+\key{comparisons}{== != > >= < <=}
+\key{not}{!}
+\key{and or (conditional evaluation of RHS)}{\&\& ||}
+\key{and or xor}{\& | ^}
+\key{cast expression to type}{(\type) \expr}
+\key{increment decrement prefix operators}{++ --}
+\key{assignment operators}{+= -= *= /= \%=}
+\key{conditional expression}{\expr$_1$\ {?}\ \expr$_2$\ {:}\ \expr$_3$}
+\key{structure member operator}{\name.\member}
+\key{expression evaluation separator}{,}
+
+\section{Flow control}
+\key{statement terminator}{;}
+\key{block delimeters}{\{\quad\}}
+\key{comment delimeters}{/*\quad*/}
+\key{comment to end of line delimiter}{//}
+\key{exit from \kbd{while}/\kbd{do}/\kbd{for}}{break;}
+\key{next iteration of \kbd{while}/\kbd{do}/\kbd{for}}{continue;}
+\key{return value from function}{return \expr;}
+\key{terminate execution}{exit();}
+\key{abort execution with error message}{abort(string);}
+\metax{{\bf Flow constructions} ({\tt if/while/for/do})\hidewidth}{}
+\beginexample
+if(\expr)\ \statement
+else if(\expr)\ \statement
+else \statement
+\endexample
+\beginexample
+while(\expr)
+\quad\statement
+\endexample
+\beginexample
+for(\expr$_1$; \expr$_2$; \expr$_3$)
+\quad\statement
+\endexample
+\beginexample
+for(\type var : \array)
+\quad\statement
+\endexample
+\beginexample
+do \statement
+\quad while(\expr);
+\endexample
+
+\section{Arrays}
+\key{array}{\type[]\ \name;}
+\key{array element i}{\name[i]}
+\key{array indexed by elements of int array {\tt A}}{\name[A]}
+\key{anonymous array}{new \type[\dim]}
+\key{array containing {\tt n} deep copies of {\tt x}}{array(n,x)}
+\key{length}{\name.length}
+\key{cyclic flag}{\name.cyclic}
+\key{pop element {\tt x}}{\name.pop()}
+\key{push element {\tt x}}{\name.push(x)}
+\key{append array {\tt a}}{\name.append(a)}
+\key{insert rest arguments at index {\tt i}}{\name.insert(i,\dots)}
+\key{delete element at index {\tt i}}{\name.delete(i)}
+\key{delete elements with indices in [{\tt i},{\tt j}]}{\name.delete(i,j)}
+\key{delete all elements}{\name.delete()}
+\key{test whether element n is initialized}{\name.initialized(n)}
+\key{array of indices of initialized elements}{\name.keys}
+\key{complement of int array in {\tt \{0,\dots,n-1\}}}{complement(a,n)}
+\key{deep copy of array {\tt a}}{copy(a)}
+\key{array {\tt \{0,1,\dots,n-1\}}}{sequence(n)}
+\key{array {\tt \{n,n+1,\dots,m\}}}{sequence(n,m)}
+\key{array {\tt \{n-1,n-2,\dots,0\}}}{reverse(n)}
+\key{array {\tt \{f(0),f(1),\dots,f(n-1)\}}}{sequence(f,n)}
+\key{array obtained by applying {\tt f} to array {\tt a}}{map(f,a)}
+\key{uniform partition of [{\tt a},{\tt b}] into n intervals}{uniform(a,b,n)}
+\key{concat specified 1D arrays}{concat(a,b,\dots)}
+\key{return sorted array}{sort(a)}
+\key{return array sorted using ordering {\tt less}}{sort(a,{\tt less})}
+\key{search sorted array {\tt a} for key}{search(a,key)}
+\key{index of first true value of bool array {\tt a}}{find(a)}
+\key{index of nth true value of bool array {\tt a}}{find(a,n)}
+
+\section{Initialization}
+\key{initialize variable}{\type\ \name=\value;}
+\key{initialize array}{\type[]\ \name=\{\dots\};}
+
+\section{path connectors}
+\key{straight segment}{--}
+\key{Bezi\'er segment with implicit control points}{..}
+\key{Bezi\'er segment with explicit control points}{..controls c0 and c1..}
+\key{concatenate}{\&}
+\key{lift pen}{^^}
+\key{..tension atleast 1..}{::}
+\key{..tension atleast infinity..}{---}
+
+\section{Labels}
+\key{implicit cast of string {\tt s} to Label}{s}
+\key{Label {\tt s} with relative position and alignment}{Label(s,real,pair)}
+\key{Label {\tt s} with absolute position and alignment}{Label(s,pair,pair)}
+\key{Label {\tt s} with specified pen}{Label(s,pen)}
+
+\section{draw commands}
+\key{draw path with current pen}{draw(path)}
+\key{draw path with pen}{draw(path,pen)}
+\key{draw labeled path}{draw(Label,path)}
+\key{draw arrow with pen}{draw(path,pen,Arrow)}
+\key{draw path on picture}{draw(picture,path)}
+\key{draw visible portion of line through two pairs}{drawline(pair,pair)}
+
+\section{fill commands}
+\key{fill path with current pen}{fill(path)}
+\key{fill path with pen}{fill(path,pen)}
+\key{fill path on picture}{fill(picture,path)}
+
+\section{label commands}
+\key{label a pair with optional alignment z}{label(Label,pair,{\tt z})}
+\key{label a path with optional alignment z}{label(Label,path,{\tt z})}
+\key{add label to picture}{label(picture,Label)}
+
+\section{clip commands}
+\key{clip to path}{clip(path)}
+\key{clip to path with fill rule}{clip(path,pen)}
+\key{clip picture to path}{clip(picture,path)}
+
+\section{pens}
+\key{Grayscale pen from value in [0,1]}{gray(g)}
+\key{RGB pen from values in [0,1]}{rgb(r,g,b)}
+\key{CMYK pen from values in [0,1]}{cmyk(r,g,b)}
+\key{RGB pen from heximdecimal string]}{rgb(string)}
+\key{heximdecimal string from rgb pen]}{hex(pen)}
+\key{hsv pen from values in [0,1]}{hsv(h,s,v)}
+\key{invisible pen}{invisible}
+\key{default pen}{defaultpen}
+\key{current pen}{currentpen}
+\key{solid pen}{solid}
+\key{dotted pen}{dotted}
+\key{wide dotted current pen}{Dotted}
+\key{wide dotted pen}{Dotted(pen)}
+\key{dashed pen}{dashed}
+\key{long dashed pen}{longdashed}
+\key{dash dotted pen}{dashdotted}
+\key{long dash dotted pen}{longdashdotted}
+\key{PostScript butt line cap}{squarecap}
+\key{PostScript round line cap}{roundcap}
+\key{PostScript projecting square line cap}{extendcap}
+\key{miter join}{miterjoin}
+\key{round join}{roundjoin}
+\key{bevel join}{beveljoin}
+\key{pen with miter limit}{miterlimit(real)}
+\key{zero-winding fill rule}{zerowinding}
+\key{even-odd fill rule}{evenodd}
+\key{align to character bounding box (default)}{nobasealign}
+\key{align to \TeX\ baseline}{basealign}
+\key{pen with font size (pt)}{fontsize(real)}
+\key{LaTeX pen from encoding,family,series,shape}{font(strings)}
+\key{\TeX\ pen}{font(string)}
+\key{scaled \TeX\ pen}{font(string,real)}
+\key{PostScript font from strings}{Courier(series,shape)}
+\key{pen with opacity in [0,1]}{opacity(real)}
+\key{construct pen nib from polygonal path}{makepen(path)}
+\key{pen mixing operator}{+}
+
+\section{path operations}
+\key{number of segments in path {\tt p}}{length(p)}
+\key{number of nodes in path {\tt p}}{size(p)}
+\key{is path {\tt p} cyclic?}{cyclic(p)}
+\key{is segment {\tt i} of path {\tt p} straight?}{straight(p,i)}
+\key{is path {\tt p} straight?}{piecewisestraight(p)}
+\key{coordinates of path {\tt p} at time {\tt t}}{point(p,t)}
+\key{direction of path {\tt p} at time {\tt t}}{dir(p,t)}
+\key{direction of path {\tt p} at {\tt length(p)}}{dir(p)}
+\key{unit(dir(p)+dir(q))}{dir(p,q)}
+\key{acceleration of path {\tt p} at time {\tt t}}{accel(p,t)}
+\key{radius of curvature of path {\tt p} at time {\tt t}}{radius(p,t)}
+\key{precontrol point of path {\tt p} at time {\tt t}}{precontrol(p,t)}
+\key{postcontrol point of path {\tt p} at time {\tt t}}{postcontrol(p,t)}
+\key{arclength of path {\tt p}}{arclength(p)}
+\key{time at which {\tt arclength(p)=L}}{arctime(p,L)}
+\key{point on path {\tt p} at arclength {\tt L}}{arcpoint(p,L)}
+\key{first value {\tt t} at which {\tt dir(p,t)=z}}{dirtime(p,z)}
+\key{time {\tt t} at relative fraction {\tt l} of {\tt arclength(p)}}{reltime(p,l)}
+\key{point at relative fraction {\tt l} of {\tt arclength(p)}}{relpoint(p,l)}
+\key{point midway along arclength of {\tt p}}{midpoint(p)}
+\key{path running backwards along {\tt p}}{reverse(p)}
+\key{subpath of {\tt p} between times {\tt a} and {\tt b}}{subpath(p,a,b)}
+\key{times for one intersection of paths {\tt p} and {\tt q}}{intersect(p,q)}
+\key{times at which {\tt p} reaches minimal extents}{mintimes(p)}
+\key{times at which {\tt p} reaches maximal extents}{maxtimes(p)}
+\key{intersection times of paths {\tt p} and {\tt q}}{intersections(p,q)}
+\key{intersection times of path {\tt p} with `{\tt --a--b--}'}{intersections(p,a,b)}
+\key{intersection times of path {\tt p} crossing $x=${\tt x}}{times(p,x)}
+\key{intersection times of path {\tt p} crossing $y=${\tt z.y}}{times(p,z)}
+\key{intersection point of paths {\tt p} and {\tt q}}{intersectionpoint(p,q)}
+\key{intersection points of {\tt p} and {\tt q}}{intersectionpoints(p,q)}
+\key{intersection of extension of {\tt P--Q} and {\tt p--q}}{extension(P,Q,p,q)}
+\key{lower left point of bounding box of path {\tt p}}{min(p)}
+\key{upper right point of bounding box of path {\tt p}}{max(p)}
+\key{subpaths of {\tt p} split by {\tt n}th cut of {\tt knife}}{cut(p,knife,n)}
+\key{winding number of path {\tt p} about pair {\tt z}}{windingnumber(p,z)}
+\key{pair {\tt z} lies within path {\tt p}?}{interior(p,z)}
+\key{pair {\tt z} lies within or on path {\tt p}?}{inside(p,z)}
+\key{path surrounding region bounded by paths}{buildcycle(\dots)}
+\key{path filled by \tt{draw(g,p)}}{strokepath(g,p)}
+\key{unit square with lower-left vertex at origin}{unitsquare}
+\key{unit circle centered at origin}{unitcircle}
+\key{circle of radius {\tt r} about {\tt c}}{circle(c,r)}
+\key{arc of radius {\tt r} about {\tt c} from angle {\tt a} to {\tt b}}{arc(c,r,a,b)}
+\key{unit {\tt n}-sided polygon}{polygon(n)}
+\key{unit {\tt n}-point cyclic cross}{cross(n)}
+
+\section{pictures}
+\key{add picture {\tt pic} to currentpicture}{add(pic)}
+\key{add picture {\tt pic} about pair {\tt z}}{add(pic,z)}
+
+\section{affine transforms}
+\key{identity transform}{identity()}
+\key{shift by values}{shift(real,real)}
+\key{shift by pair}{shift(pair)}
+\key{scale by {\tt x} in the $x$ direction}{xscale(x)}
+\key{scale by {\tt y} in the $y$ direction}{yscale(y)}
+\key{scale by {\tt x} in both directions}{scale(x)}
+\key{scale by real values {\tt x} and {\tt y}}{scale(x,y)}
+\key{map $(x,y) \rightarrow (x+${\tt s}$y,y)$}{slant(s)}
+\key{rotate by real {\tt angle} in degrees about pair {\tt z}}{rotate(angle,z=(0,0))}
+\key{reflect about line from {\tt P--Q}}{reflect(P,Q)}
+
+\section{string operations}
+\key{concatenate operator}{+}
+\key{string length}{length(string)}
+\key{position $\ge$ {\tt pos} of first occurence of {\tt t} in {\tt s}}{find({\tt s},{\tt t},pos=0)}
+\key{position $\le$ {\tt pos} of last occurence of {\tt t} in {\tt s}}{rfind({\tt s},{\tt t},pos=-1)}
+\key{string with {\tt t} inserted in {\tt s} at {\tt pos}}{insert({\tt s},{\tt pos},{\tt t})}
+\key{string {\tt s} with {\tt n} characters at {\tt pos} erased}{erase({\tt s},{\tt pos},{\tt n})}
+\key{substring of string {\tt s} of length {\tt n} at {\tt pos}}{substr({\tt s},{\tt pos},{\tt n})}
+\key{string {\tt s} reversed}{reverse({\tt s})}
+\key{string {\tt s} with {\tt before} changed to {\tt after}}{replace({\tt s},{\tt before},{\tt after})}
+\key{string {\tt s} translated via {\tt \{\{before,after\},\dots\}}}{replace({\tt
+s},string [][] table)}
+\key{format {\tt x} using C-style format string {\tt s} }{format({\tt s},x)}
+\key{casts hexadecimal string to an integer}{hex(s)}
+\key{casts {\tt x} to string using precision {\tt digits}}{string(x,digits=realDigits)}
+\key{current time formatted by {\tt format}}{time(format="\%a \%b \%d \%T \%Z \%Y")}
+\key{time in seconds of string {\tt t} using {\tt format}}{seconds(t,format)}
+\key{string corresponding to {\tt seconds} using {\tt format}}{time(seconds,format)}
+\key{split {\tt s} into strings separated by {\tt delimiter}}{split(s,delimiter="")}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%% END LIBRARIES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% This goes at the bottom of the last page (column 6)
+\copyrightnotice
+%
+
+\bye
+
+% Local variables:
+% compile-command: "tex AsyRefCard"
+% End:
+
+
+
+
diff --git a/Build/source/utils/asymptote/doc/asycolors.sty b/Build/source/utils/asymptote/doc/asycolors.sty
new file mode 100644
index 00000000000..31031c730fd
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asycolors.sty
@@ -0,0 +1,72 @@
+\usepackage{color}
+\definecolor{cyan}{cmyk}{1,0,0,0}
+\definecolor{magenta}{cmyk}{0,1,0,0}
+\definecolor{yellow}{cmyk}{0,0,1,0}
+\definecolor{black}{cmyk}{0,0,0,1}
+
+\definecolor{white}{cmyk}{0,0,0,0}
+\definecolor{gray}{cmyk}{0,0,0,0.5}
+
+\definecolor{red}{cmyk}{0,1,1,0}
+\definecolor{green}{cmyk}{1,0,1,0}
+\definecolor{blue}{cmyk}{1,1,0,0}
+
+\definecolor{palered}{cmyk}{0,0.25,0.25,0}
+\definecolor{palegreen}{cmyk}{0.25,0,0.25,0}
+\definecolor{paleblue}{cmyk}{0.25,0.25,0,0}
+\definecolor{palecyan}{cmyk}{0.25,0,0,0}
+\definecolor{palemagenta}{cmyk}{0,0.25,0,0}
+\definecolor{paleyellow}{cmyk}{0,0,0.25,0}
+\definecolor{palegray}{cmyk}{0,0,0,0.05}
+\definecolor{lightred}{cmyk}{0,0.5,0.5,0}
+\definecolor{lightgreen}{cmyk}{0.5,0,0.5,0}
+\definecolor{lightblue}{cmyk}{0.5,0.5,0,0}
+\definecolor{lightcyan}{cmyk}{0.5,0,0,0}
+\definecolor{lightmagenta}{cmyk}{0,0.5,0,0}
+\definecolor{lightyellow}{cmyk}{0,0,0.5,0}
+\definecolor{lightgray}{cmyk}{0,0,0,0.1}
+\definecolor{mediumred}{cmyk}{0,0.75,0.75,0}
+\definecolor{mediumgreen}{cmyk}{0.75,0,0.75,0}
+\definecolor{mediumblue}{cmyk}{0.75,0.75,0,0}
+\definecolor{mediumcyan}{cmyk}{0.75,0,0,0}
+\definecolor{mediummagenta}{cmyk}{0,0.75,0,0}
+\definecolor{mediumyellow}{cmyk}{0,0,0.75,0}
+\definecolor{mediumgray}{cmyk}{0,0,0,0.25}
+\definecolor{heavyred}{cmyk}{0,1,1,0.25}
+\definecolor{heavygreen}{cmyk}{1,0,1,0.25}
+\definecolor{heavyblue}{cmyk}{1,1,0,0.25}
+\definecolor{heavycyan}{cmyk}{1,0,0,0.25}
+\definecolor{heavymagenta}{cmyk}{0,1,0,0.25}
+\definecolor{lightolive}{cmyk}{0,0,1,0.25}
+\definecolor{heavygray}{cmyk}{0,0,0,0.75}
+\definecolor{deepred}{cmyk}{0,1,1,0.5}
+\definecolor{deepgreen}{cmyk}{1,0,1,0.5}
+\definecolor{deepblue}{cmyk}{1,1,0,0.5}
+\definecolor{deepcyan}{cmyk}{1,0,0,0.5}
+\definecolor{deepmagenta}{cmyk}{0,1,0,0.5}
+\definecolor{olive}{cmyk}{0,0,1,0.5}
+\definecolor{deepgray}{cmyk}{0,0,0,0.9}
+\definecolor{darkred}{cmyk}{0,1,1,0.75}
+\definecolor{darkgreen}{cmyk}{1,0,1,0.75}
+\definecolor{darkblue}{cmyk}{1,1,0,0.75}
+\definecolor{darkcyan}{cmyk}{1,0,0,0.75}
+\definecolor{darkmagenta}{cmyk}{0,1,0,0.75}
+\definecolor{darkolive}{cmyk}{0,0,1,0.75}
+\definecolor{darkgray}{cmyk}{0,0,0,0.95}
+\definecolor{orange}{cmyk}{0,0.5,1,0}
+\definecolor{fuchsia}{cmyk}{0,1,0.5,0}
+\definecolor{chartreuse}{cmyk}{0.5,0,1,0}
+\definecolor{springgreen}{cmyk}{1,0,0.5,0}
+\definecolor{purple}{cmyk}{0.5,1,0,0}
+\definecolor{royalblue}{cmyk}{1,0.5,0,0}
+\definecolor{salmon}{cmyk}{0,0.5,0.5,0}
+\definecolor{brown}{cmyk}{0,1,1,0.5}
+\definecolor{darkbrown}{cmyk}{0,1,1,0.75}
+\definecolor{pink}{cmyk}{0,0.25,0,0}
+\definecolor{palegrey}{cmyk}{0,0,0,0.05}
+\definecolor{lightgrey}{cmyk}{0,0,0,0.1}
+\definecolor{mediumgrey}{cmyk}{0,0,0,0.25}
+\definecolor{grey}{cmyk}{0,0,0,0.5}
+\definecolor{heavygrey}{cmyk}{0,0,0,0.5}
+\definecolor{deepgrey}{cmyk}{0,0,0,0.9}
+\definecolor{darkgrey}{cmyk}{0,0,0,0.95}
diff --git a/Build/source/utils/asymptote/doc/asymptote.pdf b/Build/source/utils/asymptote/doc/asymptote.pdf
new file mode 100644
index 00000000000..5698afe4acd
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asymptote.pdf
Binary files differ
diff --git a/Build/source/utils/asymptote/doc/asymptote.sty b/Build/source/utils/asymptote/doc/asymptote.sty
new file mode 100644
index 00000000000..17a05d68a3a
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asymptote.sty
@@ -0,0 +1,404 @@
+%%
+%% This is file `asymptote.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% asy-latex.dtx (with options: `pkg')
+%% ____________________________
+%% The ASYMPTOTE package
+%%
+%% (C) 2003 Tom Prince
+%% (C) 2003-2021 John Bowman
+%% (C) 2010 Will Robertson
+%%
+%% Adapted from comment.sty
+%%
+%% Licence: GPL2+
+%%
+\ProvidesPackage{asymptote}
+ [2021/02/06 v1.36 Asymptote style file for LaTeX]
+\def\Asymptote{{\tt Asymptote}}
+\InputIfFileExists{\jobname.pre}{}{}
+\newbox\ASYbox
+\newdimen\ASYdimen
+\newcounter{asy}
+\newwrite\AsyStream
+\newwrite\AsyPreStream
+\newif\ifASYinline
+\newif\ifASYattach
+\newif\ifASYkeepAspect
+\ASYkeepAspecttrue
+\RequirePackage{keyval}
+\RequirePackage{ifthen}
+\RequirePackage{color,graphicx}
+\IfFileExists{ifpdf.sty}{
+ \RequirePackage{ifpdf}
+}{
+ \expandafter\newif\csname ifpdf\endcsname
+ \ifx\pdfoutput\@undefined\else
+ \ifcase\pdfoutput\else
+ \pdftrue
+ \fi
+ \fi
+}
+\IfFileExists{ifxetex.sty}{
+ \RequirePackage{ifxetex}
+}{
+ \expandafter\newif\csname ifxetex\endcsname
+ \ifx\XeTeXversion\@undefined\else
+ \xetextrue
+ \fi
+}
+\IfFileExists{catchfile.sty}{
+ \RequirePackage{catchfile}
+}{
+ \newcommand\CatchFileDef[3]{%
+ \begingroup
+ \everyeof{%
+ \ENDCATCHFILEMARKER
+ \noexpand
+ }%
+ \long\def\@tempa####1\ENDCATCHFILEMARKER{%
+ \endgroup
+ \def##1{####1}%
+ }%
+ ##3%
+ \expandafter\@tempa\@@input ##2\relax
+ }
+}
+\newif\if@asy@attachfile@loaded
+\AtBeginDocument{%
+ \@ifpackageloaded{attachfile2}{\@asy@attachfile@loadedtrue}{}%
+ \let\asy@check@attachfile\asy@check@attachfile@loaded
+}
+\newcommand\asy@check@attachfile@loaded{%
+ \if@asy@attachfile@loaded\else
+ \PackageError{asymptote}{You must load the attachfile2 package}{^^J%
+ You have requested the [attach] option for some or all of your^^J%
+ Asymptote graphics, which requires the attachfile2 package.^^J%
+ Please load it in the document preamble.^^J%
+ }%
+ \fi
+}
+\newcommand\asy@check@attachfile{%
+ \AtBeginDocument{\asy@check@attachfile@loaded}%
+ \let\asy@check@attachfile\@empty
+}
+\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
+\DeclareOption{inline}{%
+ \ASYinlinetrue
+}
+\DeclareOption{attach}{%
+ \asy@check@attachfile
+ \ASYattachtrue
+}
+\ProcessOptions*
+\def\asylatexdir{}
+\def\asydir{}
+\def\ASYasydir{}
+\def\ASYprefix{}
+\newif\ifASYPDF
+\ifxetex
+ \ASYPDFtrue
+\else
+ \ifpdf
+ \ASYPDFtrue
+ \fi
+\fi
+\ifASYPDF
+ \def\AsyExtension{pdf}
+\else
+ \def\AsyExtension{eps}
+\fi
+\def\unquoteJobname#1"#2"#3\relax{%
+ \def\rawJobname{#1}%
+ \ifx\rawJobname\empty
+ \def\rawJobname{#2}%
+ \fi
+}
+\expandafter\unquoteJobname\jobname""\relax
+\def\fixstar#1*#2\relax{%
+ \def\argtwo{#2}%
+ \ifx\argtwo\empty
+ \gdef\Jobname{#1}%
+ \else
+ \fixstar#1-#2\relax
+ \fi
+}
+\expandafter\fixstar\rawJobname*\relax
+\def\Ginclude@eps#1{%
+ \message{<#1>}%
+ \bgroup
+ \def\@tempa{!}%
+ \dimen@\Gin@req@width
+ \dimen@ii.1bp\relax
+ \divide\dimen@\dimen@ii
+ \@tempdima\Gin@req@height
+ \divide\@tempdima\dimen@ii
+ \special{PSfile=#1\space
+ llx=\Gin@llx\space
+ lly=\Gin@lly\space
+ urx=\Gin@urx\space
+ ury=\Gin@ury\space
+ \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
+ \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
+ \ifGin@clip clip\fi}%
+ \egroup
+}
+\immediate\openout\AsyPreStream=\jobname.pre\relax
+\AtEndDocument{\immediate\closeout\AsyPreStream}
+\def\WriteAsyLine#1{%
+ \immediate\write\AsyStream{\detokenize{#1}}%
+}
+\def\globalASYdefs{}
+\def\WriteGlobalAsyLine#1{%
+ \expandafter\g@addto@macro
+ \expandafter\globalASYdefs
+ \expandafter{\detokenize{#1^^J}}%
+}
+\def\ProcessAsymptote#1{%
+ \begingroup
+ \def\CurrentAsymptote{#1}%
+ \let\do\@makeother \dospecials
+ \@makeother\^^L% and whatever other special cases
+ \catcode`\ =10
+ \endlinechar`\^^M \catcode`\^^M=12 \xAsymptote
+}
+\begingroup
+ \catcode`\^^M=12 \endlinechar=-1\relax%
+ \gdef\xAsymptote{%
+ \expandafter\ProcessAsymptoteLine%
+ }
+ \gdef\ProcessAsymptoteLine#1^^M{%
+ \def\@tempa{#1}%
+ {%
+ \escapechar=-1\relax%
+ \xdef\@tempb{\string\\end\string\{\CurrentAsymptote\string\}}%
+ }%
+ \ifx\@tempa\@tempb%
+ \edef\next{\endgroup\noexpand\end{\CurrentAsymptote}}%
+ \else%
+ \ThisAsymptote{#1}%
+ \let\next\ProcessAsymptoteLine%
+ \fi%
+ \next%
+ }
+\endgroup
+\def\asy@init{%
+ \def\ASYlatexdir{}%
+ \ifx\asylatexdir\empty\else
+ \def\ASYlatexdir{\asylatexdir/}%
+ \fi
+ \ifx\asydir\empty\else
+ \def\ASYasydir{\asydir/}%
+ \fi
+ \def\ASYprefix{\ASYlatexdir\ASYasydir}%
+}
+\newcommand\asy[1][]{%
+ \stepcounter{asy}%
+ \setkeys{ASYkeys}{#1}%
+ \ifASYattach
+ \ASYinlinefalse
+ \fi
+ \asy@init
+ \immediate\write\AsyPreStream{%
+ \noexpand\InputIfFileExists{%
+ \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}%
+ }%
+ \asy@write@graphic@header
+ \let\ThisAsymptote\WriteAsyLine
+ \ProcessAsymptote{asy}%
+}
+\def\endasy{%
+ \asy@finalise@stream
+ \asy@input@graphic
+}
+\def\asy@write@graphic@header{%
+ \immediate\openout\AsyStream=\ASYasydir\jobname-\the\c@asy.asy\relax
+ \gdef\AsyFile{\ASYprefix\Jobname-\the\c@asy}%
+ \immediate\write\AsyStream{%
+ if(!settings.multipleView) settings.batchView=false;^^J%
+ \ifxetex
+ settings.tex="xelatex";^^J%
+ \else\ifASYPDF
+ settings.tex="pdflatex";^^J%
+ \fi\fi
+ \ifASYinline
+ settings.inlinetex=true;^^J%
+ deletepreamble();^^J%
+ \fi
+ defaultfilename="\Jobname-\the\c@asy";^^J%
+ if(settings.render < 0) settings.render=4;^^J%
+ settings.outformat="";^^J%
+ \ifASYattach
+ settings.inlineimage=false;^^J%
+ settings.embed=false;^^J%
+ settings.toolbar=true;^^J%
+ \else
+ settings.inlineimage=true;^^J%
+ settings.embed=true;^^J%
+ settings.toolbar=false;^^J%
+ viewportmargin=(2,2);^^J%
+ \fi
+ \globalASYdefs
+ }%
+}
+\def\asy@expand@keepAspect{%
+ \ifASYkeepAspect keepAspect=true%
+ \else keepAspect=false%
+ \fi%
+}
+\def\asy@finalise@stream{%
+ \ifx\ASYwidth\@empty
+ \ifx\ASYheight\@empty
+ % write nothing!
+ \else
+ \immediate\write\AsyStream{size(0,\ASYheight,\asy@expand@keepAspect);}%
+ \fi
+ \else
+ \ifx\ASYheight\@empty
+ \immediate\write\AsyStream{size(\ASYwidth,0,\asy@expand@keepAspect);}%
+ \else
+ \immediate\write\AsyStream{size(\ASYwidth,\ASYheight,\asy@expand@keepAspect);}%
+ \fi
+ \fi
+ \ifx\ASYviewportwidth\@empty
+ \ifx\ASYviewportheight\@empty
+ % write nothing!
+ \else
+ \immediate\write\AsyStream{viewportsize=(0,\ASYviewportheight);}%
+ \fi
+ \else
+ \ifx\ASYviewportheight\@empty
+ \immediate\write\AsyStream{viewportsize=(\ASYviewportwidth,0);}%
+ \else
+ \immediate\write\AsyStream{%
+ viewportsize=(\ASYviewportwidth,\ASYviewportheight);}%
+ \fi
+ \fi
+ \immediate\closeout\AsyStream
+}
+\def\asy@input@graphic{%
+ \ifASYinline
+ \IfFileExists{"\AsyFile.tex"}{%
+ \catcode`:=12\relax
+ \@@input"\AsyFile.tex"\relax
+ }{%
+ \PackageWarning{asymptote}{file `\AsyFile.tex' not found}%
+ }%
+ \else
+ \IfFileExists{"\AsyFile.\AsyExtension"}{%
+ \ifASYattach
+ \ifASYPDF
+ \IfFileExists{"\AsyFile+0.pdf"}{%
+ \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile+0.pdf}}%
+ }{%
+ \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile.pdf}}%
+ }%
+ \else
+ \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile.eps}}%
+ \fi
+ \textattachfile{\AsyFile.\AsyExtension}{\phantom{\copy\ASYbox}}%
+ \vskip-\ht\ASYbox
+ \indent
+ \box\ASYbox
+ \else
+ \ifASYPDF
+ \includegraphics[hiresbb]{\AsyFile.pdf}%
+ \else
+ \includegraphics[hiresbb]{\AsyFile.eps}%
+ \fi
+ \fi
+ }{%
+ \IfFileExists{"\AsyFile.tex"}{%
+ \catcode`:=12
+ \@@input"\AsyFile.tex"\relax
+ }{%
+ \PackageWarning{asymptote}{%
+ file `\AsyFile.\AsyExtension' not found%
+ }%
+ }%
+ }%
+ \fi
+}
+\def\asydef{%
+ \let\ThisAsymptote\WriteGlobalAsyLine
+ \ProcessAsymptote{asydef}%
+}
+\newcommand\asyinclude[2][]{%
+ \begingroup
+ \stepcounter{asy}%
+ \setkeys{ASYkeys}{#1}%
+ \ifASYattach
+ \ASYinlinefalse
+ \fi
+ \asy@init
+ \immediate\write\AsyPreStream{%
+ \noexpand\InputIfFileExists{%
+ \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}%
+ }%
+ \asy@write@graphic@header
+ \IfFileExists{#2.asy}{%
+ \CatchFileDef\@tempa{#2.asy}{%
+ \let\do\@makeother
+ \dospecials
+ \endlinechar=10\relax
+ }%
+ }{%
+ \IfFileExists{#2}{%
+ \CatchFileDef\@tempa{#2}{%
+ \let\do\@makeother
+ \dospecials
+ \endlinechar=10\relax
+ }%
+ }{%
+ \PackageWarning{asymptote}{file #2 not found}%
+ \def\@tempa{}%
+ }%
+ }%
+ \immediate\write\AsyStream{\unexpanded\expandafter{\@tempa}}%
+ \asy@finalise@stream
+ \asy@input@graphic
+ \endgroup
+}
+\newcommand{\ASYanimategraphics}[5][]{%
+ \IfFileExists{_#3.pdf}{%
+ \animategraphics[{#1}]{#2}{_#3}{#4}{#5}%
+ }{}%
+}
+\newcommand\asysetup[1]{\setkeys{ASYkeys}{#1}}
+\define@key{ASYkeys}{dir}{%
+ \def\asydir{#1}%
+}
+\def\ASYwidth{}
+\define@key{ASYkeys}{width}{%
+ \edef\ASYwidth{\the\dimexpr#1\relax}%
+}
+\def\ASYheight{}
+\define@key{ASYkeys}{height}{%
+ \edef\ASYheight{\the\dimexpr#1\relax}%
+}
+\define@key{ASYkeys}{keepAspect}[true]{%
+ \ifthenelse{\equal{#1}{true}}
+ {\ASYkeepAspecttrue}
+ {\ASYkeepAspectfalse}%
+}
+\def\ASYviewportwidth{}
+\define@key{ASYkeys}{viewportwidth}{%
+ \edef\ASYviewportwidth{\the\dimexpr#1\relax}%
+}
+\def\ASYviewportheight{}
+\define@key{ASYkeys}{viewportheight}{%
+ \edef\ASYviewportheight{\the\dimexpr#1\relax}%
+}
+\define@key{ASYkeys}{inline}[true]{%
+ \ifthenelse{\equal{#1}{true}}
+ {\ASYinlinetrue}
+ {\ASYinlinefalse}%
+}
+\define@key{ASYkeys}{attach}[true]{%
+ \ifthenelse{\equal{#1}{true}}
+ {\ASYattachtrue}
+ {\ASYattachfalse}%
+}
diff --git a/Build/source/utils/asymptote/doc/asymptote.texi b/Build/source/utils/asymptote/doc/asymptote.texi
new file mode 100644
index 00000000000..bd9671564aa
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/asymptote.texi
@@ -0,0 +1,10180 @@
+\input texinfo @c -*-texinfo-*-
+@setfilename asymptote.info
+@settitle Asymptote: the Vector Graphics Language
+@include version.texi
+@finalout
+
+@codequoteundirected on
+
+@copying
+This file documents @code{Asymptote}, version @value{VERSION}.
+
+@url{https://asymptote.sourceforge.io}
+
+Copyright @copyright{} 2004-20 Andy Hammerlindl, John Bowman, and Tom Prince.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the @acronym{GNU} Lesser General Public License (see the
+file LICENSE in the top-level source directory).
+
+@end quotation
+@end copying
+
+@dircategory Languages
+@direntry
+* asymptote: (asymptote/asymptote). Vector graphics language.
+@end direntry
+
+@titlepage
+@title Asymptote: the Vector Graphics Language
+@subtitle For version @value{VERSION}
+@sp 1
+@center @image{./logo}
+
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+
+@end titlepage
+
+@c So the toc is printed at the start.
+@contents
+
+@ifnottex
+@node Top, Description, (dir), (dir)
+@top Asymptote
+
+@insertcopying
+@end ifnottex
+
+@menu
+* Description:: What is @code{Asymptote}?
+* Installation:: Downloading and installing
+* Tutorial:: Getting started
+* Drawing commands:: Four primitive graphics commands
+* Bezier curves:: Path connectors and direction specifiers
+* Programming:: The @code{Asymptote} vector graphics language
+* LaTeX usage:: Embedding @code{Asymptote} commands within @code{LaTeX}
+* Base modules:: Base modules shipped with @code{Asymptote}
+* Options:: Command-line options
+* Interactive mode:: Typing @code{Asymptote} commands interactively
+* GUI:: Graphical user interface
+* PostScript to Asymptote:: @code{Asymptote} backend to @code{pstoedit}
+* Help:: Where to get help and submit bug reports
+* Debugger:: Squish those bugs!
+* Credits:: Contributions and acknowledgments
+* Index:: General index
+
+@detailmenu
+ --- The Detailed Node Listing ---
+
+Installation
+
+* UNIX binary distributions:: Prebuilt @code{UNIX} binaries
+* MacOS X binary distributions:: Prebuilt @code{MacOS X} binaries
+* Microsoft Windows:: Prebuilt @code{Microsoft Windows} binary
+* Configuring:: Configuring @code{Asymptote} for your system
+* Search paths:: Where @code{Asymptote} looks for your files
+* Compiling from UNIX source:: Building @code{Asymptote} from scratch
+* Editing modes:: Convenient @code{emacs} and @code{vim} modes
+* Git:: Getting the latest development source
+* Uninstall:: Goodbye, @code{Asymptote}!
+
+Tutorial
+
+* Drawing in batch mode:: Run @code{Asymptote} on a text file
+* Drawing in interactive mode:: Running @code{Asymptote} interactively
+* Figure size:: Specifying the figure size
+* Labels:: Adding @code{LaTeX} labels
+* Paths:: Drawing lines and curves
+
+Drawing commands
+
+* draw:: Draw a path on a picture or frame
+* fill:: Fill a cyclic path on a picture or frame
+* clip:: Clip a picture or frame to a cyclic path
+* label:: Label a point on a picture
+
+Programming
+
+* Data types:: void, bool, int, real, pair, triple, string
+* Paths and guides:: Bezier curves
+* Pens:: Colors, line types, line widths, font sizes
+* Transforms:: Affine transforms
+* Frames and pictures:: Canvases for immediate and deferred drawing
+* Files:: Reading and writing your data
+* Variable initializers:: Initialize your variables
+* Structures:: Organize your data
+* Operators:: Arithmetic and logical operators
+* Implicit scaling:: Avoiding those ugly *s
+* Functions:: Traditional and high-order functions
+* Arrays:: Dynamic vectors
+* Casts:: Implicit and explicit casts
+* Import:: Importing external @code{Asymptote} modules
+* Static:: Where to allocate your variable?
+
+Operators
+
+* Arithmetic & logical:: Basic mathematical operators
+* Self & prefix operators:: Increment and decrement
+* User-defined operators:: Overloading operators
+
+Functions
+
+* Default arguments:: Default values can appear anywhere
+* Named arguments:: Assigning function arguments by keyword
+* Rest arguments:: Functions with a variable number of arguments
+* Mathematical functions:: Standard libm functions
+
+Arrays
+
+* Slices:: Python-style array slices
+
+Base modules
+
+* plain:: Default @code{Asymptote} base file
+* simplex:: Linear programming: simplex method
+* math:: Extend @code{Asymptote}'s math capabilities
+* interpolate:: Interpolation routines
+* geometry:: Geometry routines
+* trembling:: Wavy lines
+* stats:: Statistics routines and histograms
+* patterns:: Custom fill and draw patterns
+* markers:: Custom path marker routines
+* map:: Map keys to values
+* tree:: Dynamic binary search tree
+* binarytree:: Binary tree drawing module
+* drawtree:: Tree drawing module
+* syzygy:: Syzygy and braid drawing module
+* feynman:: Feynman diagrams
+* roundedpath:: Round the sharp corners of paths
+* animation:: Embedded @acronym{PDF} and @acronym{MPEG} movies
+* embed:: Embedding movies, sounds, and 3D objects
+* slide:: Making presentations with @code{Asymptote}
+* MetaPost:: @code{MetaPost} compatibility routines
+* babel:: Interface to @code{LaTeX} @code{babel} package
+* labelpath:: Drawing curved labels
+* labelpath3:: Drawing curved labels in 3D
+* annotate:: Annotate your @acronym{PDF} files
+* CAD:: 2D CAD pen and measurement functions (DIN 15)
+* graph:: 2D linear & logarithmic graphs
+* palette:: Color density images and palettes
+* three:: 3D vector graphics
+* obj:: 3D obj files
+* graph3:: 3D linear & logarithmic graphs
+* grid3:: 3D grids
+* solids:: 3D solid geometry
+* tube:: 3D rotation minimizing tubes
+* flowchart:: Flowchart drawing routines
+* contour:: Contour lines
+* contour3:: Contour surfaces
+* smoothcontour3:: Smooth implicit surfaces
+* slopefield:: Slope fields
+* ode:: Ordinary differential equations
+
+Graphical User Interface
+
+* GUI installation:: Installing @code{xasy}
+* GUI usage:: Using @code{xasy} to edit objects
+
+@end detailmenu
+@end menu
+
+@node Description, Installation, Top, Top
+@chapter Description
+@cindex description
+
+@cindex @code{Asymptote Web Application}
+@code{Asymptote} is a powerful descriptive vector graphics language that
+provides a mathematical coordinate-based framework for technical drawing.
+Labels and equations are typeset with @code{LaTeX}, for overall document
+consistency, yielding the same high-quality level of typesetting that
+@code{LaTeX} provides for scientific text. By default it produces
+@code{PostScript} output, but it can also generate @code{PDF},
+@code{SVG}, @code{WebGL}, @code{PRC}, and any format that the
+@code{ImageMagick} package can produce. You can even try it out in your
+Web browser without installing it, using the @code{Asymptote Web
+Application}:
+
+@url{http://asymptote.ualberta.ca}
+
+A major advantage of @code{Asymptote} over other graphics packages is
+that it is a high-level programming language, as opposed to just a graphics
+program: it can therefore exploit the best features of the script
+(command-driven) and graphical-user-interface (@acronym{GUI}) methods for
+producing figures. The rudimentary @acronym{GUI} @code{xasy} included with the
+package allows one to move script-generated objects
+around. To make @code{Asymptote} accessible to the average user, this
+@acronym{GUI} is currently being developed into a full-fledged interface
+that can generate objects directly. However, the script portion of the language
+is now ready for general use by users who are willing to learn a few
+simple @code{Asymptote} graphics commands (@pxref{Drawing commands}).
+
+@code{Asymptote} is mathematically oriented (e.g.@ one can
+use complex multiplication to rotate a vector) and uses
+@code{LaTeX} to do the
+typesetting of labels. This is an important feature for scientific
+applications. It was inspired by an earlier drawing program (with a weaker
+syntax and capabilities) called @code{MetaPost}.
+
+The @code{Asymptote} vector graphics language provides:
+
+@itemize @bullet
+@item a standard for typesetting mathematical figures, just
+as @TeX{}/@code{LaTeX} is the de-facto standard for typesetting equations.
+
+@item @code{LaTeX} typesetting of labels, for overall document consistency;
+
+@item the ability to generate and embed 3D vector @acronym{WebGL}
+graphics within @acronym{HTML} files;
+
+@item the ability to generate and embed 3D vector @acronym{PRC}
+graphics within @acronym{PDF} files;
+
+@item a natural coordinate-based framework for technical drawing,
+inspired by @code{MetaPost}, with a much cleaner, powerful C++-like programming
+syntax;
+
+@item compilation of figures into virtual machine code for speed, without
+sacrificing portability;
+
+@item the power of a script-based language coupled to the convenience of
+a @acronym{GUI};
+
+@item customization using its own C++-like graphics programming language;
+
+@item sensible defaults for graphical features, with the ability to override;
+
+@item a high-level mathematically oriented interface to the
+@code{PostScript} language for vector graphics, including affine transforms
+and complex variables;
+
+@item functions that can create new (anonymous) functions;
+
+@item deferred drawing that uses the simplex method to solve overall size
+constraint issues between fixed-sized objects (labels and arrowheads) and
+objects that should scale with figure size;
+
+@end itemize
+
+Many of the features of @code{Asymptote} are written in the
+@code{Asymptote} language itself. While the stock version of
+@code{Asymptote} is designed for mathematics typesetting needs, one can
+write @code{Asymptote} modules that tailor it to specific
+applications; for example, a scientific graphing module is available
+(@pxref{graph}). Examples of @code{Asymptote} code and output,
+including animations, are available at
+@quotation
+@url{https://asymptote.sourceforge.io/gallery/}
+@end quotation
+@noindent
+Clicking on an example file name in this manual, like
+@code{@uref{https://asymptote.sourceforge.io/gallery/Pythagoras.svg,,Pythagoras}}, will display the @acronym{PDF} output, whereas clicking on its
+@code{@uref{https://asymptote.sourceforge.io/gallery/Pythagoras.asy,,.asy}}
+extension will show the corresponding @code{Asymptote} code in a separate window.
+
+Links to many external resources, including an excellent user-written
+@code{Asymptote} tutorial can be found at
+@quotation
+@url{https://asymptote.sourceforge.io/links.html}
+@end quotation
+@cindex reference
+@cindex quick reference
+A quick reference card for @code{Asymptote} is available at
+@quotation
+@url{https://asymptote.sourceforge.io/asyRefCard.pdf}
+@end quotation
+
+@node Installation, Tutorial, Description, Top
+@chapter Installation
+@cindex installation
+
+@menu
+* UNIX binary distributions:: Prebuilt @code{UNIX} binaries
+* MacOS X binary distributions:: Prebuilt @code{MacOS X} binaries
+* Microsoft Windows:: Prebuilt @code{Microsoft Windows} binary
+* Configuring:: Configuring @code{Asymptote} for your system
+* Search paths:: Where @code{Asymptote} looks for your files
+* Compiling from UNIX source:: Building @code{Asymptote} from scratch
+* Editing modes:: Convenient @code{emacs} and @code{vim} modes
+* Git:: Getting the latest development source
+* Uninstall:: Goodbye, @code{Asymptote}!
+@end menu
+
+After following the instructions for your specific distribution,
+please see also @ref{Configuring}.
+
+@noindent
+We recommend subscribing to new release announcements at
+@quotation
+@url{https://sourceforge.net/projects/asymptote}
+@end quotation
+@noindent
+Users may also wish to monitor the @code{Asymptote} forum:
+@quotation
+@url{https://sourceforge.net/p/asymptote/discussion/409349}
+@end quotation
+@noindent
+
+@node UNIX binary distributions, MacOS X binary distributions, Installation, Installation
+@section UNIX binary distributions
+@cindex UNIX binary distributions
+
+@cindex @acronym{RPM}
+@cindex @code{tgz}
+We release both @code{tgz} and @acronym{RPM} binary distributions of
+@code{Asymptote}. The root user can install the @code{Linux x86_64} @code{tgz}
+distribution of version @code{x.xx} of @code{Asymptote} with the commands:
+@verbatim
+tar -C / -zxf asymptote-x.xx.x86_64.tgz
+texhash
+@end verbatim
+@noindent
+The @code{texhash} command, which installs LaTeX style files, is optional.
+The executable file will be @code{/usr/local/bin/asy}) and example code
+will be installed by default in @code{@value{Docdir}/examples}.
+
+@noindent
+@cindex Fedora
+Fedora users can easily install a recent version of @code{Asymptote}
+with the command
+@verbatim
+dnf --enablerepo=rawhide install asymptote
+@end verbatim
+
+@cindex Debian
+@noindent
+To install the latest version of @code{Asymptote} on a Debian-based distribution
+(e.g.@ Ubuntu, Mepis, Linspire) follow the instructions for compiling
+from @code{UNIX} source (@pxref{Compiling from UNIX source}).
+Alternatively, Debian users can install one of Hubert Chan's
+prebuilt @code{Asymptote} binaries from
+@quotation
+@url{http://ftp.debian.org/debian/pool/main/a/asymptote}
+@end quotation
+
+@node MacOS X binary distributions, Microsoft Windows, UNIX binary distributions, Installation
+@section MacOS X binary distributions
+@cindex @code{MacOS X} binary distributions
+@code{MacOS X} users can either compile the @code{UNIX} source code
+(@pxref{Compiling from UNIX source})
+or install the @code{Asymptote} binary available at
+
+@url{https://www.macports.org/}
+
+@noindent
+Note that many @code{MacOS X} (and FreeBSD) systems lack the
+@acronym{GNU} @code{readline} library. For full interactive
+functionality, @acronym{GNU} @code{readline} version 4.3 or later must
+be installed.
+
+@node Microsoft Windows, Configuring, MacOS X binary distributions, Installation
+@section Microsoft Windows
+@cindex Microsoft Windows
+Users of the @code{Microsoft Windows} operating system can install the
+self-extracting @code{Asymptote} executable @code{asymptote-x.xx-setup.exe},
+where @code{x.xx} denotes the latest version.
+
+A working @TeX{} implementation (we recommend
+@url{https://www.tug.org/texlive} or
+@url{http://www.miktex.org}) will be required to typeset labels.
+You will also need to install @code{GPL Ghostscript} version 9.52 or
+later from @url{http://downloads.ghostscript.com/public}.
+
+To view @code{PostScript} output, you can install the
+program @code{gsview} available from
+@url{http://www.cs.wisc.edu/~ghost/gsview/}.
+
+The @code{ImageMagick} package from
+@url{https://www.imagemagick.org/script/binary-releases.php}
+
+@noindent
+is required to support output formats other than @acronym{HTML},
+@acronym{PDF}, @acronym{SVG}, and @acronym{PNG} (@pxref{convert}).
+The @code{Python 3} interpreter from @url{https://www.python.org} is only
+required if you wish to try out the graphical user interface (@pxref{GUI}).
+
+@noindent
+Example code will be installed by default in the @code{examples}
+subdirectory of the installation directory (by default,
+@code{C:\Program Files\Asymptote}).
+
+@node Configuring, Search paths, Microsoft Windows, Installation
+@section Configuring
+@cindex configuring
+@cindex @code{-V}
+In interactive mode, or when given the @code{-V} option (the default
+when running @code{Asymptote} on a single file under @code{MSDOS}),
+@code{Asymptote} will automatically invoke the @code{PostScript}
+viewer @code{gv} (under @code{UNIX}) or @code{gsview} (under
+@code{MSDOS} to display graphical output.
+The @code{PostScript} viewer should be capable of automatically
+redrawing whenever the output file is updated. The default @code{UNIX}
+@code{PostScript} viewer @code{gv} supports this (via a @code{SIGHUP}
+signal). Version @code{gv-3.6.3} or later (from
+@url{https://ftp.gnu.org/gnu/gv/}) is required for interactive mode to
+work properly.
+Users of @code{ggv} will need to enable @code{Watch file} under
+@code{Edit/PostScript Viewer Preferences}.
+Users of @code{gsview} will need to enable @code{Options/Auto Redisplay}
+(however, under @code{MSDOS} it is still necessary to click on the
+@code{gsview} window; under @code{UNIX} one must manually redisplay by
+pressing the @code{r} key).
+
+@cindex @code{psviewer}
+@cindex @code{pdfviewer}
+@cindex @code{htmlviewer}
+@cindex @code{gs}
+@cindex @code{display}
+@cindex @code{animate}
+@cindex @code{settings}
+@cindex configuration file
+Configuration variables are most easily set as @code{Asymptote}
+variables in an optional configuration file @code{config.asy}
+@pxref{configuration file}).
+For example, the setting @code{pdfviewer} specifies the location of
+the @acronym{PDF} viewer. Here are the default values of several
+important configuration variables under @code{UNIX}:
+
+@noindent
+@verbatim
+import settings;
+pdfviewer="acroread";
+htmlviewer="google-chrome";
+psviewer="gv";
+display="display";
+animate="animate";
+gs="gs";
+libgs="";
+@end verbatim
+
+@noindent
+@cindex @code{cmd}
+Under @code{MSDOS}, the viewer settings
+@code{htmlviewer}, @code{pdfviewer}, @code{psviewer},
+@code{display}, and @code{animate} default to the string @code{cmd},
+requesting the application normally associated with each file type.
+The (installation-dependent) default values of @code{gs}
+and @code{libgs} are determined automatically from the @code{Microsoft
+Windows} registry. The @code{gs} setting specifies the location of the
+@code{PostScript} processor @code{Ghostscript}, available from
+@url{https://www.ghostscript.com/}.
+
+@noindent
+@cindex @code{htmlviewer}
+@cindex @code{absolute}
+The configuration variable @code{htmlviewer} specifies the
+browser to use to display 3D @code{WebGL} output.
+The default setting is @code{google-chrome} under @code{UNIX} and
+@code{cmd} under @code{Microsoft Windows}. Note that @code{Internet Explorer}
+does not support @code{WebGL}; @code{Microsoft Windows} users should set their
+default html browser to @code{chrome} or @code{microsoft-edge}.
+By default, 2D and 3D @code{HTML} images expand to the enclosing canvas;
+this can be disabled by setting the configuation variable @code{absolute}
+to @code{true}.
+
+On @code{UNIX} systems, to support automatic document
+reloading of @code{PDF} files in @code{Adobe Reader}, we recommend
+copying the file @code{reload.js} from the @code{Asymptote} system
+directory (by default, @code{@value{Datadir}/asymptote} under @code{UNIX} to
+@code{~/.adobe/Acrobat/x.x/JavaScripts/},
+where @code{x.x} represents the appropriate @code{Adobe Reader}
+version number. The automatic document reload feature must then be
+explicitly enabled by putting
+@verbatim
+import settings;
+pdfreload=true;
+pdfreloadOptions="-tempFile";
+@end verbatim
+@noindent
+in the @code{Asymptote} configuration file. This reload feature is not
+useful under @code{MSDOS} since the document cannot be updated anyway on
+that operating system until it is first closed by @code{Adobe Reader}.
+
+The configuration variable @code{dir} can be used to adjust the
+search path (@pxref{Search paths}).
+
+@cindex @code{papertype}
+@cindex @code{paperwidth}
+@cindex @code{paperheight}
+@cindex @code{letter}
+@cindex @code{a4}
+By default, @code{Asymptote} attempts to center the figure on the
+page, assuming that the paper type is @code{letter}. The default paper
+type may be changed to @code{a4} with the configuration variable
+@code{papertype}. Alignment to other paper sizes can be obtained by setting the
+configuration variables @code{paperwidth} and @code{paperheight}.
+
+@cindex @code{config}
+@cindex @code{texpath}
+@cindex @code{texcommand}
+@cindex @code{dvips}
+@cindex @code{dvisvgm}
+@cindex @code{convert}
+@cindex @code{ImageMagick}
+@cindex @code{asygl}
+These additional configuration variables normally do not require adjustment:
+@verbatim
+config
+texpath
+texcommand
+dvips
+dvisvgm
+convert
+asygl
+@end verbatim
+@noindent
+
+Warnings (such as "unbounded" and "offaxis") may be enabled or disabled with
+the functions
+@verbatim
+warn(string s);
+nowarn(string s);
+@end verbatim
+@noindent
+or by directly modifying the string array @code{settings.suppress}, which lists
+all disabled warnings.
+
+@cindex command-line options
+Configuration variables may also be set or overwritten with a
+command-line option:
+@verbatim
+asy -psviewer=gsview -V venn
+@end verbatim
+
+@cindex environment variables
+Alternatively, system environment versions of the above configuration
+variables may be set in the conventional way. The corresponding
+environment variable name is obtained by converting the configuration
+variable name to upper case and prepending @code{ASYMPTOTE_}:
+for example, to set the environment variable
+@verbatim
+ASYMPTOTE_PSVIEWER="C:\Program Files\Ghostgum\gsview\gsview32.exe";
+@end verbatim
+@noindent
+under @code{Microsoft Windows XP}:
+@enumerate
+@item Click on the @code{Start} button;
+@item Right-click on @code{My Computer};
+@item Choose @code{View system information};
+@item Click the @code{Advanced} tab;
+@item Click the @code{Environment Variables} button.
+@end enumerate
+
+@node Search paths, Compiling from UNIX source, Configuring, Installation
+@section Search paths
+@cindex search paths
+
+In looking for @code{Asymptote} files, @code{asy} will search the
+following paths, in the order listed:
+@enumerate
+@item
+The current directory;
+@item
+@cindex @code{dir}
+A list of one or more directories specified by the configuration
+variable @code{dir} or environment variable @code{ASYMPTOTE_DIR}
+(separated by @code{:} under UNIX and
+@code{;} under @code{MSDOS});
+@item
+@cindex @code{.asy}
+The directory specified by the environment variable
+@code{ASYMPTOTE_HOME}; if this variable is not set,
+the directory @code{.asy} in the user's home directory
+(@code{%USERPROFILE%\.asy} under @code{MSDOS}) is used;
+@item
+The @code{Asymptote} system directory (by default,
+@code{@value{Datadir}/asymptote} under @code{UNIX} and
+@code{C:\Program Files\Asymptote} under @code{MSDOS}).
+@item
+The @code{Asymptote} examples directory (by default,
+@code{@value{Docdir}/examples} under @code{UNIX} and
+@code{C:\Program Files\Asymptote\examples} under @code{MSDOS}).
+@end enumerate
+
+@node Compiling from UNIX source, Editing modes, Search paths, Installation
+@section Compiling from UNIX source
+@cindex Compiling from UNIX source
+
+To compile and install a @code{UNIX} executable from
+the source release @code{asymptote-x.xx.src.tgz} in the subdirectory
+@code{x.xx} under
+
+@url{https://sourceforge.net/projects/asymptote/files/}
+
+execute the commands:
+@verbatim
+gunzip asymptote-x.xx.src.tgz
+tar -xf asymptote-x.xx.src.tar
+cd asymptote-x.xx
+@end verbatim
+By default the system version of the Boehm garbage collector will be
+used; if it is old we recommend first putting
+@url{https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4.tar.gz}
+@url{https://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-7.6.10.tar.gz}
+in the @code{Asymptote} source directory.
+
+On @code{UNIX} platforms (other than @code{MacOS X}), we recommend
+using version @code{3.2.1} of the @code{freeglut} library. To compile
+@code{freeglut}, download
+@quotation
+@url{https://prdownloads.sourceforge.net/freeglut/freeglut-3.2.1.tar.gz}
+@end quotation
+@noindent
+and type (as the root user):
+@verbatim
+gunzip freeglut-3.2.1.tar.gz
+tar -xf freeglut-3.2.1.tar
+cd freeglut-3.2.1
+cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_FLAGS=-fcommon .
+make
+make install
+@end verbatim
+@noindent
+
+Then compile @code{Asymptote} with the commands
+@verbatim
+./configure
+make all
+make install
+@end verbatim
+@noindent
+Be sure to use @acronym{GNU} @code{make} (on non-@acronym{GNU} systems
+this command may be called @code{gmake}).
+To build the documentation, you may need to install the
+@code{texinfo-tex} package. If you get errors from a broken @code{texinfo}
+or @code{pdftex} installation, simply put
+@quotation
+@url{https://asymptote.sourceforge.io/asymptote.pdf}
+@end quotation
+@noindent
+in the directory @code{doc} and repeat the command @code{make all}.
+
+@noindent
+For a (default) system-wide installation, the last command should be
+done as the root user. To install without root privileges, change the
+@code{./configure} command to
+@verbatim
+./configure --prefix=$HOME/asymptote
+@end verbatim
+@cindex @code{MacOS X} configuration
+@cindex @code{clang}
+One can disable use of the Boehm garbage collector by configuring
+with @code{./configure --disable-gc}. For a list of other configuration
+options, say @code{./configure --help}. For example, under
+@code{MacOS X}, one can tell configure to use the @code{clang} compilers and
+look for header files and libraries in nonstandard locations:
+@verbatim
+./configure CC=clang CXX=clang++ CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib
+@end verbatim
+
+If you are compiling @code{Asymptote} with @code{gcc}, you will need a
+relatively recent version (e.g.@ 3.4.4 or later). For full interactive
+functionality, you will need version 4.3 or later of the @acronym{GNU}
+@code{readline} library.
+The file @code{gcc3.3.2curses.patch} in the @code{patches} directory can
+be used to patch the broken curses.h header file (or a local copy thereof
+in the current directory) on some @code{AIX} and @code{IRIX} systems.
+
+@cindex @code{FFTW}
+@cindex @code{GSL}
+The @code{FFTW} library is only required if you want @code{Asymptote}
+to be able to take Fourier transforms of data (say, to compute an
+audio power spectrum). The @code{GSL} library is only required if you
+require the special functions that it supports.
+
+If you don't want to install @code{Asymptote} system wide, just make
+sure the compiled binary @code{asy} and @acronym{GUI} script @code{xasy} are in
+your path and set the configuration variable @code{dir} to point
+to the directory @code{base} (in the top level directory of the
+@code{Asymptote} source code).
+
+@node Editing modes, Git, Compiling from UNIX source, Installation
+@section Editing modes
+@cindex Editing modes
+@cindex @code{emacs}
+@cindex @code{asy-mode}
+@cindex @code{lasy-mode}
+Users of @code{emacs} can edit @code{Asymptote} code with the mode
+@code{asy-mode}, after enabling it by putting the following lines in their
+@code{.emacs} initialization file, replacing @code{ASYDIR} with the
+location of the @code{Asymptote} system directory (by default,
+@code{@value{Datadir}/asymptote} or @code{C:\Program Files\Asymptote}
+under @code{MSDOS}):
+@verbatim
+(add-to-list 'load-path "ASYDIR")
+(autoload 'asy-mode "asy-mode.el" "Asymptote major mode." t)
+(autoload 'lasy-mode "asy-mode.el" "hybrid Asymptote/Latex major mode." t)
+(autoload 'asy-insinuate-latex "asy-mode.el" "Asymptote insinuate LaTeX." t)
+(add-to-list 'auto-mode-alist '("\\.asy$" . asy-mode))
+
+@end verbatim
+@noindent
+Particularly useful key bindings in this mode are @code{C-c C-c}, which compiles
+and displays the current buffer, and the key binding @code{C-c ?}, which
+shows the available function prototypes for the command at the cursor.
+For full functionality you should also install the Apache Software Foundation
+package @code{two-mode-mode}:
+@quotation
+@url{https://www.dedasys.com/freesoftware/files/two-mode-mode.el}
+@end quotation
+@noindent
+Once installed, you can use the hybrid mode @code{lasy-mode} to edit a
+LaTeX file containing embedded @code{Asymptote} code (@pxref{LaTeX usage}).
+This mode can be enabled within @code{latex-mode}
+with the key sequence @code{M-x lasy-mode <RET>}.
+On @code{UNIX} systems, additional keywords will be generated from
+all @code{asy} files in the space-separated list of directories
+specified by the environment variable @code{ASYMPTOTE_SITEDIR}.
+Further documentation of @code{asy-mode} is available within
+@code{emacs} by pressing the sequence keys @code{C-h f asy-mode <RET>}.
+
+@cindex @code{vim}
+@cindex @code{asy.vim}
+Fans of @code{vim} can customize @code{vim} for @code{Asymptote} with
+
+@noindent
+@code{cp @value{Datadir}/asymptote/asy.vim ~/.vim/syntax/asy.vim}
+
+@noindent
+and add the following to their @code{~/.vimrc} file:
+@verbatim
+augroup filetypedetect
+au BufNewFile,BufRead *.asy setf asy
+augroup END
+filetype plugin on
+@end verbatim
+
+If any of these directories or files don't exist, just create them.
+To set @code{vim} up to run the current asymptote script using @code{:make}
+just add to @code{~/.vim/ftplugin/asy.vim}:
+@verbatim
+setlocal makeprg=asy\ %
+setlocal errorformat=%f:\ %l.%c:\ %m
+@end verbatim
+
+@cindex @code{KDE editor}
+@cindex @code{Kate}
+@cindex @code{asymptote.xml}
+Syntax highlighting support for the @acronym{KDE} editor @code{Kate}
+can be enabled by running @code{asy-kate.sh} in the
+@code{@value{Datadir}/asymptote} directory and putting the generated
+@code{asymptote.xml} file in @code{~/.kde/share/apps/katepart/syntax/}.
+
+@node Git, Uninstall, Editing modes, Installation
+@section Git
+@cindex git
+
+The following commands are needed to install the latest development version of
+@code{Asymptote} using @code{git}:
+@verbatim
+git clone https://github.com/vectorgraphics/asymptote
+
+cd asymptote
+./autogen.sh
+./configure
+make all
+make install
+@end verbatim
+
+@noindent
+To compile without optimization, use the command @code{make CFLAGS=-g}.
+On @code{Ubuntu} systems, you may need to first install the required
+dependencies:
+@verbatim
+apt-get build-dep asymptote
+@end verbatim
+@noindent
+
+@node Uninstall, , Git, Installation
+@section Uninstall
+@cindex uninstall
+
+To uninstall a @code{Linux x86_64} binary distribution, use the commands
+@verbatim
+tar -zxvf asymptote-x.xx.x86_64.tgz | xargs --replace=% rm /%
+texhash
+@end verbatim
+
+@noindent
+To uninstall all @code{Asymptote} files installed from a source
+distribution, use the command
+@verbatim
+make uninstall
+@end verbatim
+
+@node Tutorial, Drawing commands, Installation, Top
+@chapter Tutorial
+@cindex tutorial
+
+@menu
+* Drawing in batch mode:: Run @code{Asymptote} on a text file
+* Drawing in interactive mode:: Running @code{Asymptote} interactively
+* Figure size:: Specifying the figure size
+* Labels:: Adding @code{LaTeX} labels
+* Paths:: Drawing lines and curves
+@end menu
+
+A concise introduction to @code{Asymptote} is given here.
+For a more thorough introduction, see the excellent @code{Asymptote}
+tutorial written by Charles Staats:
+
+@url{https://asymptote.sourceforge.io/asymptote_tutorial.pdf}
+
+Another @code{Asymptote} tutorial is available as a wiki,
+with images rendered by an online Asymptote engine:
+
+@url{https://www.artofproblemsolving.com/wiki/?title=Asymptote_(Vector_Graphics_Language)}
+
+@node Drawing in batch mode, Drawing in interactive mode, Tutorial, Tutorial
+@section Drawing in batch mode
+@cindex batch mode
+To draw a line from coordinate (0,0) to coordinate (100,100),
+create a text file @code{test.asy} containing
+@verbatiminclude diagonal.asy
+
+@noindent
+Then execute the command
+@verbatim
+asy -V test
+@end verbatim
+@noindent
+Alternatively, @code{MSDOS} users can drag and drop @code{test.asy} onto the
+Desktop @code{asy} icon (or make @code{Asymptote} the default
+application for the extension @code{asy}).
+
+@noindent
+@cindex @code{-V}
+This method, known as @emph{batch mode}, outputs a @code{PostScript}
+file @code{test.eps}. If you prefer @acronym{PDF} output, use
+the command line
+@verbatim
+asy -V -f pdf test
+@end verbatim
+In either case, the @code{-V} option opens up a viewer window so you
+can immediately view the result:
+@sp 1
+@center @image{./diagonal}
+@cindex @code{bp}
+@noindent
+Here, the @code{--} connector joins the two points @code{(0,0)} and
+@code{(100,100)} with a line segment.
+
+@node Drawing in interactive mode, Figure size, Drawing in batch mode, Tutorial
+@section Drawing in interactive mode
+@cindex interactive mode
+Another method is @emph{interactive mode}, where @code{Asymptote} reads
+individual commands as they are entered by the user. To try this out, enter
+@code{Asymptote}'s interactive mode by clicking on the
+@code{Asymptote} icon or typing the command @code{asy}.
+Then type
+@verbatim
+draw((0,0)--(100,100));
+@end verbatim
+@noindent
+followed by @code{Enter}, to obtain the above image.
+@cindex tab completion
+@cindex arrow keys
+@cindex erase
+@cindex quit
+@noindent
+At this point you can type further @code{draw} commands, which will be added
+to the displayed figure, @code{erase} to clear the canvas,
+@verbatim
+input test;
+@end verbatim
+@noindent
+to execute all of the commands contained in the file @code{test.asy},
+or @code{quit} to exit interactive mode.
+You can use the arrow keys in interactive mode to edit previous lines.
+The tab key will automatically complete unambiguous words;
+otherwise, hitting tab again will show the possible choices. Further
+commands specific to interactive mode are described in @ref{Interactive mode}.
+
+@node Figure size, Labels, Drawing in interactive mode, Tutorial
+@section Figure size
+@cindex @code{size}
+@cindex @code{pair}
+In @code{Asymptote}, coordinates like @code{(0,0)} and @code{(100,100)},
+called @emph{pairs},
+are expressed in @code{PostScript} "big points" (1 @code{bp} = 1/72
+@code{inch}) and the default line width is @code{0.5bp}.
+However, it is often inconvenient to work directly in
+@code{PostScript} coordinates.
+The next example produces identical output to the previous example, by
+scaling the line @code{(0,0)--(1,1)} to fit a rectangle of width
+@code{100.5 bp} and height @code{100.5 bp} (the extra @code{0.5bp}
+accounts for the line width):
+@verbatim
+size(100.5,100.5);
+draw((0,0)--(1,1));
+@end verbatim
+@sp 1
+@center @image{./diagonal}
+
+@cindex @code{inches}
+@cindex @code{cm}
+@cindex @code{mm}
+@cindex @code{pt}
+One can also specify the size in @code{pt} (1 @code{pt} = 1/72.27 @code{inch}),
+@code{cm}, @code{mm}, or @code{inches}.
+Two nonzero size arguments (or a single size argument) restrict the
+size in both directions, preserving the aspect ratio.
+If 0 is given as a size argument, no restriction is made in that direction;
+the overall scaling will be determined by the other direction (@pxref{size}):
+@verbatiminclude bigdiagonal.asy
+@sp 1
+@center @image{./bigdiagonal}
+
+@cindex @code{cycle}
+To connect several points and create a cyclic path, use the
+@code{cycle} keyword:
+@verbatiminclude square.asy
+@sp 1
+@center @image{./square}
+@noindent
+For convenience, the path @code{(0,0)--(1,0)--(1,1)--(0,1)--cycle}
+may be replaced with the predefined variable
+@code{unitsquare}, or equivalently, @code{box((0,0),(1,1))}.
+
+@cindex user coordinates
+@cindex @code{unitsize}
+To make the user coordinates represent multiples of exactly @code{1cm}:
+@verbatim
+unitsize(1cm);
+draw(unitsquare);
+@end verbatim
+@noindent
+
+@node Labels, Paths, Figure size, Tutorial
+@section Labels
+@cindex @code{label}
+Adding labels is easy in @code{Asymptote}; one specifies the
+label as a double-quoted @code{LaTeX} string, a
+coordinate, and an optional alignment direction:
+@verbatiminclude labelsquare.asy
+@sp 1
+@center @image{./labelsquare}
+
+@cindex compass directions
+@cindex @code{N}
+@cindex @code{E}
+@cindex @code{W}
+@cindex @code{S}
+@code{Asymptote} uses the standard compass directions @code{E=(1,0)},
+@code{N=(0,1)}, @code{NE=unit(N+E)}, and @code{ENE=unit(E+NE)}, etc.,
+which along with the directions @code{up}, @code{down}, @code{right},
+and @code{left} are defined as pairs in the @code{Asymptote} base
+module @code{plain} (a user who has a local variable named @code{E}
+may access the compass direction @code{E} by prefixing it with the name
+of the module where it is defined: @code{plain.E}).
+
+@node Paths, , Labels, Tutorial
+@section Paths
+@cindex @code{path}
+This example draws a path that approximates a quarter circle,
+terminated with an arrowhead:
+@verbatiminclude quartercircle.asy
+@sp 1
+@center @image{./quartercircle}
+@noindent
+Here the directions @code{up} and @code{left} in braces specify the
+outgoing and incoming directions at the points @code{(1,0)} and
+@code{(0,1)}, respectively.
+
+In general, a path is specified as a list of points (or other paths)
+interconnected with
+@cindex @code{cycle}
+@cindex @code{--}
+@cindex @code{..}
+@code{--}, which denotes a straight line segment, or @code{..}, which
+denotes a cubic spline (@pxref{Bezier curves}).
+@cindex @code{unitcircle}
+@anchor{unitcircle}
+@cindex @code{unitcircle}
+Specifying a final @code{..cycle} creates a cyclic path that
+connects smoothly back to the initial node, as in this approximation
+(accurate to within 0.06%) of a unit circle:
+@verbatim
+path unitcircle=E..N..W..S..cycle;
+@end verbatim
+
+@cindex @code{PostScript} subpath
+@cindex @code{^^}
+@cindex @code{path[]}
+@cindex superpath
+@noindent
+An @code{Asymptote} path, being connected, is equivalent to a
+@code{PostScript subpath}. The @code{^^} binary operator, which
+requests that the pen be moved (without drawing or affecting
+endpoint curvatures) from the final point of the left-hand path to the
+initial point of the right-hand path, may be used to group several
+@code{Asymptote} paths into a @code{path[]} array (equivalent to a
+@code{PostScript} path):
+@verbatiminclude superpath.asy
+@sp 1
+@center @image{./superpath}
+
+@cindex evenodd
+@noindent
+The @code{PostScript} even-odd fill rule here specifies that only the
+region bounded between the two unit circles is filled (@pxref{fillrule}).
+In this example, the same effect can be achieved by using the default
+zero winding number fill rule, if one is careful to alternate the
+orientation of the paths:
+@verbatim
+filldraw(unitcircle^^reverse(g),yellow,black);
+@end verbatim
+
+@cindex @code{unitbox}
+The @code{^^} operator is used by the @code{box(triple, triple)} function in
+the module @code{three} to construct the edges of a
+cube @code{unitbox} without retracing steps (@pxref{three}):
+@verbatiminclude cube.asy
+@sp 1
+@center @image{./cube}
+
+See section @ref{graph} (or the online
+@code{Asymptote} @uref{https://asymptote.sourceforge.io/gallery,,gallery} and
+external links posted at @url{https://asymptote.sourceforge.io}) for
+further examples, including two-dimensional and interactive
+three-dimensional scientific graphs. Additional examples have been
+posted by Philippe Ivaldi at @url{http://www.piprime.fr/asymptote}.
+
+@node Drawing commands, Bezier curves, Tutorial, Top
+@chapter Drawing commands
+@cindex drawing commands
+
+All of @code{Asymptote}'s graphical capabilities are based on four primitive
+commands. The three @code{PostScript} drawing commands @code{draw},
+@code{fill}, and @code{clip} add objects to a picture in the order in
+which they are executed, with the most recently drawn object appearing on top.
+The labeling command @code{label} can be used to add text
+labels and external @acronym{EPS} images, which will appear on top of the
+@code{PostScript} objects (since this is normally what one wants), but
+again in the relative order in which they were executed. After drawing
+objects on a picture, the picture can be output with the
+@code{shipout} function (@pxref{shipout}).
+
+@cindex @code{layer}
+If you wish to draw @code{PostScript} objects on top of labels (or verbatim
+@code{tex} commands; @pxref{tex}), the @code{layer} command may be
+used to start a
+new @code{PostScript/LaTeX} layer:
+@verbatim
+void layer(picture pic=currentpicture);
+@end verbatim
+
+The @code{layer} function gives one full control over the order in which
+objects are drawn. Layers are drawn sequentially, with the most recent
+layer appearing on top. Within each layer, labels, images, and
+verbatim @code{tex} commands are always drawn after the
+@code{PostScript} objects in that layer.
+
+@cindex @code{newpage}
+A page break can be generated with the command
+@verbatim
+void newpage(picture pic=currentpicture);
+@end verbatim
+
+While some of these drawing commands take many options, they all have sensible
+default values (for example, the picture argument defaults to
+currentpicture).
+
+@cindex legend
+@cindex @code{draw}
+@cindex @code{arrow}
+
+@menu
+* draw:: Draw a path on a picture or frame
+* fill:: Fill a cyclic path on a picture or frame
+* clip:: Clip a picture or frame to a cyclic path
+* label:: Label a point on a picture
+@end menu
+
+@node draw, fill, Drawing commands, Drawing commands
+@section draw
+@cindex @code{draw}
+@verbatim
+void draw(picture pic=currentpicture, Label L="", path g,
+ align align=NoAlign, pen p=currentpen,
+ arrowbar arrow=None, arrowbar bar=None, margin margin=NoMargin,
+ Label legend="", marker marker=nomarker);
+@end verbatim
+
+Draw the path @code{g} on the picture @code{pic} using pen @code{p}
+for drawing, with optional drawing attributes (Label @code{L},
+explicit label alignment @code{align},
+arrows and bars @code{arrow} and @code{bar}, margins @code{margin},
+legend, and markers @code{marker}). Only one parameter, the path, is
+required. For convenience, the arguments @code{arrow} and @code{bar} may be
+specified in either order. The argument @code{legend} is a Label to
+use in constructing an optional legend entry.
+
+@cindex @code{None}
+@cindex @code{BeginBar}
+@cindex @code{EndBar}
+@cindex @code{Bar}
+@cindex @code{Bars}
+@cindex @code{barsize}
+Bars are useful for indicating dimensions. The possible values of
+@code{bar} are @code{None}, @code{BeginBar}, @code{EndBar} (or
+equivalently @code{Bar}), and @code{Bars} (which draws a bar at both
+ends of the path). Each of these bar specifiers (except for
+@code{None}) will accept an optional real argument that denotes the
+length of the bar in @code{PostScript} coordinates. The default
+bar length is @code{barsize(pen)}.
+
+@cindex arrows
+@anchor{arrows}
+@cindex @code{None}
+@cindex @code{Blank}
+@cindex @code{BeginArrow}
+@cindex @code{MidArrow}
+@cindex @code{EndArrow}
+@cindex @code{Arrow}
+@cindex @code{Arrows}
+@cindex @code{FillDraw}
+@cindex @code{Fill}
+@cindex @code{Draw}
+@cindex @code{NoFill}
+@cindex @code{UnFill}
+@cindex @code{BeginArcArrow}
+@cindex @code{MidArcArrow}
+@cindex @code{EndArcArrow}
+@cindex @code{ArcArrow}
+@cindex @code{ArcArrows}
+
+@cindex @code{DefaultHead}
+@cindex @code{SimpleHead}
+@cindex @code{HookHead}
+@cindex @code{TeXHead}
+The possible values of @code{arrow} are @code{None}, @code{Blank}
+(which draws no arrows or path), @code{BeginArrow}, @code{MidArrow},
+@code{EndArrow} (or equivalently @code{Arrow}),
+and @code{Arrows} (which draws an arrow at both ends of the path).
+All of the arrow specifiers except for @code{None} and @code{Blank}
+may be given the optional arguments arrowhead @code{arrowhead} (one of
+the predefined arrowhead styles @code{DefaultHead}, @code{SimpleHead},
+@code{HookHead}, @code{TeXHead}),
+real @code{size} (arrowhead size in @code{PostScript} coordinates),
+real @code{angle} (arrowhead angle
+in degrees), filltype @code{filltype} (one of @code{FillDraw}, @code{Fill},
+@code{NoFill}, @code{UnFill}, @code{Draw}) and (except for
+@code{MidArrow} and @code{Arrows}) a real @code{position} (in the
+sense of @code{point(path p, real t)}) along the path where the tip of
+the arrow should be placed. The default arrowhead size when drawn
+with a pen @code{p} is @code{arrowsize(p)}. There are also arrow versions with
+slightly modified default values of @code{size} and @code{angle} suitable for
+curved arrows: @code{BeginArcArrow}, @code{EndArcArrow} (or equivalently
+@code{ArcArrow}), @code{MidArcArrow}, and @code{ArcArrows}.
+
+@cindex @code{NoMargin}
+@cindex @code{BeginMargin}
+@cindex @code{EndMargin}
+@cindex @code{Margin}
+@cindex @code{Margins}
+@cindex @code{BeginPenMargin}
+@cindex @code{EndPenMargin}
+@cindex @code{PenMargin}
+@cindex @code{PenMargins}
+@cindex @code{BeginDotMargin}
+@cindex @code{EndDotMargin}
+@cindex @code{DotMargin}
+@cindex @code{DotMargins}
+@cindex @code{Margin}
+@cindex @code{TrueMargin}
+Margins can be used to shrink the visible portion of a path by
+@code{labelmargin(p)} to avoid overlap with other drawn objects.
+Typical values of @code{margin}
+are @code{NoMargin}, @code{BeginMargin}, @code{EndMargin} (or
+equivalently @code{Margin}), and @code{Margins} (which leaves a margin
+at both ends of the path). One may use
+@code{Margin(real begin, real end=begin)}
+to specify the size of the beginning and ending margin, respectively,
+in multiples of the units @code{labelmargin(p)} used for aligning labels.
+Alternatively, @code{BeginPenMargin}, @code{EndPenMargin}
+(or equivalently @code{PenMargin}), @code{PenMargins},
+@code{PenMargin(real begin, real end=begin)} specify a margin in units of
+the pen line width, taking account of the pen line width when drawing
+the path or arrow. For example, use @code{DotMargin}, an
+abbreviation for @code{PenMargin(-0.5*dotfactor,0.5*dotfactor)},
+to draw from the usual beginning point just up to the boundary of an
+end dot of width @code{dotfactor*linewidth(p)}. The qualifiers
+@code{BeginDotMargin}, @code{EndDotMargin}, and @code{DotMargins} work
+similarly. The qualifier @code{TrueMargin(real begin, real end=begin)}
+allows one to specify a margin directly in @code{PostScript} units,
+independent of the pen line width.
+
+The use of arrows, bars, and margins is illustrated by the examples
+@code{@uref{https://asymptote.sourceforge.io/gallery/Pythagoras.svg,,Pythagoras}@uref{https://asymptote.sourceforge.io/gallery/Pythagoras.asy,,.asy}} and
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/sqrtx01.html,,sqrtx01}@uref{https://asymptote.sourceforge.io/gallery/sqrtx01.asy,,.asy}}.
+
+The legend for a picture @code{pic} can be fit and aligned to a frame
+with the routine:
+@cindex @code{legend}
+@verbatim
+frame legend(picture pic=currentpicture, int perline=1,
+ real xmargin=legendmargin, real ymargin=xmargin,
+ real linelength=legendlinelength,
+ real hskip=legendhskip, real vskip=legendvskip,
+ real maxwidth=0, real maxheight=0,
+ bool hstretch=false, bool vstretch=false, pen p=currentpen);
+@end verbatim
+@noindent
+Here @code{xmargin} and @code{ymargin} specify the surrounding @math{x}
+and @math{y} margins, @code{perline} specifies the number of entries
+per line (default 1; 0 means choose this number automatically),
+@code{linelength} specifies the length of the path lines, @code{hskip}
+and @code{vskip} specify the line skip (as a multiple of the legend entry
+size), @code{maxwidth} and @code{maxheight} specify optional upper limits
+on the width and height of the resulting legend (0 means unlimited),
+@code{hstretch} and @code{vstretch} allow the legend to stretch
+horizontally or vertically, and @code{p} specifies the pen used to draw
+the bounding box. The legend frame can then be added and aligned about a
+point on a picture @code{dest} using @code{add} or @code{attach}
+(@pxref{add about}).
+
+@cindex @code{dot}
+To draw a dot, simply draw a path containing a single point.
+The @code{dot} command defined in the module @code{plain} draws a
+dot having a diameter equal to an explicit pen line width or the
+default line width magnified by @code{dotfactor} (6 by default),
+using the specified filltype (@pxref{filltype}) or @code{dotfilltype}
+(@code{Fill} by default):
+@verbatim
+void dot(frame f, pair z, pen p=currentpen, filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, pair z, pen p=currentpen,
+ filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, Label L, pair z, align align=NoAlign,
+ string format=defaultformat, pen p=currentpen, filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, Label[] L=new Label[], pair[] z,
+ align align=NoAlign, string format=defaultformat, pen p=currentpen,
+ filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, path[] g, pen p=currentpen,
+ filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, Label L, pen p=currentpen,
+ filltype filltype=dotfilltype);
+@end verbatim
+
+@cindex @code{Label}
+If the variable @code{Label} is given as the @code{Label}
+argument to the third routine, the @code{format} argument will be
+used to format a string based on the dot location (here @code{defaultformat}
+is @code{"$%.4g$"}).
+The fourth routine draws a dot at every point of a pair array @code{z}.
+One can also draw a dot at every node of a path:
+@verbatim
+void dot(picture pic=currentpicture, Label[] L=new Label[],
+ explicit path g, align align=RightSide, string format=defaultformat,
+ pen p=currentpen, filltype filltype=dotfilltype);
+@end verbatim
+See @ref{pathmarkers} and @ref{markers} for more general
+methods for marking path nodes.
+
+To draw a fixed-sized object (in @code{PostScript} coordinates) about
+the user coordinate @code{origin}, use the routine
+@cindex @code{draw}
+@verbatim
+void draw(pair origin, picture pic=currentpicture, Label L="", path g,
+ align align=NoAlign, pen p=currentpen, arrowbar arrow=None,
+ arrowbar bar=None, margin margin=NoMargin, Label legend="",
+ marker marker=nomarker);
+@end verbatim
+
+@cindex @code{fill}
+@node fill, clip, draw, Drawing commands
+@section fill
+@cindex @code{fill}
+@verbatim
+void fill(picture pic=currentpicture, path g, pen p=currentpen);
+@end verbatim
+
+Fill the interior region bounded by the cyclic path @code{g} on the picture
+@code{pic}, using the pen @code{p}.
+
+@cindex @code{filldraw}
+There is also a convenient @code{filldraw} command, which fills the path
+and then draws in the boundary. One can specify separate pens for each
+operation:
+@verbatim
+void filldraw(picture pic=currentpicture, path g, pen fillpen=currentpen,
+ pen drawpen=currentpen);
+@end verbatim
+
+@cindex @code{fill}
+This fixed-size version of @code{fill} allows one to fill an object
+described in @code{PostScript} coordinates about the user coordinate
+@code{origin}:
+@verbatim
+void fill(pair origin, picture pic=currentpicture, path g, pen p=currentpen);
+@end verbatim
+
+@noindent
+This is just a convenient abbreviation for the commands:
+@verbatim
+picture opic;
+fill(opic,g,p);
+add(pic,opic,origin);
+@end verbatim
+
+The routine
+@cindex @code{filloutside}
+@verbatim
+void filloutside(picture pic=currentpicture, path g, pen p=currentpen);
+@end verbatim
+@noindent
+fills the region exterior to the path @code{g}, out to the current
+boundary of picture @code{pic}.
+
+@anchor{gradient shading}
+@cindex gradient shading
+
+@cindex shading
+@cindex @code{latticeshade}
+Lattice gradient shading varying smoothly over a two-dimensional
+array of pens @code{p}, using fill rule @code{fillrule}, can be produced with
+@verbatim
+void latticeshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen fillrule=currentpen, pen[][] p)
+@end verbatim
+@cindex @code{stroke}
+If @code{stroke=true}, the region filled is the same as the region that
+would be drawn by @code{draw(pic,g,zerowinding)}; in this case the path
+@code{g} need not be cyclic.
+The pens in @code{p} must belong to the same color space. One can use the
+functions @code{rgb(pen)} or @code{cmyk(pen)} to promote pens to a
+higher color space, as illustrated in the example file
+@code{@uref{https://asymptote.sourceforge.io/gallery/latticeshading.svg,,latticeshading}@uref{https://asymptote.sourceforge.io/gallery/latticeshading.asy,,.asy}}.
+
+@cindex @code{axialshade}
+Axial gradient shading varying smoothly from @code{pena} to @code{penb} in the
+direction of the line segment @code{a--b} can be achieved with
+@verbatim
+void axialshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen pena, pair a, bool extenda=true,
+ pen penb, pair b, bool extendb=true);
+@end verbatim
+@noindent
+The boolean parameters @code{extenda} and @code{extendb} indicate
+whether the shading should extend beyond the axis endpoints @code{a}
+and @code{b}. An example of axial shading is provided in the example file
+@code{@uref{https://asymptote.sourceforge.io/gallery/axialshade.svg,,axialshade}@uref{https://asymptote.sourceforge.io/gallery/axialshade.asy,,.asy}}.
+
+@cindex @code{radialshade}
+Radial gradient shading varying smoothly from
+@code{pena} on the circle with center @code{a} and radius @code{ra} to
+@code{penb} on the circle with center @code{b} and radius @code{rb}
+is similar:
+@verbatim
+void radialshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen pena, pair a, real ra, bool extenda=true,
+ pen penb, pair b, real rb, bool extendb=true);
+@end verbatim
+@noindent
+The boolean parameters @code{extenda} and @code{extendb} indicate
+whether the shading should extend beyond the radii @code{a} and @code{b}.
+Illustrations of radial shading are provided in the example files
+@code{@uref{https://asymptote.sourceforge.io/gallery/shade.svg,,shade}@uref{https://asymptote.sourceforge.io/gallery/shade.asy,,.asy}}, @code{@uref{https://asymptote.sourceforge.io/gallery/ring.pdf,,ring}@uref{https://asymptote.sourceforge.io/gallery/ring.asy,,.asy}}, and @code{@uref{https://asymptote.sourceforge.io/gallery/shadestroke.pdf,,shadestroke}@uref{https://asymptote.sourceforge.io/gallery/shadestroke.asy,,.asy}}.
+
+@cindex @code{gouraudshade}
+Gouraud shading using fill rule @code{fillrule} and the vertex colors in the
+pen array @code{p} on a triangular lattice defined by the vertices
+@code{z} and edge flags @code{edges} is implemented with
+@verbatim
+void gouraudshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen fillrule=currentpen, pen[] p, pair[] z,
+ int[] edges);
+void gouraudshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen fillrule=currentpen, pen[] p, int[] edges);
+@end verbatim
+@noindent
+In the second form, the elements of @code{z} are taken to be successive
+nodes of path @code{g}. The pens in @code{p} must belong to the same
+color space. Illustrations of Gouraud shading are provided in the example file
+@code{@uref{https://asymptote.sourceforge.io/gallery/Gouraud.pdf,,Gouraud}@uref{https://asymptote.sourceforge.io/gallery/Gouraud.asy,,.asy}}.
+The edge flags used in Gouraud shading are documented here:
+@quotation
+@url{https://www.adobe.com/content/dam/acom/en/devnet/postscript/pdfs/TN5600.SmoothShading.pdf}
+@end quotation
+
+@cindex Coons shading
+@cindex tensor product shading
+@cindex @code{tensorshade}
+Tensor product shading using clipping path @code{g}, fill rule
+@code{fillrule} on patches bounded by the @math{n} cyclic paths of
+length 4 in path array @code{b}, using the vertex colors specified in
+the @math{n \times 4} pen array @code{p} and internal control points
+in the @math{n \times 4} array @code{z}, is implemented with
+@verbatim
+void tensorshade(picture pic=currentpicture, path[] g, bool stroke=false,
+ pen fillrule=currentpen, pen[][] p, path[] b=g,
+ pair[][] z=new pair[][]);
+@end verbatim
+@noindent
+If the array @code{z} is empty, Coons shading, in which the color
+control points are calculated automatically, is used.
+The pens in @code{p} must belong to the same color space.
+A simpler interface for the case of a single patch (@math{n=1}) is also
+available:
+@verbatim
+void tensorshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen fillrule=currentpen, pen[] p, path b=g,
+ pair[] z=new pair[]);
+@end verbatim
+One can also smoothly shade the regions between consecutive paths of a
+sequence using a given array of pens:
+@verbatim
+void draw(picture pic=currentpicture, pen fillrule=currentpen, path[] g,
+ pen[] p);
+@end verbatim
+@noindent
+Illustrations of tensor product and Coons shading are provided in the
+example files @code{@uref{https://asymptote.sourceforge.io/gallery/tensor.pdf,,tensor}@uref{https://asymptote.sourceforge.io/gallery/tensor.asy,,.asy}}, @code{@uref{https://asymptote.sourceforge.io/gallery/Coons.pdf,,Coons}@uref{https://asymptote.sourceforge.io/gallery/Coons.asy,,.asy}}, @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/BezierPatch.pdf,,BezierPatch}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/BezierPatch.asy,,.asy}},
+and @code{@uref{https://asymptote.sourceforge.io/gallery/rainbow.pdf,,rainbow}@uref{https://asymptote.sourceforge.io/gallery/rainbow.asy,,.asy}}.
+
+@cindex Function shading
+@cindex function shading
+@cindex @code{functionshade}
+More general shading possibilities are available using @TeX{} engines
+that produce PDF output (@pxref{texengines}): the routine
+@verbatim
+void functionshade(picture pic=currentpicture, path[] g, bool stroke=false,
+ pen fillrule=currentpen, string shader);
+@end verbatim
+@noindent
+shades on picture @code{pic} the interior of path @code{g} according
+to fill rule @code{fillrule} using the @code{PostScript} calculator routine
+specified by the string @code{shader}; this routine takes 2 arguments,
+each in [0,1], and returns @code{colors(fillrule).length} color components.
+Function shading is illustrated in the example @code{@uref{https://asymptote.sourceforge.io/gallery/functionshading.pdf,,functionshading}@uref{https://asymptote.sourceforge.io/gallery/functionshading.asy,,.asy}}.
+
+@cindex unfill
+The following routine uses @code{evenodd} clipping together with the
+@code{^^} operator to unfill a region:
+
+@verbatim
+void unfill(picture pic=currentpicture, path g);
+@end verbatim
+
+@node clip, label, fill, Drawing commands
+@section clip
+@cindex @code{clip}
+@cindex @code{stroke}
+@verbatim
+void clip(picture pic=currentpicture, path g, stroke=false,
+ pen fillrule=currentpen);
+@end verbatim
+
+Clip the current contents of picture @code{pic} to the region bounded
+by the path @code{g}, using fill rule @code{fillrule} (@pxref{fillrule}).
+If @code{stroke=true}, the clipped portion is the same as the region
+that would be drawn with @code{draw(pic,g,zerowinding)}; in
+this case the path @code{g} need not be cyclic. While clipping has no notion
+of depth (it transcends layers and even pages), one can localize clipping
+to a temporary picture, which can then be added to @code{pic}.
+For an illustration of picture clipping, see the first example in @ref{LaTeX usage}.
+
+@node label, , clip, Drawing commands
+@section label
+@cindex @code{label}
+@verbatim
+void label(picture pic=currentpicture, Label L, pair position,
+ align align=NoAlign, pen p=currentpen, filltype filltype=NoFill)
+@end verbatim
+
+Draw Label @code{L} on picture @code{pic} using pen @code{p}. If
+@code{align} is @code{NoAlign}, the label will be centered at user
+coordinate @code{position}; otherwise it will be aligned in the
+direction of @code{align} and displaced from @code{position} by
+the @code{PostScript} offset @code{align*labelmargin(p)}.
+@cindex @code{Align}
+The constant @code{Align} can be used to align the
+bottom-left corner of the label at @code{position}.
+@cindex @code{nullpen}
+@cindex @code{Label}
+@anchor{Label}
+The Label @code{L} can either be a string or the structure obtained by calling
+one of the functions
+@verbatim
+Label Label(string s="", pair position, align align=NoAlign,
+ pen p=nullpen, embed embed=Rotate, filltype filltype=NoFill);
+Label Label(string s="", align align=NoAlign,
+ pen p=nullpen, embed embed=Rotate, filltype filltype=NoFill);
+Label Label(Label L, pair position, align align=NoAlign,
+ pen p=nullpen, embed embed=L.embed, filltype filltype=NoFill);
+Label Label(Label L, align align=NoAlign,
+ pen p=nullpen, embed embed=L.embed, filltype filltype=NoFill);
+@end verbatim
+The text of a Label can be scaled, slanted, rotated, or shifted by
+multiplying it on the left by an affine transform (@pxref{Transforms}).
+For example, @code{rotate(45)*xscale(2)*L} first scales @code{L} in the
+@math{x} direction and then rotates it counterclockwise by 45
+degrees. The final position of a Label can also be shifted by a
+@code{PostScript} coordinate translation: @code{shift(10,0)*L}.
+An explicit pen specified within the Label overrides other pen arguments.
+The @code{embed} argument determines how the Label should transform with the
+embedding picture:
+@table @code
+@item Shift
+@cindex @code{Shift}
+only shift with embedding picture;
+
+@item Rotate
+@cindex @code{Rotate}
+only shift and rotate with embedding picture (default);
+
+@item Rotate(pair z)
+@cindex @code{Rotate(pair z)}
+rotate with (picture-transformed) vector @code{z}.
+
+@item Slant
+@cindex @code{Slant}
+only shift, rotate, slant, and reflect with embedding picture;
+
+@item Scale
+@cindex @code{Scale}
+shift, rotate, slant, reflect, and scale with embedding picture.
+
+@end table
+
+To add a label to a path, use
+@verbatim
+void label(picture pic=currentpicture, Label L, path g, align align=NoAlign,
+ pen p=currentpen, filltype filltype=NoFill);
+@end verbatim
+@cindex @code{Relative}
+By default the label will be positioned at the midpoint of the path.
+An alternative label position (in the sense of @code{point(path p, real t)})
+may be specified as a real value for @code{position} in constructing
+the Label. The position @code{Relative(real)} specifies a location
+relative to the total arclength of the path. These convenient
+abbreviations are predefined:
+@cindex @code{BeginPoint}
+@cindex @code{MidPoint}
+@cindex @code{EndPoint}
+@verbatim
+position BeginPoint=Relative(0);
+position MidPoint=Relative(0.5);
+position EndPoint=Relative(1);
+@end verbatim
+
+@cindex @code{Relative}
+@cindex @code{LeftSide}
+@cindex @code{Center}
+@cindex @code{RightSide}
+Path labels are aligned in the direction @code{align}, which may
+be specified as an absolute compass direction (pair) or a direction
+@code{Relative(pair)} measured relative to a north axis
+in the local direction of the path. For convenience @code{LeftSide},
+@code{Center}, and @code{RightSide} are defined as @code{Relative(W)},
+@code{Relative((0,0))}, and @code{Relative(E)}, respectively.
+Multiplying @code{LeftSide} and @code{RightSide} on the
+left by a real scaling factor will move the label further away from or
+closer to the path.
+
+A label with a fixed-size arrow of length @code{arrowlength} pointing
+to @code{b} from direction @code{dir} can be produced with the routine
+@cindex @code{arrow}
+@verbatim
+void arrow(picture pic=currentpicture, Label L="", pair b, pair dir,
+ real length=arrowlength, align align=NoAlign,
+ pen p=currentpen, arrowbar arrow=Arrow, margin margin=EndMargin);
+@end verbatim
+If no alignment is specified (either in the Label or as an explicit
+argument), the optional Label will be aligned in the direction @code{dir},
+using margin @code{margin}.
+
+@cindex including images
+@cindex @code{graphic}
+@cindex @acronym{EPS}
+The function @code{string graphic(string name, string options="")}
+returns a string that can be used to include an encapsulated
+@code{PostScript} (@acronym{EPS}) file. Here, @code{name} is the name
+of the file to include and @code{options} is a string containing a
+comma-separated list of optional bounding box (@code{bb=llx lly urx
+ury}), width (@code{width=value}), height (@code{height=value}),
+rotation (@code{angle=value}), scaling (@code{scale=factor}), clipping
+(@code{clip=bool}), and draft mode (@code{draft=bool}) parameters. The
+@code{layer()} function can be used to force future objects to be
+drawn on top of the included image:
+@verbatim
+label(graphic("file.eps","width=1cm"),(0,0),NE);
+layer();
+@end verbatim
+
+@cindex @code{baseline}
+The @code{string baseline(string s, string template="\strut")}
+function can be used to enlarge the bounding box of labels to match a
+given template, so that their baselines will be typeset on a
+horizontal line. See @code{@uref{https://asymptote.sourceforge.io/gallery/Pythagoras.svg,,Pythagoras}@uref{https://asymptote.sourceforge.io/gallery/Pythagoras.asy,,.asy}} for an example.
+
+One can prevent labels from overwriting one another with the
+@code{overwrite} pen attribute (@pxref{overwrite}).
+
+The structure @code{object} defined in @code{plain_Label.asy}
+allows Labels and frames to be treated in a uniform manner.
+A group of objects may be packed together into single frame with the routine
+@cindex @code{pack}
+@verbatim
+frame pack(pair align=2S ... object inset[]);
+@end verbatim
+@noindent
+To draw or fill a box (or ellipse or other path) around a Label and
+return the bounding object, use one of the routines
+@verbatim
+object draw(picture pic=currentpicture, Label L, envelope e,
+ real xmargin=0, real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+object draw(picture pic=currentpicture, Label L, envelope e, pair position,
+ real xmargin=0, real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+@end verbatim
+@noindent
+Here @code{envelope} is a boundary-drawing routine such as @code{box},
+@code{roundbox}, or @code{ellipse} defined in @code{plain_boxes.asy}
+(@pxref{envelope}).
+
+@cindex @code{texpath}
+The function @code{path[] texpath(Label L)} returns the path array that
+@TeX{} would fill to draw the Label @code{L}.
+
+@cindex @code{minipage}
+The @code{string minipage(string s, width=100pt)} function can be used
+to format string @code{s} into a paragraph of width @code{width}.
+This example uses @code{minipage}, @code{clip}, and @code{graphic} to
+produce a CD label:
+@sp 1
+@center @image{./CDlabel}
+@verbatiminclude CDlabel.asy
+
+@node Bezier curves, Programming, Drawing commands, Top
+@chapter Bezier curves
+@cindex Bezier curves
+@cindex direction specifier
+Each interior node of a cubic spline may be given a
+direction prefix or suffix @code{@{dir@}}: the direction of the pair
+@code{dir} specifies the direction of the incoming or outgoing tangent,
+respectively, to the curve at that node. Exterior nodes may be
+given direction specifiers only on their interior side.
+
+A cubic spline between the node @math{z_0}, with postcontrol point
+@math{c_0}, and the node @math{z_1}, with precontrol point @math{c_1},
+is computed as the Bezier curve
+@sp 1
+@center @image{./bezier,,,(1-t)^3*z_0+3t(1-t)^2*c_0+3t^2(1-t)*c_1+t^3*z_1 for 0 <=t <= 1.}
+
+As illustrated in the diagram below, the third-order midpoint (@math{m_5})
+constructed from two endpoints @math{z_0} and @math{z_1} and two control points
+@math{c_0} and @math{c_1}, is the point corresponding to @math{t=1/2} on
+the Bezier curve formed by the quadruple (@math{z_0}, @math{c_0},
+@math{c_1}, @math{z_1}). This allows one to recursively construct the
+desired curve, by using the newly extracted third-order midpoint as an
+endpoint and the respective second- and first-order midpoints as control
+points:
+@sp 1
+@center @image{./bezier2}
+
+Here @math{m_0}, @math{m_1} and @math{m_2} are the first-order
+midpoints, @math{m_3} and @math{m_4} are the second-order midpoints, and
+@math{m_5} is the third-order midpoint.
+The curve is then constructed by recursively applying the algorithm to
+(@math{z_0}, @math{m_0}, @math{m_3}, @math{m_5}) and
+(@math{m_5}, @math{m_4}, @math{m_2}, @math{z_1}).
+
+In fact, an analogous property holds for points located at any
+fraction @math{t} in @math{[0,1]} of each segment, not just for
+midpoints (@math{t=1/2}).
+
+The Bezier curve constructed in this manner has the following properties:
+@itemize @bullet
+
+@item It is entirely contained in the convex hull of the given four points.
+
+@item It starts heading from the first endpoint to the first control point
+and finishes heading from the second control point to the second endpoint.
+
+@end itemize
+
+@cindex @code{controls}
+The user can specify explicit control points between two nodes like this:
+@verbatim
+draw((0,0)..controls (0,100) and (100,100)..(100,0));
+@end verbatim
+
+However, it is usually more convenient to just use the
+@code{..} operator, which tells @code{Asymptote} to choose its own
+control points using the algorithms described in Donald Knuth's
+monograph, The MetaFontbook, Chapter 14.
+The user can still customize the guide (or path) by specifying
+direction, tension, and curl values.
+
+The higher the tension, the straighter the curve is, and the more
+it approximates a straight line.
+@cindex @code{tension}
+@cindex @code{and}
+@cindex @code{atleast}
+One can change the spline tension from its default value of 1 to any
+real value greater than or equal to 0.75 (cf. John D. Hobby, Discrete and
+Computational Geometry 1, 1986):
+@verbatim
+draw((100,0)..tension 2 ..(100,100)..(0,100));
+draw((100,0)..tension 3 and 2 ..(100,100)..(0,100));
+draw((100,0)..tension atleast 2 ..(100,100)..(0,100));
+@end verbatim
+
+In these examples there is a space between @code{2} and @code{..}.
+This is needed as @code{2.} is interpreted as a numerical constant.
+
+@cindex @code{curl}
+The curl parameter specifies the curvature at the endpoints of a path
+(0 means straight; the default value of 1 means approximately circular):
+@verbatim
+draw((100,0){curl 0}..(100,100)..{curl 0}(0,100));
+@end verbatim
+
+@cindex @code{MetaPost ...@ }
+@cindex @code{::}
+The @code{MetaPost ...} path connector, which requests, when possible, an
+inflection-free curve confined to a triangle defined by the
+endpoints and directions, is implemented in @code{Asymptote} as the
+convenient abbreviation @code{::} for @code{..tension atleast 1 ..}
+(the ellipsis @code{...} is used in @code{Asymptote} to indicate a
+variable number of arguments; @pxref{Rest arguments}). For example,
+compare
+@verbatiminclude dots.asy
+@sp 1
+@center @image{./dots}
+@noindent
+with
+@verbatiminclude colons.asy
+@sp 1
+@center @image{./colons}
+
+@cindex @code{---}
+@cindex @code{&}
+The @code{---} connector is an abbreviation for @code{..tension atleast
+infinity..} and the @code{&} connector concatenates two paths, after
+first stripping off the last node of the first path (which normally
+should coincide with the first node of the second path).
+
+@node Programming, LaTeX usage, Bezier curves, Top
+@chapter Programming
+@cindex programming
+
+@menu
+* Data types:: void, bool, int, real, pair, triple, string
+* Paths and guides:: Bezier curves
+* Pens:: Colors, line types, line widths, font sizes
+* Transforms:: Affine transforms
+* Frames and pictures:: Canvases for immediate and deferred drawing
+* Files:: Reading and writing your data
+* Variable initializers:: Initialize your variables
+* Structures:: Organize your data
+* Operators:: Arithmetic and logical operators
+* Implicit scaling:: Avoiding those ugly *s
+* Functions:: Traditional and high-order functions
+* Arrays:: Dynamic vectors
+* Casts:: Implicit and explicit casts
+* Import:: Importing external @code{Asymptote} modules
+* Static:: Where to allocate your variable?
+@end menu
+
+Here is a short introductory example to the @code{Asymptote} programming
+language that highlights the similarity of its control structures
+with those of C, C++, and Java:
+@cindex declaration
+@cindex assignment
+@cindex conditional
+@cindex loop
+@cindex @code{if}
+@cindex @code{else}
+@cindex @code{for}
+@verbatim
+// This is a comment.
+
+// Declaration: Declare x to be a real variable;
+real x;
+
+// Assignment: Assign the real variable x the value 1.
+x=1.0;
+
+// Conditional: Test if x equals 1 or not.
+if(x == 1.0) {
+ write("x equals 1.0");
+} else {
+ write("x is not equal to 1.0");
+}
+
+// Loop: iterate 10 times
+for(int i=0; i < 10; ++i) {
+ write(i);
+}
+
+@end verbatim
+
+@cindex @code{while}
+@cindex @code{do}
+@cindex @code{break}
+@cindex @code{continue}
+@code{Asymptote} supports @code{while}, @code{do}, @code{break}, and
+@code{continue} statements just as in C/C++. It also supports the Java-style
+shorthand for iterating over all elements of an array:
+
+@cindex array iteration
+@anchor{array iteration}
+@verbatim
+// Iterate over an array
+int[] array={1,1,2,3,5};
+for(int k : array) {
+ write(k);
+}
+@end verbatim
+@noindent
+In addition, it supports many features beyond the ones found in those
+languages.
+
+@node Data types, Paths and guides, Programming, Programming
+@section Data types
+@cindex data types
+@code{Asymptote} supports the following data types (in addition to
+user-defined types):
+
+@table @code
+
+@item void
+@cindex @code{void}
+The void type is used only by functions that take or return no arguments.
+
+@item bool
+@cindex @code{bool}
+a boolean type that can only take on the values @code{true} or
+@code{false}. For example:
+@verbatim
+bool b=true;
+@end verbatim
+
+@noindent
+defines a boolean variable @code{b} and initializes it to the value
+@code{true}. If no initializer is given:
+@verbatim
+bool b;
+@end verbatim
+
+@noindent
+the value @code{false} is assumed.
+
+@item bool3
+@cindex @code{bool3}
+an extended boolean type that can take on the values
+@code{true}, @code{default}, or @code{false}. A bool3 type can be cast
+to or from a bool. The default initializer for bool3 is @code{default}.
+
+@item int
+@cindex @code{int}
+@cindex @code{intMin}
+@cindex @code{intMax}
+an integer type; if no initializer is given, the implicit value @code{0}
+is assumed. The minimum allowed value of an integer is @code{intMin} and the
+maximum value is @code{intMax}.
+
+@item real
+@cindex @code{real}
+@cindex @code{realMin}
+@cindex @code{realMax}
+@cindex @code{realEpsilon}
+@cindex @code{realDigits}
+@cindex @code{mask}
+@cindex @code{inf}
+@cindex @code{nan}
+@cindex @code{isnan}
+a real number; this should be set to the highest-precision native
+floating-point type on the architecture. The implicit initializer for
+reals is @code{0.0}. Real numbers have precision
+@code{realEpsilon}, with @code{realDigits} significant digits.
+The smallest positive real number is @code{realMin} and the largest
+positive real number is @code{realMax}.
+The variables @code{inf} and @code{nan}, along with the function
+@code{bool isnan(real x)} are useful when floating-point exceptions
+are masked with the @code{-mask} command-line option (the default in
+interactive mode).
+
+@item pair
+@cindex @code{pair}
+complex number, that is, an ordered pair of real components @code{(x,y)}.
+The real and imaginary parts of a pair @code{z} can read as @code{z.x}
+and @code{z.y}. We say that @code{x} and @code{y} are virtual members of
+the data element pair; they cannot be directly modified, however.
+The implicit initializer for pairs is @code{(0.0,0.0)}.
+
+There are a number of ways to take the complex conjugate of a pair:
+@example
+pair z=(3,4);
+z=(z.x,-z.y);
+z=z.x-I*z.y;
+z=conj(z);
+@end example
+
+Here @code{I} is the pair @code{(0,1)}.
+A number of built-in functions are defined for pairs:
+
+@table @code
+@item pair conj(pair z)
+@cindex @code{conj}
+returns the conjugate of @code{z};
+
+@item real length(pair z)
+@cindex @code{length}
+@cindex @code{abs}
+@cindex @code{abs2}
+returns the complex modulus @math{|@code{z}|} of its argument @code{z}.
+For example,
+@example
+pair z=(3,4);
+length(z);
+@end example
+returns the result 5. A synonym for @code{length(pair)} is @code{abs(pair)}.
+The function @code{abs2(pair z)} returns @math{|@code{z}|^2};
+
+@item real angle(pair z, bool warn=true)
+@cindex @code{angle}
+returns the angle of @code{z} in radians in the interval
+[-@code{pi},@code{pi}] or @code{0} if @code{warn} is @code{false} and
+@code{z=(0,0)} (rather than producing an error);
+
+@item real degrees(pair z, bool warn=true)
+@cindex @code{degrees}
+returns the angle of @code{z} in degrees in the interval [0,360)
+or @code{0} if @code{warn} is @code{false} and @code{z=(0,0)} (rather than
+producing an error);
+
+@item pair unit(pair z)
+@cindex @code{unit}
+returns a unit vector in the direction of the pair @code{z};
+
+@item pair expi(real angle)
+@cindex @code{expi}
+returns a unit vector in the direction @code{angle} measured in radians;
+
+@item pair dir(real degrees)
+@cindex @code{dir}
+returns a unit vector in the direction @code{degrees} measured in degrees;
+
+@item real xpart(pair z)
+@cindex @code{xpart}
+returns @code{z.x};
+
+@item real ypart(pair z)
+@cindex @code{ypart}
+returns @code{z.y};
+
+@item pair realmult(pair z, pair w)
+@cindex @code{realmult}
+returns the element-by-element product @code{(z.x*w.x,z.y*w.y)};
+
+@item real dot(explicit pair z, explicit pair w)
+@cindex @code{dot}
+returns the dot product @code{z.x*w.x+z.y*w.y};
+
+@item real cross(explicit pair z, explicit pair w)
+@cindex @code{cross}
+returns the 2D scalar product @code{z.x*w.y-z.y*w.x};
+
+@cindex @code{orient}
+@item real orient(pair a, pair b, pair c);
+returns a positive (negative) value if @code{a--b--c--cycle} is oriented
+counterclockwise (clockwise) or zero if all three points are colinear.
+Equivalently, a positive (negative) value is returned if
+@code{c} lies to the left (right) of the line through @code{a} and @code{b}
+or zero if @code{c} lies on this line.
+The value returned can be expressed in terms of the 2D scalar cross product
+as @code{cross(a-c,b-c)}, which is the determinant
+@verbatim
+|a.x a.y 1|
+|b.x b.y 1|
+|c.x c.y 1|
+@end verbatim
+
+@cindex @code{incircle}
+@item real incircle(pair a, pair b, pair c, pair d);
+returns a positive (negative) value if @code{d} lies inside (outside)
+the circle passing through the counterclockwise-oriented points @code{a,b,c}
+or zero if @code{d} lies on the this circle.
+The value returned is the determinant
+@verbatim
+|a.x a.y a.x^2+a.y^2 1|
+|b.x b.y b.x^2+b.y^2 1|
+|c.x c.y c.x^2+c.y^2 1|
+|d.x d.y d.x^2+d.y^2 1|
+@end verbatim
+
+@item pair minbound(pair z, pair w)
+@cindex @code{minbound}
+returns @code{(min(z.x,w.x),min(z.y,w.y))};
+
+@item pair maxbound(pair z, pair w)
+@cindex @code{maxbound}
+returns @code{(max(z.x,w.x),max(z.y,w.y))}.
+
+@end table
+
+@item triple
+@cindex @code{triple}
+an ordered triple of real components @code{(x,y,z)} used for
+three-dimensional drawings. The respective components of a triple
+@code{v} can read as @code{v.x}, @code{v.y}, and @code{v.z}.
+The implicit initializer for triples is @code{(0.0,0.0,0.0)}.
+
+Here are the built-in functions for triples:
+@table @code
+@item real length(triple v)
+@cindex @code{length}
+@cindex @code{abs}
+@cindex @code{abs2}
+returns the length @math{|@code{v}|} of its argument @code{v}.
+A synonym for @code{length(triple)} is @code{abs(triple)}.
+The function @code{abs2(triple v)} returns @math{|@code{v}|^2};
+
+@item real polar(triple v, bool warn=true)
+@cindex @code{polar}
+returns the colatitude of @code{v} measured from the @math{z} axis in radians
+or @code{0} if @code{warn} is @code{false} and @code{v=O} (rather than
+producing an error);
+
+@item real azimuth(triple v, bool warn=true)
+@cindex @code{azimuth}
+returns the longitude of @code{v} measured from the @math{x} axis in radians
+or @code{0} if @code{warn} is @code{false} and @code{v.x=v.y=0} (rather than
+producing an error);
+
+@item real colatitude(triple v, bool warn=true)
+@cindex @code{colatitude}
+returns the colatitude of @code{v} measured from the @math{z} axis in degrees
+or @code{0} if @code{warn} is @code{false} and @code{v=O} (rather than
+producing an error);
+
+@item real latitude(triple v, bool warn=true)
+@cindex @code{latitude}
+returns the latitude of @code{v} measured from the @math{xy} plane in degrees
+or @code{0} if @code{warn} is @code{false} and @code{v=O} (rather than
+producing an error);
+
+@item real longitude(triple v, bool warn=true)
+@cindex @code{longitude}
+returns the longitude of @code{v} measured from the @math{x} axis in degrees
+or @code{0} if @code{warn} is @code{false} and @code{v.x=v.y=0} (rather than
+producing an error);
+
+@item triple unit(triple v)
+@cindex @code{unit}
+returns a unit triple in the direction of the triple @code{v};
+
+@item triple expi(real polar, real azimuth)
+@cindex @code{expi}
+returns a unit triple in the direction @code{(polar,azimuth)}
+measured in radians;
+
+@item triple dir(real colatitude, real longitude)
+@cindex @code{dir}
+returns a unit triple in the direction @code{(colatitude,longitude)}
+measured in degrees;
+
+@item real xpart(triple v)
+@cindex @code{xpart}
+returns @code{v.x};
+
+@item real ypart(triple v)
+@cindex @code{ypart}
+returns @code{v.y};
+
+@item real zpart(triple v)
+@cindex @code{zpart}
+returns @code{v.z};
+
+@item real dot(triple u, triple v)
+@cindex @code{dot}
+returns the dot product @code{u.x*v.x+u.y*v.y+u.z*v.z};
+
+@item triple cross(triple u, triple v)
+@cindex @code{cross}
+returns the cross product
+
+@code{(u.y*v.z-u.z*v.y,u.z*v.x-u.x*v.z,u.x*v.y-v.x*u.y)};
+
+@item triple minbound(triple u, triple v)
+@cindex @code{minbound}
+returns @code{(min(u.x,v.x),min(u.y,v.y),min(u.z,v.z))};
+
+@item triple maxbound(triple u, triple v)
+@cindex @code{maxbound}
+returns @code{(max(u.x,v.x),max(u.y,v.y),max(u.z,v.z)}).
+
+@end table
+
+@item string
+@cindex @code{string}
+@cindex @TeX{} string
+a character string, implemented using the STL @code{string} class.
+
+Strings delimited by double quotes (@code{"}) are subject to the
+following mappings to allow the use of double quotes in @TeX{} (e.g.@ for
+using the @code{babel} package, @pxref{babel}):
+
+@itemize @bullet
+@item \" maps to "
+@item \\ maps to \\
+@end itemize
+
+@cindex @code{C} string
+Strings delimited by single quotes (@code{'}) have the same mappings as
+character strings in ANSI @code{C}:
+
+@itemize @bullet
+@item \' maps to '
+@item \" maps to "
+@item \? maps to ?
+@item \\ maps to backslash
+@item \a maps to alert
+@item \b maps to backspace
+@item \f maps to form feed
+@item \n maps to newline
+@item \r maps to carriage return
+@item \t maps to tab
+@item \v maps to vertical tab
+@item \0-\377 map to corresponding octal byte
+@item \x0-\xFF map to corresponding hexadecimal byte
+@end itemize
+
+The implicit initializer for strings is the empty string @code{""}.
+Strings may be concatenated with the @code{+} operator. In the following
+string functions, position @code{0} denotes the start of the string:
+@table @code
+
+@cindex @code{length}
+@item int length(string s)
+returns the length of the string @code{s};
+
+@cindex @code{find}
+@item int find(string s, string t, int pos=0)
+returns the position of the first occurrence of string @code{t} in string
+@code{s} at or after position @code{pos}, or -1 if @code{t} is not a
+substring of @code{s};
+
+@cindex @code{rfind}
+@item int rfind(string s, string t, int pos=-1)
+returns the position of the last occurrence of string @code{t} in string
+@code{s} at or before position @code{pos} (if @code{pos}=-1, at the end
+of the string @code{s}), or -1 if @code{t} is not a substring of @code{s};
+
+@cindex @code{insert}
+@item string insert(string s, int pos, string t)
+returns the string formed by inserting string @code{t} at position
+@code{pos} in @code{s};
+
+@cindex @code{erase}
+@item string erase(string s, int pos, int n)
+returns the string formed by erasing the string of length @code{n}
+(if @code{n}=-1, to the end of the string @code{s}) at
+position @code{pos} in @code{s};
+
+@cindex @code{substr}
+@item string substr(string s, int pos, int n=-1)
+returns the substring of @code{s} starting at position @code{pos}
+and of length @code{n} (if @code{n}=-1, until the end of the
+string @code{s});
+
+@cindex @code{reverse}
+@item string reverse(string s)
+returns the string formed by reversing string @code{s};
+
+@item string replace(string s, string before, string after)
+@cindex @code{replace}
+returns a string with all occurrences of the string @code{before} in the
+string @code{s} changed to the string @code{after};
+
+@item string replace(string s, string[][] table)
+returns a string constructed by translating in string @code{s} all
+occurrences of the string @code{before} in an array @code{table} of
+string pairs @{@code{before},@code{after}@} to the corresponding
+string @code{after};
+
+@cindex @code{split}
+@item string[] split(string s, string delimiter="")
+returns an array of strings obtained by splitting @code{s} into substrings
+delimited by @code{delimiter} (an empty delimiter signifies a space,
+but with duplicate delimiters discarded);
+
+@cindex @code{array}
+@cindex @code{operator +(...string[] a)}.
+@item string[] array(string s)
+returns an array of strings obtained by splitting @code{s} into
+individual characters. The inverse operation is provided by
+@code{operator +(...string[] a)}.
+
+@anchor{format}
+@item string format(string s, int n, string locale="")
+@cindex @code{format}
+returns a string containing @code{n} formatted according to the C-style format
+string @code{s} using locale @code{locale} (or the current locale if an
+empty string is specified), following the behaviour of the C function
+@code{fprintf}), except that only one data field is allowed.
+
+@item string format(string s=defaultformat, bool forcemath=false, string s=defaultseparator, real x, string locale="")
+returns a string containing @code{x} formatted according to the C-style format
+string @code{s} using locale @code{locale} (or the current locale if an
+empty string is specified), following the behaviour of the C function
+@code{fprintf}), except that only one data field is allowed, trailing
+zeros are removed by default (unless @code{#} is specified), and
+if @code{s} specifies math mode or @code{forcemath=true}, @TeX{} is
+used to typeset scientific notation using the
+@code{defaultseparator="\!\times\!";};
+
+@cindex @code{hex}
+@cindex @code{hexadecimal}
+@item int hex(string s);
+casts a hexadecimal string @code{s} to an integer;
+
+@cindex @code{ascii}
+@cindex @code{ascii}
+@item int ascii(string s);
+returns the ASCII code for the first character of string @code{s};
+
+@cindex @code{string}
+@item string string(real x, int digits=realDigits)
+casts @code{x} to a string using precision @code{digits} and the C locale;
+
+@cindex @code{locale}
+@item string locale(string s="")
+sets the locale to the given string, if nonempty, and returns the
+current locale;
+
+@item string time(string format="%a %b %d %T %Z %Y")
+@cindex @code{time}
+@cindex date
+@cindex @code{strftime}
+returns the current time formatted by the ANSI C routine
+@code{strftime} according to the string @code{format} using the current
+locale. Thus
+@verbatim
+time();
+time("%a %b %d %H:%M:%S %Z %Y");
+@end verbatim
+
+@noindent
+are equivalent ways of returning the current time in the default
+format used by the @code{UNIX} @code{date} command;
+
+@cindex @code{seconds}
+@cindex @code{strptime}
+@item int seconds(string t="", string format="")
+returns the time measured in seconds after the Epoch (Thu Jan 01
+00:00:00 UTC 1970) as determined by the ANSI C routine @code{strptime}
+according to the string @code{format} using the current locale, or the
+current time if @code{t} is the empty string.
+Note that the @code{"%Z"} extension to the POSIX @code{strptime}
+specification is ignored by the current GNU C Library. If an error occurs, the
+value -1 is returned. Here are some examples:
+@verbatim
+seconds("Mar 02 11:12:36 AM PST 2007","%b %d %r PST %Y");
+seconds(time("%b %d %r %z %Y"),"%b %d %r %z %Y");
+seconds(time("%b %d %r %Z %Y"),"%b %d %r "+time("%Z")+" %Y");
+1+(seconds()-seconds("Jan 1","%b %d"))/(24*60*60);
+@end verbatim
+The last example returns today's ordinal date, measured from the
+beginning of the year.
+
+@cindex @code{time}
+@cindex @code{strftime}
+@item string time(int seconds, string format="%a %b %d %T %Z %Y")
+returns the time corresponding to @code{seconds} seconds after the Epoch
+(Thu Jan 01 00:00:00 UTC 1970) formatted by the ANSI C routine
+@code{strftime} according to the string @code{format} using the current
+locale. For example, to return the date corresponding to 24 hours ago:
+@verbatim
+time(seconds()-24*60*60);
+@end verbatim
+
+@cindex @code{system}
+@item int system(string s)
+@item int system(string[] s)
+if the setting @code{safe} is false, call the arbitrary system command @code{s};
+
+@cindex @code{asy}
+@item void asy(string format, bool overwrite=false ... string[] s)
+conditionally process each file name in array @code{s} in a new environment,
+using format @code{format}, overwriting the output file only if
+@code{overwrite} is true;
+
+@cindex @code{abort}
+@item void abort(string s="")
+aborts execution (with a non-zero return code in batch mode); if string
+@code{s} is nonempty, a diagnostic message constructed from the source
+file, line number, and @code{s} is printed;
+
+@cindex @code{assert}
+@item void assert(bool b, string s="")
+aborts execution with an error message constructed from @code{s} if
+@code{b=false};
+
+@cindex @code{exit}
+@item void exit()
+exits (with a zero error return code in batch mode);
+
+@cindex @code{sleep}
+@item void sleep(int seconds)
+pauses for the given number of seconds;
+
+@cindex @code{usleep}
+@item void usleep(int microseconds)
+pauses for the given number of microseconds;
+
+@cindex @code{beep}
+@item void beep()
+produces a beep on the console;
+
+@end table
+
+@cindex @code{typedef}
+
+@end table
+
+As in C/C++, complicated types may be abbreviated with @code{typedef}
+(see the example in @ref{Functions}).
+
+@node Paths and guides, Pens, Data types, Programming
+@section Paths and guides
+
+@table @code
+
+@item path
+@cindex @code{path}
+a cubic spline resolved into a fixed path.
+The implicit initializer for paths is @code{nullpath}.
+
+@cindex @code{circle}
+@anchor{circle}
+For example, the routine @code{circle(pair c, real r)}, which returns a
+Bezier curve approximating a circle of radius @code{r} centered on @code{c},
+is based on @code{unitcircle} (@pxref{unitcircle}):
+@verbatim
+path circle(pair c, real r)
+{
+ return shift(c)*scale(r)*unitcircle;
+}
+@end verbatim
+If high accuracy is needed, a true circle may be produced with the
+routine @code{Circle} defined in the module @code{graph}:
+@cindex @code{Circle}
+@verbatim
+import graph;
+path Circle(pair c, real r, int n=nCircle);
+@end verbatim
+
+A circular arc consistent with @code{circle} centered on
+@code{c} with radius @code{r} from @code{angle1} to @code{angle2}
+degrees, drawing counterclockwise if @code{angle2 >= angle1}, can be
+constructed with
+@cindex @code{arc}
+@verbatim
+path arc(pair c, real r, real angle1, real angle2);
+@end verbatim
+One may also specify the direction explicitly:
+@verbatim
+path arc(pair c, real r, real angle1, real angle2, bool direction);
+@end verbatim
+Here the direction can be specified as CCW (counter-clockwise) or CW
+(clockwise). For convenience, an arc centered at @code{c} from pair
+@code{z1} to @code{z2} (assuming @code{|z2-c|=|z1-c|}) in the may also
+be constructed with
+@verbatim
+path arc(pair c, explicit pair z1, explicit pair z2,
+ bool direction=CCW)
+@end verbatim
+
+If high accuracy is needed, true arcs may be produced with routines
+in the module @code{graph} that produce Bezier curves with @code{n}
+control points:
+@cindex @code{Arc}
+@verbatim
+import graph;
+path Arc(pair c, real r, real angle1, real angle2, bool direction,
+ int n=nCircle);
+path Arc(pair c, real r, real angle1, real angle2, int n=nCircle);
+path Arc(pair c, explicit pair z1, explicit pair z2,
+ bool direction=CCW, int n=nCircle);
+@end verbatim
+
+An ellipse can be drawn with the routine
+@cindex @code{ellipse}
+@verbatim
+path ellipse(pair c, real a, real b)
+{
+ return shift(c)*scale(a,b)*unitcircle;
+}
+@end verbatim
+
+A brace can be constructed between pairs @code{a} and @code{b} with
+@cindex @code{brace}
+@verbatim
+path brace(pair a, pair b, real amplitude=bracedefaultratio*length(b-a));
+@end verbatim
+
+This example illustrates the use of all five guide connectors discussed
+in @ref{Tutorial} and @ref{Bezier curves}:
+@verbatiminclude join.asy
+@sp 1
+@center @image{./join}
+
+Here are some useful functions for paths:
+
+@table @code
+
+@cindex @code{length}
+@item int length(path p);
+This is the number of (linear or cubic) segments in path @code{p}.
+If @code{p} is cyclic, this is the same as the number of nodes in @code{p}.
+
+@cindex @code{size}
+@item int size(path p);
+This is the number of nodes in the path @code{p}.
+If @code{p} is cyclic, this is the same as @code{length(p)}.
+
+@cindex @code{cyclic}
+@item bool cyclic(path p);
+returns @code{true} iff path @code{p} is cyclic.
+
+@cindex @code{straight}
+@item bool straight(path p, int i);
+returns @code{true} iff the segment of path @code{p} between node
+@code{i} and node @code{i+1} is straight.
+
+@cindex @code{piecewisestraight}
+@item bool piecewisestraight(path p)
+returns @code{true} iff the path @code{p} is piecewise straight.
+
+@cindex @code{point}
+@item pair point(path p, int t);
+If @code{p} is cyclic, return the coordinates of node @code{t} mod
+@code{length(p)}. Otherwise, return the coordinates of node @code{t},
+unless @code{t} < 0 (in which case @code{point(0)} is returned) or
+@code{t} > @code{length(p)} (in which case @code{point(length(p))}
+is returned).
+
+@item pair point(path p, real t);
+This returns the coordinates of the point between node @code{floor(t)}
+and @code{floor(t)+1} corresponding to the cubic spline parameter
+@code{t-floor(t)} (@pxref{Bezier curves}). If @code{t} lies outside the range
+[0,@code{length(p)}], it is first reduced modulo @code{length(p)}
+in the case where @code{p} is cyclic or else converted to the corresponding
+endpoint of @code{p}.
+
+@cindex @code{dir}
+@item pair dir(path p, int t, int sign=0, bool normalize=true);
+If @code{sign < 0}, return the direction (as a pair) of the incoming tangent
+to path @code{p} at node @code{t}; if @code{sign > 0}, return the
+direction of the outgoing tangent. If @code{sign=0}, the mean of these
+two directions is returned.
+
+@item pair dir(path p, real t, bool normalize=true);
+returns the direction of the tangent to path @code{p} at the point
+between node @code{floor(t)} and @code{floor(t)+1} corresponding to the
+cubic spline parameter @code{t-floor(t)} (@pxref{Bezier curves}).
+
+@item pair dir(path p)
+returns dir(p,length(p)).
+
+@item pair dir(path p, path q)
+returns unit(dir(p)+dir(q)).
+
+@cindex @code{accel}
+@item pair accel(path p, int t, int sign=0);
+If @code{sign < 0}, return the acceleration of the incoming path
+@code{p} at node @code{t}; if @code{sign > 0}, return the
+acceleration of the outgoing path. If @code{sign=0}, the mean of these
+two accelerations is returned.
+
+@cindex @code{accel}
+@item pair accel(path p, real t);
+returns the acceleration of the path @code{p} at the point @code{t}.
+
+@cindex @code{radius}
+@item real radius(path p, real t);
+returns the radius of curvature of the path @code{p} at the point @code{t}.
+
+@cindex @code{precontrol}
+@item pair precontrol(path p, int t);
+returns the precontrol point of @code{p} at node @code{t}.
+
+@item pair precontrol(path p, real t);
+returns the effective precontrol point of @code{p} at parameter @code{t}.
+
+@cindex @code{postcontrol}
+@item pair postcontrol(path p, int t);
+returns the postcontrol point of @code{p} at node @code{t}.
+
+@item pair postcontrol(path p, real t);
+returns the effective postcontrol point of @code{p} at parameter @code{t}.
+
+@cindex @code{arclength}
+@item real arclength(path p);
+returns the length (in user coordinates) of the piecewise linear
+or cubic curve that path @code{p} represents.
+
+@cindex @code{arctime}
+@item real arctime(path p, real L);
+returns the path "time", a real number between 0 and the length of
+the path in the sense of @code{point(path p, real t)}, at which the
+cumulative arclength (measured from the beginning of the path) equals @code{L}.
+
+@cindex @code{arcpoint}
+@item pair arcpoint(path p, real L);
+returns @code{point(p,arctime(p,L))}.
+
+@cindex @code{dirtime}
+@item real dirtime(path p, pair z);
+returns the first "time", a real number between 0 and the length of
+the path in the sense of @code{point(path, real)}, at which the tangent
+to the path has the direction of pair @code{z}, or -1 if this never happens.
+
+@cindex @code{reltime}
+@item real reltime(path p, real l);
+returns the time on path @code{p} at the relative fraction @code{l} of
+its arclength.
+
+@cindex @code{relpoint}
+@item pair relpoint(path p, real l);
+returns the point on path @code{p} at the relative fraction @code{l} of its
+arclength.
+
+@cindex @code{midpoint}
+@item pair midpoint(path p);
+returns the point on path @code{p} at half of its arclength.
+
+@cindex @code{reverse}
+@item path reverse(path p);
+returns a path running backwards along @code{p}.
+
+@cindex @code{subpath}
+@item path subpath(path p, int a, int b);
+returns the subpath of @code{p} running from node @code{a} to node @code{b}.
+If @code{a} < @code{b}, the direction of the subpath is reversed.
+
+@item path subpath(path p, real a, real b);
+returns the subpath of @code{p} running from path time @code{a} to path
+time @code{b}, in the sense of @code{point(path, real)}. If @code{a} <
+@code{b}, the direction of the subpath is reversed.
+
+@cindex @code{intersect}
+@item real[] intersect(path p, path q, real fuzz=-1);
+If @code{p} and @code{q} have at least one intersection point, return a
+real array of length 2 containing the times representing the respective
+path times along @code{p} and @code{q}, in the sense of
+@code{point(path, real)}, for one such intersection point (as chosen by
+the algorithm described on page 137 of @code{The MetaFontbook}).
+The computations are performed to the absolute error specified by @code{fuzz},
+or if @code{fuzz < 0}, to machine precision. If the paths do not
+intersect, return a real array of length 0.
+
+@cindex @code{intersections}
+@item real[][] intersections(path p, path q, real fuzz=-1);
+Return all (unless there are infinitely many) intersection times of
+paths @code{p} and @code{q} as a sorted array of real arrays of length 2
+(@pxref{sort}). The computations are performed to the absolute error
+specified by @code{fuzz}, or if @code{fuzz < 0}, to machine precision.
+
+@cindex @code{intersections}
+@item real[] intersections(path p, explicit pair a, explicit pair b, real fuzz=-1);
+Return all (unless there are infinitely many) intersection times of path
+@code{p} with the (infinite) line through points @code{a} and @code{b}
+as a sorted array. The intersections returned are guaranteed to be
+correct to within the absolute error specified by @code{fuzz}, or if
+@code{fuzz < 0}, to machine precision.
+
+@cindex @code{times}
+@item real[] times(path p, real x)
+returns all intersection times of path @code{p} with the vertical line
+through @code{(x,0)}.
+
+@cindex @code{times}
+@item real[] times(path p, explicit pair z)
+returns all intersection times of path @code{p} with the horizontal line
+through @code{(0,z.y)}.
+
+@cindex @code{mintimes}
+@item real[] mintimes(path p)
+returns an array of length 2 containing times at which path @code{p}
+reaches its minimal horizontal and vertical extents, respectively.
+
+@cindex @code{maxtimes}
+@item real[] maxtimes(path p)
+returns an array of length 2 containing times at which path @code{p}
+reaches its maximal horizontal and vertical extents, respectively.
+
+@cindex @code{intersectionpoint}
+@item pair intersectionpoint(path p, path q, real fuzz=-1);
+returns the intersection point @code{point(p,intersect(p,q,fuzz)[0])}.
+
+@cindex @code{intersectionpoints}
+@item pair[] intersectionpoints(path p, path q, real fuzz=-1);
+returns an array containing all intersection points of the paths
+@code{p} and @code{q}.
+
+@anchor{extension}
+@cindex @code{whatever}
+@cindex @code{extension}
+@item pair extension(pair P, pair Q, pair p, pair q);
+returns the intersection point of the extensions of the line segments
+@code{P--Q} and @code{p--q}, or if the lines are parallel,
+@code{(infinity,infinity)}.
+
+@cindex @code{cut}
+@cindex @code{slice}
+@item slice cut(path p, path knife, int n);
+returns the portions of path @code{p} before and after the @code{n}th
+intersection of @code{p} with path @code{knife} as a structure
+@code{slice} (if no intersection exist is found, the entire path is
+considered to be `before' the intersection):
+@verbatim
+struct slice {
+ path before,after;
+}
+@end verbatim
+The argument @code{n} is treated as modulo the number of intersections.
+
+@cindex @code{firstcut}
+@cindex @code{slice}
+@item slice firstcut(path p, path knife);
+equivalent to @code{cut(p,knife,0);}
+@cindex @code{MetaPost cutbefore}
+Note that @code{firstcut.after} plays the role of the @code{MetaPost
+cutbefore} command.
+
+@cindex @code{lastcut}
+@item slice lastcut(path p, path knife);
+equivalent to @code{cut(p,knife,-1);}
+@cindex @code{MetaPost cutafter}
+Note that @code{lastcut.before} plays the role of the
+@code{MetaPost cutafter} command.
+
+@cindex @code{buildcycle}
+@item path buildcycle(... path[] p);
+This returns the path surrounding a region bounded by a list of two or more
+consecutively intersecting paths, following the behaviour of the
+@code{MetaPost buildcycle} command.
+
+@cindex @code{min}
+@item pair min(path p);
+returns the pair (left,bottom) for the path bounding box of path @code{p}.
+
+@cindex @code{max}
+@item pair max(path p);
+returns the pair (right,top) for the path bounding box of path @code{p}.
+
+@cindex @code{windingnumber}
+@cindex @code{undefined}
+@item int windingnumber(path p, pair z);
+returns the winding number of the cyclic path @code{p} relative to the point
+@code{z}. The winding number is positive if the path encircles @code{z} in the
+counterclockwise direction. If @code{z} lies on @code{p} the constant
+@code{undefined} (defined to be the largest odd integer) is returned.
+
+@cindex @code{interior}
+@item bool interior(int windingnumber, pen fillrule)
+returns true if @code{windingnumber} corresponds to an interior point
+according to @code{fillrule}.
+
+@cindex @code{inside}
+@item bool inside(path p, pair z, pen fillrule=currentpen);
+returns @code{true} iff the point @code{z} lies inside or on the edge of
+the region bounded by the cyclic path @code{p} according to the fill
+rule @code{fillrule} (@pxref{fillrule}).
+
+@cindex @code{inside}
+@item int inside(path p, path q, pen fillrule=currentpen);
+returns @code{1} if the cyclic path @code{p} strictly contains @code{q}
+according to the fill rule @code{fillrule} (@pxref{fillrule}), @code{-1}
+if the cyclic path @code{q} strictly contains @code{p}, and @code{0}
+otherwise.
+
+@cindex @code{inside}
+@item pair inside(path p, pen fillrule=currentpen);
+returns an arbitrary point strictly inside a cyclic path @code{p}
+according to the fill rule @code{fillrule} (@pxref{fillrule}).
+
+@cindex @code{strokepath}
+@item path[] strokepath(path g, pen p=currentpen);
+returns the path array that @code{PostScript} would fill in drawing path
+@code{g} with pen @code{p}.
+
+@end table
+
+@item guide
+@cindex @code{guide}
+an unresolved cubic spline (list of cubic-spline nodes and control points).
+The implicit initializer for a guide is @code{nullpath}; this is useful
+for building up a guide within a loop.
+
+A guide is similar to a path except that the computation of the cubic spline is
+deferred until drawing time (when it is resolved into a path); this allows
+two guides with free endpoint conditions to be joined together smoothly.
+The solid curve in the following example is built up incrementally as
+a guide, but only resolved at drawing time; the dashed curve is
+incrementally resolved at each iteration, before the entire set of nodes
+(shown in red) is known:
+
+@verbatiminclude mexicanhat.asy
+@sp 1
+@center @image{./mexicanhat}
+
+We point out an efficiency distinction in the use of guides and paths:
+@verbatim
+guide g;
+for(int i=0; i < 10; ++i)
+ g=g--(i,i);
+path p=g;
+@end verbatim
+
+@noindent
+runs in linear time, whereas
+@verbatim
+path p;
+for(int i=0; i < 10; ++i)
+ p=p--(i,i);
+@end verbatim
+
+@noindent
+runs in quadratic time, as the entire path up to that point is copied at each
+step of the iteration.
+
+The following routines can be used to examine the individual elements of
+a guide without actually resolving the guide to a fixed path (except for
+internal cycles, which are resolved):
+
+@table @code
+
+@cindex @code{size}
+@item int size(guide g);
+Analogous to @code{size(path p)}.
+
+@cindex @code{length}
+@item int length(guide g);
+Analogous to @code{length(path p)}.
+
+@cindex @code{cyclic}
+@item bool cyclic(path p);
+Analogous to @code{cyclic(path p)}.
+
+@cindex @code{point}
+@item pair point(guide g, int t);
+Analogous to @code{point(path p, int t)}.
+
+@cindex @code{reverse}
+@item guide reverse(guide g);
+Analogous to @code{reverse(path p)}. If @code{g} is cyclic and
+also contains a secondary cycle, it is first solved to a
+path, then reversed. If @code{g} is not cyclic but contains an internal
+cycle, only the internal cycle is solved before reversal. If there are
+no internal cycles, the guide is reversed but not solved to a path.
+
+@cindex @code{dirSpecifier}
+@item pair[] dirSpecifier(guide g, int i);
+This returns a pair array of length 2 containing the outgoing (in
+element 0) and incoming (in element 1) direction specifiers (or
+@code{(0,0)} if none specified) for the segment of guide @code{g}
+between nodes @code{i} and @code{i+1}.
+
+@cindex @code{controlSpecifier}
+@item pair[] controlSpecifier(guide g, int i);
+If the segment of guide @code{g} between nodes @code{i} and @code{i+1}
+has explicit outgoing and incoming control points, they are returned as
+elements 0 and 1, respectively, of a two-element array. Otherwise, an
+empty array is returned.
+
+@cindex @code{tensionSpecifier}
+@item tensionSpecifier tensionSpecifier(guide g, int i);
+This returns the tension specifier for the segment of guide @code{g} between
+nodes @code{i} and @code{i+1}. The individual components of the
+@code{tensionSpecifier} type can be accessed as the virtual members
+@code{in}, @code{out}, and @code{atLeast}.
+
+@cindex @code{curlSpecifier}
+@item real[] curlSpecifier(guide g);
+This returns an array containing the initial curl specifier (in element 0)
+and final curl specifier (in element 1) for guide @code{g}.
+
+@end table
+
+As a technical detail we note that a direction specifier given to
+@code{nullpath} modifies the node on the other side: the guides
+@verbatim
+a..{up}nullpath..b;
+c..nullpath{up}..d;
+e..{up}nullpath{down}..f;
+@end verbatim
+are respectively equivalent to
+@verbatim
+a..nullpath..{up}b;
+c{up}..nullpath..d;
+e{down}..nullpath..{up}f;
+@end verbatim
+
+@end table
+
+@node Pens, Transforms, Paths and guides, Programming
+@section Pens
+
+@cindex @code{pen}
+@cindex @code{currentpen}
+@cindex @code{MetaPost pickup}
+In @code{Asymptote}, pens provide a context for the four basic drawing
+commands (@pxref{Drawing commands}). They are used to specify the
+following drawing attributes: color, line type, line width, line cap,
+line join, fill rule, text alignment, font, font size, pattern,
+overwrite mode, and calligraphic transforms on the pen nib. The
+default pen used by the drawing routines is called
+@code{currentpen}. This provides the same functionality as the
+@code{MetaPost} command @code{pickup}.
+The implicit initializer for pens is @code{defaultpen}.
+
+@cindex @code{+}
+@cindex @code{*}
+Pens may be added together with the nonassociative binary
+operator @code{+}. This will add the colors of the two pens.
+All other non-default attributes of the rightmost pen will
+override those of the leftmost pen. Thus, one can obtain a yellow
+dashed pen by saying @code{dashed+red+green} or @code{red+green+dashed}
+or @code{red+dashed+green}. The binary operator @code{*}
+can be used to scale the color of a pen by a real number, until it
+saturates with one or more color components equal to 1.
+
+@itemize @bullet
+
+@item Colors are specified using one of the following colorspaces:
+@cindex color
+@table @code
+@item pen gray(real g);
+@cindex @code{gray}
+@cindex grayscale
+This produces a grayscale color, where the intensity @code{g} lies in the
+interval [0,1], with 0.0 denoting black and 1.0 denoting white.
+
+@item pen rgb(real r, real g, real b);
+@cindex @code{rgb}
+This produces an @acronym{RGB} color, where each of the red, green,
+and blue intensities @code{r}, @code{g}, @code{b}, lies in the interval [0,1].
+
+@item pen RGB(int r, int g, int b);
+@cindex @code{rgb}
+This produces an @acronym{RGB} color, where each of the red, green,
+and blue intensities @code{r}, @code{g}, @code{b}, lies in the
+interval [0,255].
+
+@item pen cmyk(real c, real m, real y, real k);
+@cindex @code{cmyk}
+This produces a @acronym{CMYK} color, where each of the cyan, magenta,
+yellow, and black intensities @code{c}, @code{m}, @code{y}, @code{k},
+lies in the interval [0,1].
+
+@item pen invisible;
+@cindex @code{invisible}
+This special pen writes in invisible ink, but adjusts the bounding
+box as if something had been drawn (like the @code{\phantom}
+command in @TeX{}). The function @code{bool invisible(pen)} can be used
+to test whether a pen is invisible.
+
+@end table
+
+@cindex @code{defaultpen}
+The default color is @code{black}; this may be changed with the routine
+@code{defaultpen(pen)}. The function @code{colorspace(pen p)} returns
+the colorspace of pen @code{p} as a string (@code{"gray"}, @code{"rgb"},
+@code{"cmyk"}, or @code{""}).
+
+@cindex @code{colors}
+The function @code{real[] colors(pen)} returns the color components of a pen.
+The functions @code{pen gray(pen)}, @code{pen rgb(pen)}, and
+@code{pen cmyk(pen)} return new pens obtained by converting their
+arguments to the respective color spaces.
+@cindex @code{colorless}
+The function @code{colorless(pen=currentpen)} returns a copy of its argument
+with the color attributes stripped (to avoid color mixing).
+
+A 6-character RGB hexadecimal string can be converted to a pen with
+the routine
+@cindex @code{rgb}
+@cindex @code{hexadecimal}
+@verbatim
+pen rgb(string s);
+@end verbatim
+@noindent
+A pen can be converted to a hexadecimal string with
+@cindex @code{hex}
+@item string hex(pen p);
+
+Various shades and mixtures of the grayscale primary colors
+@code{black} and @code{white}, @acronym{RGB} primary colors
+@code{red}, @code{green}, and @code{blue}, and
+@acronym{RGB} secondary colors @code{cyan}, @code{magenta}, and @code{yellow}
+are defined as named colors, along with the @acronym{CMYK} primary
+colors @code{Cyan}, @code{Magenta}, @code{Yellow}, and @code{Black}, in
+the module @code{plain}:
+@sp 1
+@center @image{./colors}
+
+The standard 140 @acronym{RGB} @code{X11} colors can be imported with
+the command
+@verbatim
+import x11colors;
+@end verbatim
+and the standard 68 @acronym{CMYK} @TeX{} colors can be imported with
+the command
+@verbatim
+import texcolors;
+@end verbatim
+Note that there is some overlap between these two standards
+and the definitions of some colors (e.g.@ @code{Green}) actually disagree.
+
+@code{Asymptote} also comes with a @code{asycolors.sty} @code{LaTeX} package
+that defines to @code{LaTeX} @acronym{CMYK} versions of
+@code{Asymptote}'s predefined colors, so that they can be used
+directly within @code{LaTeX} strings. Normally, such colors are
+passed to @code{LaTeX} via a pen argument; however, to change the
+color of only a portion of a string, say for a slide presentation,
+(@pxref{slide}) it may be desirable to specify the color directly to
+@code{LaTeX}. This file can be passed to @code{LaTeX} with the
+@code{Asymptote} command
+@verbatim
+usepackage("asycolors");
+@end verbatim
+
+The structure @code{hsv} defined in @code{plain_pens.asy} may be used
+to convert between @acronym{HSV} and @acronym{RGB} spaces, where
+the hue @code{h} is an angle in @math{[0,360)} and the saturation
+@code{s} and value @code{v} lie in @code{[0,1]}:
+@verbatim
+pen p=hsv(180,0.5,0.75);
+write(p); // ([default], red=0.375, green=0.75, blue=0.75)
+hsv q=p;
+write(q.h,q.s,q.v); // 180 0.5 0.75
+@end verbatim
+
+@item Line types are specified with the function
+@code{pen linetype(real[] a, real offset=0, bool scale=true, bool adjust=true)},
+@cindex @code{solid}
+@cindex @code{dashed}
+@cindex @code{dotted}
+@cindex @code{longdashed}
+@cindex @code{dashdotted}
+@cindex @code{longdashdotted}
+where @code{a} is an array of real array numbers.
+The optional parameter @code{offset} specifies where in the pattern
+to begin. The first number specifies how far (if @code{scale} is
+@code{true}, in units of the pen line width; otherwise in
+@code{PostScript} units) to draw with the pen on, the second number
+specifies how far to draw with the pen off, and so on. If
+@code{adjust} is @code{true}, these spacings are automatically
+adjusted by @code{Asymptote} to fit the arclength of the path. Here
+are the predefined line types:
+@verbatim
+pen solid=linetype(new real[]);
+pen dotted=linetype(new real[] {0,4});
+pen dashed=linetype(new real[] {8,8});
+pen longdashed=linetype(new real[] {24,8});
+pen dashdotted=linetype(new real[] {8,8,0,8});
+pen longdashdotted=linetype(new real[] {24,8,0,8});
+pen Dotted(pen p=currentpen) {return linetype(new real[] {0,3})+2*linewidth(p);}
+pen Dotted=Dotted();
+@end verbatim
+@sp 1
+@center @image{./linetype}
+
+@cindex @code{defaultpen}
+The default line type is @code{solid}; this may be changed with
+@code{defaultpen(pen)}.
+@cindex @code{linetype}
+@cindex @code{offset}
+@cindex @code{scale}
+@cindex @code{adjust}
+The line type of a pen can be determined with the functions
+@code{real[] linetype(pen p=currentpen)},
+@code{real offset(pen p)}, @code{bool scale(pen p)}, and
+@code{bool adjust(pen p)}.
+
+@cindex @code{linewidth}
+@cindex @code{defaultpen}
+@item The pen line width is specified in @code{PostScript} units with
+@code{pen linewidth(real)}. The default line width is 0.5 bp; this value
+may be changed with @code{defaultpen(pen)}. The line width of a pen
+is returned by @code{real linewidth(pen p=currentpen)}.
+For convenience, in the module @code{plain_pens} we define
+@verbatim
+void defaultpen(real w) {defaultpen(linewidth(w));}
+pen operator +(pen p, real w) {return p+linewidth(w);}
+pen operator +(real w, pen p) {return linewidth(w)+p;}
+@end verbatim
+so that one may set the line width like this:
+@verbatim
+defaultpen(2);
+pen p=red+0.5;
+@end verbatim
+
+@cindex @code{linecap}
+@cindex @code{squarecap}
+@cindex @code{roundcap}
+@cindex @code{extendcap}
+@cindex @code{defaultpen}
+@item A pen with a specific @code{PostScript} line cap is returned on
+calling @code{linecap} with an integer argument:
+@verbatim
+pen squarecap=linecap(0);
+pen roundcap=linecap(1);
+pen extendcap=linecap(2);
+@end verbatim
+
+@noindent
+The default line cap, @code{roundcap}, may be changed with
+@code{defaultpen(pen)}. The line cap of a pen is returned by
+@code{int linecap(pen p=currentpen)}.
+
+@cindex @code{linejoin}
+@cindex @code{miterjoin}
+@cindex @code{roundjoin}
+@cindex @code{beveljoin}
+@item A pen with a specific @code{PostScript} join style is returned on
+calling @code{linejoin} with an integer argument:
+@verbatim
+pen miterjoin=linejoin(0);
+pen roundjoin=linejoin(1);
+pen beveljoin=linejoin(2);
+@end verbatim
+
+@noindent
+The default join style, @code{roundjoin}, may be changed with
+@code{defaultpen(pen)}.The join style of a pen is returned by
+@code{int linejoin(pen p=currentpen)}.
+
+@cindex @code{miterlimit}
+@item A pen with a specific @code{PostScript} miter limit is returned by
+calling @code{miterlimit(real)}.
+The default miterlimit, @code{10.0}, may be changed with
+@code{defaultpen(pen)}. The miter limit of a pen is returned by
+@code{real miterlimit(pen p=currentpen)}.
+
+@cindex @code{fillrule}
+@cindex @code{zerowinding}
+@cindex @code{evenodd}
+@anchor{fillrule}
+@item A pen with a specific @code{PostScript} fill rule is returned on
+calling @code{fillrule} with an integer argument:
+@verbatim
+pen zerowinding=fillrule(0);
+pen evenodd=fillrule(1);
+@end verbatim
+
+@noindent
+The fill rule, which identifies the algorithm used to determine the
+insideness of a path or array of paths, only affects the @code{clip},
+@code{fill}, and @code{inside} functions. For the @code{zerowinding}
+fill rule, a point @code{z} is outside the region bounded by a path if
+the number of upward intersections of the path with the horizontal
+line @code{z--z+infinity} minus the number of downward intersections
+is zero. For the @code{evenodd} fill rule, @code{z} is considered to
+be outside the region if the total number of such intersections is even.
+The default fill rule, @code{zerowinding}, may be changed with
+@code{defaultpen(pen)}. The fill rule of a pen is returned by
+@code{int fillrule(pen p=currentpen)}.
+
+@cindex @code{nobasealign}
+@cindex @code{basealign}
+@anchor{basealign}
+@item A pen with a specific text alignment setting is returned on
+calling @code{basealign} with an integer argument:
+@verbatim
+pen nobasealign=basealign(0);
+pen basealign=basealign(1);
+@end verbatim
+
+@noindent
+The default setting, @code{nobasealign},which may be changed with
+@code{defaultpen(pen)}, causes the label alignment routines to use the
+full label bounding box for alignment. In contrast, @code{basealign}
+requests that the @TeX{} baseline be respected.
+The base align setting of a pen is returned by
+@code{int basealign(pen p=currentpen)}.
+
+@cindex @code{fontsize}
+@cindex @code{lineskip}
+@cindex @code{defaultpen}
+@cindex @code{type1cm}
+@item The font size is specified in @TeX{} points (1 pt = 1/72.27 inches) with
+the function @code{pen fontsize(real size, real lineskip=1.2*size)}.
+The default font size, 12pt, may be changed with @code{defaultpen(pen)}.
+Nonstandard font sizes may require inserting
+@verbatim
+import fontsize;
+@end verbatim
+at the beginning of the file (this requires the @code{type1cm} package
+available from
+@quotation
+@url{http://mirror.ctan.org/macros/latex/contrib/type1cm/}
+@end quotation
+and included in recent @code{LaTeX} distributions). The font size and line
+skip of a pen can be examined with the routines
+@code{real fontsize(pen p=currentpen)} and
+@code{real lineskip(pen p=currentpen)}, respectively.
+
+@cindex font
+@cindex @LaTeX{} NFSS fonts
+@cindex @code{font}
+@item A pen using a specific @LaTeX{} NFSS font is returned
+by calling the function @code{pen font(string encoding, string family,
+string series, string shape)}. The default setting,
+@code{font("OT1","cmr","m","n")}, corresponds to 12pt Computer Modern Roman;
+this may be changed with @code{defaultpen(pen)}.
+The font setting of a pen is returned by
+@code{string font(pen p=currentpen)}.
+
+@cindex @TeX{} fonts
+Alternatively, one may select a fixed-size @TeX{} font (on which
+@code{fontsize} has no effect) like @code{"cmr12"} (12pt Computer Modern
+Roman) or @code{"pcrr"} (Courier) using the function @code{pen font(string
+name)}. An optional size argument can also be given to scale the font
+to the requested size: @code{pen font(string name, real size)}.
+
+@cindex @code{fontcommand}
+A nonstandard font command can be generated with
+@code{pen fontcommand(string)}.
+
+@cindex @code{PostScript} fonts
+A convenient interface to the following standard @code{PostScript}
+fonts is also provided:
+@verbatim
+pen AvantGarde(string series="m", string shape="n");
+pen Bookman(string series="m", string shape="n");
+pen Courier(string series="m", string shape="n");
+pen Helvetica(string series="m", string shape="n");
+pen NewCenturySchoolBook(string series="m", string shape="n");
+pen Palatino(string series="m", string shape="n");
+pen TimesRoman(string series="m", string shape="n");
+pen ZapfChancery(string series="m", string shape="n");
+pen Symbol(string series="m", string shape="n");
+pen ZapfDingbats(string series="m", string shape="n");
+@end verbatim
+
+@cindex font
+@cindex font encoding
+@cindex input encoding
+@cindex language context
+@item Starting with the 2018/04/01 release, @LaTeX{} takes UTF-8 as
+the new default input encoding. However, you can still set different input
+encoding (so as the font, font encoding or even language context).
+@noindent
+@cindex Cyrillic
+@cindex Russian
+Here is an example for @code{cp1251} and Russian language in Cyrillic script
+(font encoding @code{T2A}):
+@verbatim
+texpreamble("\usepackage[math]{anttor}");
+texpreamble("\usepackage[T2A]{fontenc}");
+texpreamble("\usepackage[cp1251]{inputenc}");
+texpreamble("\usepackage[russian]{babel}");
+@end verbatim
+@noindent
+@cindex Chinese
+@cindex Japanese
+@cindex Korean
+@cindex CJK
+Support for Chinese, Japanese, and Korean fonts is provided by the
+CJK package:
+@quotation
+@url{https://ctan.org/pkg/cjk}
+@end quotation
+@noindent
+The following commands enable the CJK song family (within a label, you
+can also temporarily switch to another family, say kai, by prepending
+@code{"\CJKfamily@{kai@}"} to the label string):
+@verbatim
+texpreamble("\usepackage{CJK}
+\AtBeginDocument{\begin{CJK*}{GBK}{song}}
+\AtEndDocument{\clearpage\end{CJK*}}");
+@end verbatim
+
+
+@anchor{transparency}
+@cindex transparency
+@cindex @code{opacity}
+@item The transparency of a pen can be changed with the command:
+@verbatim
+pen opacity(real opacity=1, string blend="Compatible");
+@end verbatim
+The opacity can be varied from @code{0} (fully transparent) to the default
+value of @code{1} (opaque), and @code{blend} specifies one of the
+following foreground--background blending operations:
+@verbatim
+"Compatible","Normal","Multiply","Screen","Overlay","SoftLight",
+"HardLight","ColorDodge","ColorBurn","Darken","Lighten","Difference",
+"Exclusion","Hue","Saturation","Color","Luminosity",
+@end verbatim
+as described in
+@url{https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf}.
+Since @code{PostScript} does not support transparency, this feature is
+only effective with the @code{-f pdf} output format option; other
+formats can be produced from the resulting @acronym{PDF} file with the
+@code{ImageMagick} @code{convert} program.
+Labels are always drawn with an @code{opacity} of 1.
+A simple example of transparent filling is provided in the example file
+@code{@uref{https://asymptote.sourceforge.io/gallery/transparency.svg,,transparency}@uref{https://asymptote.sourceforge.io/gallery/transparency.asy,,.asy}}.
+
+@cindex patterns
+@cindex tilings
+@item @code{PostScript} commands within a @code{picture} may be used
+to create a tiling pattern, identified by the string @code{name}, for
+@code{fill} and @code{draw} operations by adding it to the
+global @code{PostScript} frame @code{currentpatterns},
+with optional left-bottom margin @code{lb} and right-top margin @code{rt}.
+@verbatim
+import patterns;
+void add(string name, picture pic, pair lb=0, pair rt=0);
+@end verbatim
+
+To @code{fill} or @code{draw} using pattern @code{name}, use
+the pen @code{pattern("name")}. For example, rectangular tilings
+can be constructed using the routines
+@code{picture tile(real Hx=5mm, real Hy=0, pen p=currentpen,
+filltype filltype=NoFill)},
+@code{picture checker(real Hx=5mm, real Hy=0, pen p=currentpen)}, and
+@code{picture brick(real Hx=5mm, real Hy=0, pen p=currentpen)} defined in
+module @code{patterns}:
+@cindex grid
+@cindex tile
+@cindex checker
+@cindex brick
+@verbatiminclude tile.asy
+@sp 1
+@center @image{./tile}
+
+@cindex hatch
+@cindex crosshatch
+Hatch patterns can be generated with the routines
+@code{picture hatch(real H=5mm, pair dir=NE, pen p=currentpen)},
+@code{picture crosshatch(real H=5mm, pen p=currentpen)}:
+@verbatiminclude hatch.asy
+@sp 1
+@center @image{./hatch}
+
+You may need to turn off aliasing in your @code{PostScript} viewer for
+patterns to appear correctly. Custom patterns can easily be constructed,
+following the examples in module @code{patterns}. The tiled pattern can
+even incorporate shading (@pxref{gradient shading}), as illustrated
+in this example (not included in the manual because not all printers support
+@code{PostScript} 3):
+@verbatiminclude shadedtiling.asy
+
+@anchor{makepen}
+@cindex @code{makepen}
+@item One can specify a custom pen nib as an arbitrary polygonal path
+with @code{pen makepen(path)}; this path represents the mark to be
+drawn for paths containing a single point. This pen nib path can be
+recovered from a pen with @code{path nib(pen)}. Unlike in
+@code{MetaPost}, the path need not be convex:
+
+@verbatiminclude makepen.asy
+@sp 1
+@center @image{./makepen}
+
+The value @code{nullpath} represents a circular pen nib (the default);
+an elliptical pen can be achieved simply by multiplying the pen by a
+transform: @code{yscale(2)*currentpen}.
+
+@anchor{overwrite}
+@cindex @code{overwrite}
+@item One can prevent labels from overwriting one another by using
+the pen attribute @code{overwrite}, which takes a single argument:
+
+@table @code
+@cindex @code{Allow}
+@cindex @code{defaultpen}
+@item Allow
+Allow labels to overwrite one another. This is the default behaviour (unless
+overridden with @code{defaultpen(pen)}.
+
+@cindex @code{Suppress}
+@item Suppress
+Suppress, with a warning, each label that would overwrite another label.
+
+@cindex @code{SuppressQuiet}
+@item SuppressQuiet
+Suppress, without warning, each label that would overwrite another label.
+
+@cindex @code{Move}
+@item Move
+Move a label that would overwrite another out of the way and issue a warning.
+As this adjustment is during the final output phase (in @code{PostScript}
+coordinates) it could result in a larger figure than requested.
+
+@cindex @code{MoveQuiet}
+@item MoveQuiet
+Move a label that would overwrite another out of the way, without warning.
+As this adjustment is during the final output phase (in @code{PostScript}
+coordinates) it could result in a larger figure than requested.
+
+@end table
+
+@end itemize
+
+@cindex @code{defaultpen}
+@cindex @code{resetdefaultpen}
+The routine @code{defaultpen()} returns the current default pen attributes.
+Calling the routine @code{resetdefaultpen()} resets all pen default
+attributes to their initial values.
+
+@node Transforms, Frames and pictures, Pens, Programming
+@section Transforms
+
+@cindex @code{transform}
+@code{Asymptote} makes extensive use of affine transforms. A pair
+@code{(x,y)} is transformed by the transform
+@code{t=(t.x,t.y,t.xx,t.xy,t.yx,t.yy)} to @code{(x',y')}, where
+@verbatim
+x' = t.x + t.xx * x + t.xy * y
+y' = t.y + t.yx * x + t.yy * y
+@end verbatim
+@noindent
+This is equivalent to the @code{PostScript} transformation
+@code{[t.xx t.yx t.xy t.yy t.x t.y]}.
+
+Transforms can be applied to pairs, guides, paths, pens, strings,
+transforms, frames, and pictures by multiplication (via the binary operator
+@code{*}) on the left (@pxref{circle} for an example).
+@cindex @code{inverse}
+Transforms can be composed with one another and inverted with the
+function @code{transform inverse(transform t)}; they can also be raised to any
+integer power with the @code{^} operator.
+
+The built-in transforms are:
+
+@table @code
+@item transform identity;
+@cindex @code{identity}
+the identity transform;
+@item transform shift(pair z);
+@cindex @code{shift}
+translates by the pair @code{z};
+@item transform shift(real x, real y);
+@cindex @code{shift}
+translates by the pair @code{(x,y)};
+@item transform xscale(real x);
+@cindex @code{xscale}
+scales by @code{x} in the @math{x} direction;
+@item transform yscale(real y);
+@cindex @code{yscale}
+scales by @code{y} in the @math{y} direction;
+@item transform scale(real s);
+@cindex @code{scale}
+scale by @code{s} in both @math{x} and @math{y} directions;
+@item transform scale(real x, real y);
+@cindex @code{scale}
+scale by @code{x} in the @math{x} direction and by @code{y} in the
+@math{y} direction;
+@item transform slant(real s);
+@cindex @code{slant}
+maps @code{(x,y)} --> @code{(x+s*y,y)};
+@item transform rotate(real angle, pair z=(0,0));
+rotates by @code{angle} in degrees about @code{z};
+@item transform reflect(pair a, pair b);
+@cindex @code{reflect}
+reflects about the line @code{a--b}.
+@item transform zeroTransform;
+@cindex @code{zeroTransform}
+the zero transform;
+@end table
+
+@cindex @code{shift}
+@cindex @code{shiftless}
+The implicit initializer for transforms is @code{identity()}.
+The routines @code{shift(transform t)} and @code{shiftless(transform t)}
+return the transforms @code{(t.x,t.y,0,0,0,0)} and
+@code{(0,0,t.xx,t.xy,t.yx,t.yy)} respectively.
+The function @code{bool isometry(transform t)} can be used to test if @code{t}
+is an isometry (preserves distance).
+
+
+@node Frames and pictures, Files, Transforms, Programming
+@section Frames and pictures
+
+@table @code
+
+@item frame
+@cindex @code{frame}
+@cindex @code{newframe}
+@cindex @code{empty}
+@cindex @code{erase}
+@cindex @code{min}
+@cindex @code{max}
+Frames are canvases for drawing in @code{PostScript} coordinates. While working
+with frames directly is occasionally necessary for constructing deferred
+drawing routines, pictures are usually more convenient to work with.
+The implicit initializer for frames is @code{newframe}. The function
+@code{bool empty(frame f)} returns @code{true} only if the frame @code{f}
+is empty. A frame may be erased with the @code{erase(frame)} routine.
+The functions @code{pair min(frame)} and @code{pair max(frame)}
+return the (left,bottom) and (right,top) coordinates of the frame
+bounding box, respectively. The contents of frame @code{src} may be
+appended to frame @code{dest} with the command
+@verbatim
+void add(frame dest, frame src);
+@end verbatim
+or prepended with
+@verbatim
+void prepend(frame dest, frame src);
+@end verbatim
+A frame obtained by aligning frame @code{f} in the direction
+@code{align}, in a manner analogous to the @code{align} argument of
+@code{label} (@pxref{label}), is returned by
+@verbatim
+frame align(frame f, pair align);
+@end verbatim
+
+@cindex @code{box}
+@cindex @code{ellipse}
+@anchor{envelope}
+@cindex @code{envelope}
+To draw or fill a box or ellipse around a label or frame and return the
+boundary as a path, use one of the predefined @code{envelope} routines
+@verbatim
+path box(frame f, Label L="", real xmargin=0,
+ real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+path roundbox(frame f, Label L="", real xmargin=0,
+ real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+path ellipse(frame f, Label L="", real xmargin=0,
+ real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+@end verbatim
+
+@item picture
+@cindex @code{picture}
+Pictures are high-level structures (@pxref{Structures}) defined in
+the module @code{plain} that provide canvases for drawing in user coordinates.
+The default picture is called @code{currentpicture}. A new picture
+can be created like this:
+@verbatim
+picture pic;
+@end verbatim
+@noindent
+Anonymous pictures can be made by the expression @code{new picture}.
+
+The @code{size} routine specifies the dimensions of the desired picture:
+
+@anchor{size}
+@cindex @code{size}
+@verbatim
+void size(picture pic=currentpicture, real x, real y=x,
+ bool keepAspect=Aspect);
+@end verbatim
+
+If the @code{x} and @code{y} sizes are both 0, user coordinates will be
+interpreted as @code{PostScript} coordinates. In this case, the transform
+mapping @code{pic} to the final output frame is @code{identity()}.
+
+If exactly one of @code{x} or @code{y} is 0, no size restriction
+is imposed in that direction; it will be scaled the same as the other
+direction.
+
+@cindex @code{keepAspect}
+@cindex @code{Aspect}
+If @code{keepAspect} is set to @code{Aspect} or @code{true},
+the picture will be scaled with its aspect ratio preserved such that
+the final width is no more than @code{x} and the final height is
+no more than @code{y}.
+
+@cindex @code{keepAspect}
+@cindex @code{IgnoreAspect}
+If @code{keepAspect} is set to @code{IgnoreAspect} or @code{false},
+the picture will be scaled in both directions so that the final width
+is @code{x} and the height is @code{y}.
+
+To make the user coordinates of picture @code{pic}
+represent multiples of @code{x} units in the @math{x} direction and
+@code{y} units in the @math{y} direction, use
+@anchor{unitsize}
+@cindex @code{unitsize}
+@verbatim
+void unitsize(picture pic=currentpicture, real x, real y=x);
+@end verbatim
+When nonzero, these @code{x} and @code{y} values override the
+corresponding size parameters of picture @code{pic}.
+
+The routine
+@cindex @code{size}
+@verbatim
+void size(picture pic=currentpicture, real xsize, real ysize,
+ pair min, pair max);
+@end verbatim
+forces the final picture scaling to map the user coordinates
+@code{box(min,max)} to a region of width @code{xsize} and height @code{ysize}
+(when these parameters are nonzero).
+
+Alternatively, calling the routine
+@cindex @code{fixedscaling}
+@verbatim
+transform fixedscaling(picture pic=currentpicture, pair min,
+ pair max, pen p=nullpen, bool warn=false);
+@end verbatim
+will cause picture @code{pic} to use a fixed scaling to map user
+coordinates in @code{box(min,max)} to the (already specified) picture size,
+taking account of the width of pen @code{p}. A warning will be issued if
+the final picture exceeds the specified size.
+
+A picture @code{pic} can be fit to a frame and output to a file
+@code{prefix}.@code{format} using image format @code{format}
+by calling the @code{shipout} function:
+@anchor{shipout}
+@cindex @code{shipout}
+@cindex @code{outprefix}
+@verbatim
+void shipout(string prefix=defaultfilename, picture pic=currentpicture,
+ orientation orientation=orientation,
+ string format="", bool wait=false, bool view=true,
+ string options="", string script="",
+ light light=currentlight, projection P=currentprojection)
+@end verbatim
+@noindent
+The default output format, @code{PostScript}, may be changed
+with the @code{-f} or @code{-tex} command-line options.
+The @code{options}, @code{script}, and @code{projection} parameters
+are only relevant for 3D pictures. If @code{defaultfilename} is an
+empty string, the prefix @code{outprefix()} will be used.
+
+A @code{shipout()} command is added implicitly at file exit if no
+previous @code{shipout} commands have been executed.
+@cindex @code{orientation}
+@cindex @code{Portrait}
+@cindex @code{Landscape}
+@cindex @code{UpsideDown}
+The default page orientation is @code{Portrait}; this may be modified
+by changing the variable @code{orientation}. To output in landscape
+mode, simply set the variable @code{orientation=Landscape} or issue
+the command
+@verbatim
+shipout(Landscape);
+@end verbatim
+
+@cindex @code{Seascape}
+To rotate the page by @math{-90} degrees, use the orientation @code{Seascape}.
+@cindex @code{UpsideDown}
+The orientation @code{UpsideDown} rotates the page by 180 degrees.
+
+@cindex subpictures
+@cindex @code{fit}
+A picture @code{pic} can be explicitly fit to a frame by calling
+@verbatim
+frame pic.fit(real xsize=pic.xsize, real ysize=pic.ysize,
+ bool keepAspect=pic.keepAspect);
+@end verbatim
+The default size and aspect ratio settings are those given to the
+@code{size} command (which default to @code{0}, @code{0}, and
+@code{true}, respectively).
+@cindex @code{calculateTransform}
+The transformation that would currently be used to fit a picture
+@code{pic} to a frame is returned by the member function
+@code{pic.calculateTransform()}.
+
+In certain cases (e.g.@ 2D graphs) where only an approximate size
+estimate for @code{pic} is available, the picture fitting routine
+@verbatim
+frame pic.scale(real xsize=this.xsize, real ysize=this.ysize,
+ bool keepAspect=this.keepAspect);
+@end verbatim
+(which scales the resulting frame, including labels and fixed-size
+objects) will enforce perfect compliance with the requested size
+specification, but should not normally be required.
+
+@cindex @code{box}
+To draw a bounding box with margins around a picture, fit the
+picture to a frame using the function
+@verbatim
+frame bbox(picture pic=currentpicture, real xmargin=0,
+ real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill);
+@end verbatim
+@anchor{filltype}
+Here @code{filltype} specifies one of the following fill types:
+@table @code
+@cindex @code{FillDraw}
+@item FillDraw
+Fill the interior and draw the boundary.
+
+@item FillDraw(real xmargin=0, real ymargin=xmargin, pen fillpen=nullpen,
+ @code{pen drawpen=nullpen)}
+@cindex @code{nullpen}
+If @code{fillpen} is @code{nullpen}, fill with the drawing pen;
+otherwise fill with pen @code{fillpen}.
+If @code{drawpen} is @code{nullpen}, draw the boundary with @code{fillpen};
+otherwise with @code{drawpen}. An optional margin of
+@code{xmargin} and @code{ymargin} can be specified.
+
+@cindex @code{Fill}
+@item Fill
+Fill the interior.
+
+@cindex @code{nullpen}
+@item Fill(real xmargin=0, real ymargin=xmargin, pen p=nullpen)
+If @code{p} is @code{nullpen}, fill with the drawing pen;
+otherwise fill with pen @code{p}. An optional margin of
+@code{xmargin} and @code{ymargin} can be specified.
+
+@cindex @code{NoFill}
+@item NoFill
+Do not fill.
+
+@item Draw
+Draw only the boundary.
+
+@cindex @code{Draw}
+@item Draw(real xmargin=0, real ymargin=xmargin, pen p=nullpen)
+If @code{p} is @code{nullpen}, draw the boundary with the drawing pen;
+otherwise draw with pen @code{p}. An optional margin of
+@code{xmargin} and @code{ymargin} can be specified.
+
+@cindex @code{UnFill}
+@item UnFill
+Clip the region.
+
+@cindex @code{UnFill}
+@item UnFill(real xmargin=0, real ymargin=xmargin)
+Clip the region and surrounding margins @code{xmargin} and @code{ymargin}.
+
+@cindex @code{RadialShade}
+@item RadialShade(pen penc, pen penr)
+Fill varying radially from @code{penc} at the center of the bounding
+box to @code{penr} at the edge.
+
+@cindex @code{RadialShadeDraw}
+@item RadialShadeDraw(real xmargin=0, real ymargin=xmargin, pen penc,
+ @code{pen penr, pen drawpen=nullpen)}
+Fill with RadialShade and draw the boundary.
+
+@end table
+
+@cindex bounding box
+@cindex background color
+For example, to draw a bounding box around a picture with a 0.25 cm
+margin and output the resulting frame, use the command:
+@verbatim
+shipout(bbox(0.25cm));
+@end verbatim
+A @code{picture} may be fit to a frame with the background color
+pen @code{p}, using the function @code{bbox(p,Fill)}.
+
+@cindex @code{pad}
+To pad a picture to a precise size in both directions, fit the picture
+to a frame using the function
+@verbatim
+frame pad(picture pic=currentpicture, real xsize=pic.xsize,
+ real ysize=pic.ysize, filltype filltype=NoFill);
+@end verbatim
+
+The functions
+@verbatim
+pair min(picture pic, user=false);
+pair max(picture pic, user=false);
+pair size(picture pic, user=false);
+@end verbatim
+calculate the bounds that picture @code{pic} would
+have if it were currently fit to a frame using its default size specification.
+If @code{user} is @code{false} the returned value is in
+@code{PostScript} coordinates, otherwise it is in user coordinates.
+
+The function
+@verbatim
+pair point(picture pic=currentpicture, pair dir, bool user=true);
+@end verbatim
+is a convenient way of determining the point on the bounding box of
+@code{pic} in the direction @code{dir} relative to its center, ignoring
+the contributions from fixed-size objects (such as labels and arrowheads).
+If @code{user} is @code{true} the returned value is in user coordinates,
+otherwise it is in @code{PostScript} coordinates.
+
+The function
+@verbatim
+pair truepoint(picture pic=currentpicture, pair dir, bool user=true);
+@end verbatim
+is identical to @code{point}, except that it also accounts for
+fixed-size objects, using the scaling transform that picture @code{pic}
+would have if currently fit to a frame using its default size
+specification. If @code{user} is @code{true} the returned value is in
+user coordinates, otherwise it is in @code{PostScript} coordinates.
+
+@anchor{add}
+Sometimes it is useful to draw objects on separate pictures and add one
+picture to another using the @code{add} function:
+@cindex @code{add}
+@verbatim
+void add(picture src, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+void add(picture dest, picture src, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+@end verbatim
+@noindent
+The first example adds @code{src} to @code{currentpicture}; the second
+one adds @code{src} to @code{dest}.
+The @code{group} option specifies whether or not the graphical user
+interface should treat all of the elements of @code{src}
+as a single entity (@pxref{GUI}), @code{filltype} requests optional
+background filling or clipping, and @code{above} specifies
+whether to add @code{src} above or below existing objects.
+
+There are also routines to add a picture or frame @code{src} specified
+in postscript coordinates to another picture @code{dest} (or
+@code{currentpicture}) about the user coordinate
+@code{position}:
+@anchor{add about}
+@cindex @code{add}
+@cindex picture alignment
+@verbatim
+void add(picture src, pair position, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+void add(picture dest, picture src, pair position,
+ bool group=true, filltype filltype=NoFill, bool above=true);
+void add(picture dest=currentpicture, frame src, pair position=0,
+ bool group=true, filltype filltype=NoFill, bool above=true);
+void add(picture dest=currentpicture, frame src, pair position,
+ pair align, bool group=true, filltype filltype=NoFill,
+ bool above=true);
+@end verbatim
+
+The optional @code{align} argument in the last form specifies a
+direction to use for aligning the frame, in a manner analogous to the
+@code{align} argument of @code{label} (@pxref{label}). However, one key
+difference is that when @code{align} is not specified, labels are
+centered, whereas frames and pictures are aligned so that their origin is
+at @code{position}. Illustrations of frame alignment can be found in
+the examples @ref{errorbars} and @ref{image}. If you want to align three
+or more subpictures, group them two at a time:
+
+@verbatiminclude subpictures.asy
+@sp 1
+@center @image{./subpictures}
+
+Alternatively, one can use @code{attach} to automatically increase the
+size of picture @code{dest} to accommodate adding a frame @code{src}
+about the user coordinate @code{position}:
+@cindex @code{attach}
+@verbatim
+void attach(picture dest=currentpicture, frame src,
+ pair position=0, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+void attach(picture dest=currentpicture, frame src,
+ pair position, pair align, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+@end verbatim
+
+@cindex @code{erase}
+To erase the contents of a picture (but not the size specification), use
+the function
+@verbatim
+void erase(picture pic=currentpicture);
+@end verbatim
+
+@cindex @code{save}
+To save a snapshot of @code{currentpicture}, @code{currentpen}, and
+@code{currentprojection}, use the function @code{save()}.
+
+@cindex @code{restore}
+To restore a snapshot of @code{currentpicture}, @code{currentpen}, and
+@code{currentprojection}, use the function @code{restore()}.
+
+Many further examples of picture and frame operations are provided in
+the base module @code{plain}.
+
+@cindex verbatim
+@cindex @code{postscript}
+It is possible to insert verbatim @code{PostScript} commands in a picture with
+one of the routines
+@verbatim
+void postscript(picture pic=currentpicture, string s);
+void postscript(picture pic=currentpicture, string s, pair min,
+ pair max)
+@end verbatim
+Here @code{min} and @code{max} can be used to specify explicit bounds
+associated with the resulting @code{PostScript} code.
+
+@anchor{tex}
+@cindex @code{tex}
+Verbatim @TeX{} commands can be inserted in the intermediate
+@code{LaTeX} output file with one of the functions
+@verbatim
+void tex(picture pic=currentpicture, string s);
+void tex(picture pic=currentpicture, string s, pair min, pair max)
+@end verbatim
+Here @code{min} and @code{max} can be used to specify explicit bounds
+associated with the resulting @TeX{} code.
+
+To issue a global @TeX{} command (such as a @TeX{} macro definition) in the
+@TeX{} preamble (valid for the remainder of the top-level module) use:
+@cindex @code{texpreamble}
+@verbatim
+void texpreamble(string s);
+@end verbatim
+
+The @TeX{} environment can be reset to its initial state, clearing all
+macro definitions, with the function
+@cindex @code{texreset}
+@verbatim
+void texreset();
+@end verbatim
+
+@cindex @code{usepackage}
+The routine
+@verbatim
+void usepackage(string s, string options="");
+@end verbatim
+provides a convenient abbreviation for
+@verbatim
+texpreamble("\usepackage["+options+"]{"+s+"}");
+@end verbatim
+@noindent
+that can be used for importing @code{LaTeX} packages.
+
+@end table
+
+@node Files, Variable initializers, Frames and pictures, Programming
+@section Files
+
+@cindex @code{file}
+@code{Asymptote} can read and write text files (including comma-separated
+value) files and portable @acronym{XDR} (External Data Representation)
+binary files.
+
+@cindex @code{input}
+An input file can be opened with
+@verbatim
+input(string name="", bool check=true, string comment="#", string mode="");
+@end verbatim
+reading is then done by assignment:
+@cindex open
+@cindex @code{input}
+@cindex reading
+@verbatim
+file fin=input("test.txt");
+real a=fin;
+@end verbatim
+
+@cindex comment character
+@cindex @code{error}
+If the optional boolean argument @code{check} is @code{false}, no check will
+be made that the file exists. If the file does not exist or is not
+readable, the function @code{bool error(file)} will return @code{true}.
+The first character of the string @code{comment} specifies a
+comment character. If this character is encountered in a data file,
+the remainder of the line is ignored. When reading strings, a comment
+character followed immediately by another comment character is treated
+as a single literal comment character. If @code{Asymptote} is compiled with
+support for @code{libcurl}, @code{name} can be a @acronym{URL}.
+
+
+@anchor{cd}
+@cindex @code{cd}
+@cindex @code{noglobalread}
+@cindex directory
+Unless the @code{-noglobalread} command-line option is specified,
+one can change the current working directory for read operations to
+the contents of the string @code{s} with the function @code{string
+cd(string s)}, which returns the new working directory. If
+@code{string s} is empty, the path is reset to the value it had at
+program startup.
+
+@cindex @code{getc}
+When reading pairs, the enclosing parenthesis are optional.
+Strings are also read by assignment, by reading characters up to but not
+including a newline. In addition, @code{Asymptote} provides the function
+@code{string getc(file)} to read the next character (treating the
+comment character as an ordinary character) and return it as a string.
+
+@cindex @code{output}
+@cindex @code{update}
+@cindex append
+A file named @code{name} can be open for output with
+@verbatim
+file output(string name="", bool update=false, string comment="#", string mode="");
+@end verbatim
+@noindent
+@cindex @code{noglobalread}
+@cindex @code{globalwrite}
+If @code{update=false}, any existing data in the file will be erased
+and only write operations can be used on the file.
+If @code{update=true}, any existing data will be preserved, the position
+will be set to the end-of-file, and both reading and writing operations
+will be enabled. For security reasons, writing to files in directories
+other than the current directory is allowed only if the @code{-globalwrite}
+(or @code{-nosafe}) command-line option is specified.
+Reading from files in other directories is allowed unless the
+@code{-noglobalread} command-line option is specified.
+@cindex @code{mktemp}
+The function @code{string mktemp(string s)} may be used to create and
+return the name of a unique temporary file in the current directory
+based on the string @code{s}.
+
+@cindex @code{stdin}
+@cindex @code{stdout}
+There are two special files: @code{stdin}, which reads from the keyboard,
+and @code{stdout}, which writes to the terminal. The implicit
+initializer for files is @code{null}.
+
+Data of a built-in type @code{T} can be written to an output file by
+calling one of the functions
+@cindex @code{write}
+@verbatim
+write(string s="", T x, suffix suffix=endl ... T[]);
+write(file file, string s="", T x, suffix suffix=none ... T[]);
+write(file file=stdout, string s="", explicit T[] x ... T[][]);
+write(file file=stdout, T[][]);
+write(file file=stdout, T[][][]);
+write(suffix suffix=endl);
+write(file file, suffix suffix=none);
+@end verbatim
+@cindex @code{none}
+@cindex @code{flush}
+@cindex @code{endl}
+@cindex @code{newl}
+@cindex @code{DOSendl}
+@cindex @code{DOSnewl}
+@cindex @code{tab}
+@cindex @code{comma}
+If @code{file} is not specified, @code{stdout} is used and
+terminated by default with a newline. If specified, the optional
+identifying string @code{s} is written before the data @code{x}.
+An arbitrary number of data values may be listed when writing scalars
+or one-dimensional arrays. The @code{suffix} may be one of the following:
+@code{none} (do nothing), @code{flush} (output buffered data),
+@code{endl} (terminate with a newline and flush),
+@code{newl} (terminate with a newline),
+@code{DOSendl} (terminate with a DOS newline and flush),
+@code{DOSnewl} (terminate with a DOS newline),
+@code{tab} (terminate with a tab), or @code{comma} (terminate with a
+comma). Here are some simple examples of data output:
+@verbatim
+file fout=output("test.txt");
+write(fout,1); // Writes "1"
+write(fout); // Writes a new line
+write(fout,"List: ",1,2,3); // Writes "List: 1 2 3"
+@end verbatim
+@noindent
+
+@cindex binary format
+@cindex single precision
+@cindex double precision
+@cindex @code{singlereal}
+@cindex @code{singleint}
+@cindex @code{signedint}
+@cindex @code{mode}
+@cindex @code{binary}
+@cindex @code{xdr}
+A file may be opened with @code{mode="xdr"}, to read or write
+double precision (64-bit) reals and single precision (32-bit)
+integers in Sun Microsystem's @acronym{XDR} (External
+Data Representation) portable binary format (available on all
+@code{UNIX} platforms).
+Alternatively, a file may also be opened with @code{mode="binary"}
+to read or write double precision reals and single
+precision integers in the native (nonportable) machine binary format,
+or to read the entire file into a string.
+The virtual member functions
+@code{file singlereal(bool b=true)} and @code{file singleint(bool b=true)}
+be used to change the precision of real and integer I/O
+operations, respectively, for an @acronym{XDR} or binary file @code{f}.
+Similarly, the function @code{file signedint(bool b=true)}
+can be used to modify the signedness of integer reads and writes for
+an @acronym{XDR} or binary file @code{f}.
+
+@cindex @code{name}
+@cindex @code{mode}
+@cindex @code{singlereal}
+@cindex @code{singleint}
+@cindex @code{signedint}
+The virtual members @code{name}, @code{mode}, @code{singlereal},
+@code{singleint}, and @code{signedint} may be used to query the
+respective parameters for a given file.
+
+@cindex @code{eof}
+@cindex @code{eol}
+@cindex @code{error}
+@cindex @code{flush}
+@cindex @code{clear}
+@cindex @code{precision}
+@cindex @code{seek}
+@cindex @code{tell}
+@cindex rewind
+@cindex @code{seekeof}
+One can test a file for end-of-file with the boolean function @code{eof(file)},
+end-of-line with @code{eol(file)}, and for I/O errors with @code{error(file)}.
+One can flush the output buffers with @code{flush(file)}, clear a
+previous I/O error with @code{clear(file)}, and close the file with
+@code{close(file)}. The function
+@code{int precision(file file=stdout, int digits=0)}
+sets the number of digits of output precision for @code{file} to @code{digits},
+provided @code{digits} is nonzero, and returns the previous
+precision setting. The function @code{int tell(file)} returns
+the current position in a file relative to the beginning.
+The routine @code{seek(file file, int pos)} can be used to
+change this position, where a negative value for the position @code{pos}
+is interpreted as relative to the end-of-file. For example, one can
+rewind a file @code{file} with the command @code{seek(file,0)}
+and position to the final character in the file with @code{seek(file,-1)}.
+The command @code{seekeof(file)} sets the position to the end of the file.
+
+@cindex @code{scroll}
+@anchor{scroll}
+Assigning @code{settings.scroll=n} for a positive integer @code{n}
+requests a pause after every @code{n} output lines to @code{stdout}.
+One may then press @code{Enter} to continue to the next @code{n} output lines,
+@code{s} followed by @code{Enter} to scroll without further interruption,
+or @code{q} followed by @code{Enter} to quit the current output
+operation. If @code{n} is negative, the output scrolls a page at a time
+(i.e. by one less than the current number of display lines). The default
+value, @code{settings.scroll=0}, specifies continuous scrolling.
+
+The routines
+@cindex @code{getstring}
+@cindex @code{getreal}
+@cindex @code{getpair}
+@cindex @code{gettriple}
+@verbatim
+string getstring(string name="", string default="", string prompt="",
+ bool store=true);
+int getint(string name="", int default=0, string prompt="",
+ bool store=true);
+real getreal(string name="", real default=0, string prompt="",
+ bool store=true);
+pair getpair(string name="", pair default=0, string prompt="",
+ bool store=true);
+triple gettriple(string name="", triple default=(0,0,0), string prompt="",
+ bool store=true);
+@end verbatim
+@noindent
+defined in the module @code{plain} may be used to prompt for a value from
+@code{stdin} using the @acronym{GNU} @code{readline} library.
+If @code{store=true}, the history of values for @code{name} is
+stored in the file @code{".asy_history_"+name} (@pxref{history}). The most
+recent value in the history will be used to provide a default value
+for subsequent runs. The default value (initially @code{default}) is
+displayed after @code{prompt}. These functions are based on the internal
+routines
+@cindex @code{readline}
+@cindex @code{saveline}
+@verbatim
+string readline(string prompt="", string name="", bool tabcompletion=false);
+void saveline(string name, string value, bool store=true);
+@end verbatim
+Here, @code{readline} prompts the user with the default value
+formatted according to @code{prompt}, while @code{saveline}
+is used to save the string @code{value} in a local history named
+@code{name}, optionally storing the local history in a file
+@code{".asy_history_"+name}.
+
+@cindex @code{history}
+The routine @code{history(string name, int n=1)} can be used to look up
+the @code{n} most recent values (or all values up to @code{historylines}
+if @code{n=0}) entered for string @code{name}.
+The routine @code{history(int n=0)} returns the interactive history.
+For example,
+@verbatim
+write(output("transcript.asy"),history());
+@end verbatim
+@noindent
+outputs the interactive history to the file @code{transcript.asy}.
+
+@cindex @code{delete}
+@cindex @code{globalwrite}
+The function @code{int delete(string s)} deletes the file named by the
+string @code{s}. Unless the @code{-globalwrite} (or @code{-nosafe})
+option is enabled, the file must reside in the current directory.
+@cindex @code{rename}
+The function @code{int rename(string from, string to)} may be used to
+rename file @code{from} to file @code{to}.
+Unless the @code{-globalwrite} (or @code{-nosafe}) option is enabled,
+this operation is restricted to the current directory.
+@cindex @code{convert}
+@cindex @code{animate}
+The functions
+@verbatim
+int convert(string args="", string file="", string format="");
+int animate(string args="", string file="", string format="");
+@end verbatim
+@noindent
+call the @code{ImageMagick} commands @code{convert} and @code{animate},
+respectively, with the arguments @code{args} and the file name constructed
+from the strings @code{file} and @code{format}.
+
+@node Variable initializers, Structures, Files, Programming
+@section Variable initializers
+@cindex variable initializers
+@cindex @code{operator init}
+@cindex initializers
+
+A variable can be assigned a value when it is declared, as in
+@code{int x=3;} where the variable @code{x} is assigned the value @code{3}.
+As well as literal constants such as @code{3}, arbitary expressions can be used
+as initializers, as in @code{real x=2*sin(pi/2);}.
+
+A variable is not added to the namespace until after the initializer is
+evaluated, so for example, in
+@verbatim
+int x=2;
+int x=5*x;
+@end verbatim
+@noindent
+the @code{x} in the initializer on the second line refers to the variable
+@code{x} declared on the first line. The second line, then, declares a variable
+@code{x} shadowing the original @code{x} and initializes it to the value
+@code{10}.
+
+Variables of most types can be declared without an explicit initializer and they
+will be initialized by the default initializer of that type:
+
+@itemize
+@item Variables of the numeric types @code{int}, @code{real}, and @code{pair}
+are all initialized to zero; variables of type @code{triple} are
+initialized to @code{O=(0,0,0)}.
+@item @code{boolean} variables are initialized to @code{false}.
+@item @code{string} variables are initialized to the empty string.
+@item @code{transform} variables are initialized to the identity transformation.
+@item @code{path} and @code{guide} variables are initialized to
+@code{nullpath}.
+@item @code{pen} variables are initialized to the default pen.
+@item @code{frame} and @code{picture} variables are initialized to empty
+frames and pictures, respectively.
+@item @code{file} variables are initialized to @code{null}.
+@end itemize
+
+The default initializers for user-defined array, structure, and function types
+are explained in their respective sections. Some types, such as
+@code{code}, do not have default initializers. When a variable of such
+a type is introduced, the user must initialize it by explicitly giving
+it a value.
+
+The default initializer for any type @code{T} can be redeclared by defining the
+function @code{T operator init()}. For instance, @code{int} variables are
+usually initialized to zero, but in
+@verbatim
+int operator init() {
+ return 3;
+}
+int y;
+@end verbatim
+
+@noindent
+the variable @code{y} is initialized to @code{3}. This example was given for
+illustrative purposes; redeclaring the initializers of built-in types is not
+recommended. Typically, @code{operator init} is used to define sensible
+defaults for user-defined types.
+
+@cindex @code{var}
+The special type @code{var} may be used to infer the type of a variable from
+its initializer. If the initializer is an expression of a unique type, then
+the variable will be defined with that type. For instance,
+@verbatim
+var x=5;
+var y=4.3;
+var reddash=red+dashed;
+@end verbatim
+@noindent
+is equivalent to
+@verbatim
+int x=5;
+real y=4.3;
+pen reddash=red+dashed;
+@end verbatim
+
+@code{var} may also be used with the extended @code{for} loop syntax.
+
+@verbatim
+int[] a = {1,2,3};
+for (var x : a)
+ write(x);
+@end verbatim
+
+@node Structures, Operators, Variable initializers, Programming
+@section Structures
+@cindex @code{struct}
+@cindex structures
+@cindex @code{public}
+@cindex @code{restricted}
+@cindex @code{private}
+@cindex @code{this}
+@cindex @code{new}
+@cindex @code{null}
+
+Users may also define their own data types as structures, along with
+user-defined operators, much as in C++. By default, structure members
+are @code{public} (may be read and modified anywhere in the code), but may be
+optionally declared @code{restricted} (readable anywhere but writeable
+only inside the structure where they are defined) or @code{private}
+(readable and writable only inside the structure). In a structure definition,
+the keyword @code{this} can be used as an expression to refer to the enclosing
+structure. Any code at the
+top-level scope within the structure is executed on initialization.
+
+Variables hold references to structures. That is, in the example:
+@verbatim
+struct T {
+ int x;
+}
+
+T foo;
+T bar=foo;
+bar.x=5;
+@end verbatim
+
+The variable @code{foo} holds a reference to an instance of the structure
+@code{T}. When @code{bar} is assigned the value of @code{foo}, it too
+now holds a reference to the same instance as @code{foo} does. The assignment
+@code{bar.x=5} changes the value of the field @code{x} in that instance, so
+that @code{foo.x} will also be equal to @code{5}.
+
+The expression @code{new T} creates a new instance of the structure @code{T} and
+returns a reference to that instance. In creating the new instance, any code in
+the body of the record definition is executed. For example:
+@verbatim
+int Tcount=0;
+struct T {
+ int x;
+ ++Tcount;
+}
+
+T foo=new T;
+T foo;
+@end verbatim
+@noindent
+Here, @code{new T} produces a new instance of the class, which
+causes @code{Tcount} to be incremented, tracking the
+number of instances produced. The declarations @code{T foo=new T} and
+@code{T foo} are equivalent: the second form implicitly creates a new
+instance of @code{T}.
+That is, after the definition of a structure @code{T}, a variable of
+type @code{T} is initialized to a new instance (@code{new T}) by
+default. During the definition of the structure, however, variables
+of type @code{T} are initialized to @code{null} by default. This
+special behaviour is to avoid infinite recursion of creating new
+instances in code such as
+@verbatim
+struct tree {
+ int value;
+ tree left;
+ tree right;
+}
+@end verbatim
+
+The expression @code{null} can be cast to any structure type to yield a null
+reference, a reference that does not actually refer to any instance of the
+structure. Trying to use a field of a null reference will cause an error.
+
+@cindex alias
+@cindex @code{==}
+@cindex @code{!=}
+The function @code{bool alias(T,T)} checks to see if two structure references
+refer to the same instance of the structure (or both to @code{null}).
+In example at the beginning of this section, @code{alias(foo,bar)}
+would return true, but @code{alias(foo,new T)} would return false, as @code{new
+T} creates a new instance of the structure @code{T}. The boolean operators
+@code{==} and @code{!=} are by default equivalent to @code{alias} and
+@code{!alias} respectively, but may be overwritten for a particular type
+(for example, to do a deep comparison).
+
+Here is a simple example that illustrates the use of structures:
+@verbatim
+struct S {
+ real a=1;
+ real f(real a) {return a+this.a;}
+}
+
+S s; // Initializes s with new S;
+
+write(s.f(2)); // Outputs 3
+
+S operator + (S s1, S s2)
+{
+ S result;
+ result.a=s1.a+s2.a;
+ return result;
+}
+
+write((s+s).f(0)); // Outputs 2
+
+@end verbatim
+
+@cindex constructors
+It is often convenient to have functions that construct new instances of a
+structure. Say we have a @code{Person} structure:
+@verbatim
+struct Person {
+ string firstname;
+ string lastname;
+}
+
+Person joe;
+joe.firstname="Joe";
+joe.lastname="Jones";
+@end verbatim
+@noindent
+Creating a new Person is a chore; it takes three lines to create a new instance
+and to initialize its fields (that's still considerably less effort than
+creating a new person in real life, though).
+
+We can reduce the work by defining a constructor function
+@code{Person(string,string)}:
+@verbatim
+struct Person {
+ string firstname;
+ string lastname;
+
+ static Person Person(string firstname, string lastname) {
+ Person p=new Person;
+ p.firstname=firstname;
+ p.lastname=lastname;
+ return p;
+ }
+}
+
+Person joe=Person.Person("Joe", "Jones");
+@end verbatim
+
+While it is now easier than before to create a new instance, we still
+have to refer to the constructor by the qualified name
+@code{Person.Person}. If we add the line
+@verbatim
+from Person unravel Person;
+@end verbatim
+@noindent
+immediately after the structure definition, then the constructor can be used
+without qualification: @code{Person joe=Person("Joe", "Jones");}.
+
+The constructor is now easy to use, but it is quite a hassle to define. If you
+write a lot of constructors, you will find that you are repeating a lot of code
+in each of them. Fortunately, your friendly neighbourhood Asymptote
+developers have devised a way to automate much of the process.
+
+@cindex @code{operator init}
+If, in the body of a structure, Asymptote encounters the definition of
+a function of the form @code{void operator init(@var{args})}, it implicitly
+defines a constructor function of the arguments @code{@var{args}} that
+uses the @code{void operator init} function to initialize a
+new instance of the structure.
+That is, it essentially defines the following constructor (assuming the
+structure is called @code{Foo}):
+
+@example
+static Foo Foo(@var{args}) @{
+ Foo instance=new Foo;
+ instance.operator init(@var{args});
+ return instance;
+@}
+@end example
+
+This constructor is also implicitly copied to the enclosing scope after the end
+of the structure definition, so that it can used subsequently without qualifying
+it by the structure name. Our @code{Person} example can thus be implemented as:
+@verbatim
+struct Person {
+ string firstname;
+ string lastname;
+
+ void operator init(string firstname, string lastname) {
+ this.firstname=firstname;
+ this.lastname=lastname;
+ }
+}
+
+Person joe=Person("Joe", "Jones");
+@end verbatim
+
+The use of @code{operator init} to implicitly define constructors should not be
+confused with its use to define default values for variables
+(@pxref{Variable initializers}). Indeed, in the
+first case, the return type of the @code{operator init} must be @code{void}
+while in the second, it must be the (non-@code{void}) type of the variable.
+
+@cindex @code{cputime}
+The function @code{cputime()}
+returns a structure @code{cputime} with cumulative @acronym{CPU} times
+broken down into the fields @code{parent.user}, @code{parent.system},
+@code{child.user}, and @code{child.system}, along with the cumulative
+wall clock time in @code{parent.clock}, all measured in seconds.
+For convenience, the incremental fields @code{change.user},
+@code{change.system}, and @code{change.clock} indicate the change in
+the corresponding fields since the last call to @code{cputime()}. The
+function
+@verbatim
+void write(file file=stdout, string s="", cputime c,
+ string format=cputimeformat, suffix suffix=none);
+@end verbatim
+@noindent
+displays the incremental user cputime followed by ``u'',
+the incremental system cputime followed by ``s'',
+the total user cputime followed by ``U'', and
+the total system cputime followed by ``S''.
+
+@cindex inheritance
+@cindex virtual functions
+Much like in C++, casting (@pxref{Casts}) provides for an elegant
+implementation of structure inheritance, including virtual functions:
+@verbatim
+struct parent {
+ real x;
+ void operator init(int x) {this.x=x;}
+ void virtual(int) {write(0);}
+ void f() {virtual(1);}
+}
+
+void write(parent p) {write(p.x);}
+
+struct child {
+ parent parent;
+ real y=3;
+ void operator init(int x) {parent.operator init(x);}
+ void virtual(int x) {write(x);}
+ parent.virtual=virtual;
+ void f()=parent.f;
+}
+
+parent operator cast(child child) {return child.parent;}
+
+parent p=parent(1);
+child c=child(2);
+
+write(c); // Outputs 2;
+
+p.f(); // Outputs 0;
+c.f(); // Outputs 1;
+
+write(c.parent.x); // Outputs 2;
+write(c.y); // Outputs 3;
+@end verbatim
+
+For further examples of structures, see @code{Legend} and @code{picture} in
+the @code{Asymptote} base module @code{plain}.
+
+@node Operators, Implicit scaling, Structures, Programming
+@section Operators
+@cindex operators
+
+@menu
+* Arithmetic & logical:: Basic mathematical operators
+* Self & prefix operators:: Increment and decrement
+* User-defined operators:: Overloading operators
+@end menu
+
+@node Arithmetic & logical, Self & prefix operators, Operators, Operators
+@subsection Arithmetic & logical operators
+@cindex arithmetic operators
+@cindex binary operators
+@cindex boolean operators
+@cindex logical operators
+@cindex @code{quotient}
+
+@code{Asymptote} uses the standard binary arithmetic operators.
+However, when one integer is divided by another, both arguments are
+converted to real values before dividing and a real quotient is
+returned (since this is typically what is intended; otherwise
+one can use the function @code{int quotient(int x, int y)}, which returns
+greatest integer less than or equal to @code{x/y}). In all other cases both
+operands are promoted to the same type, which will also be the
+type of the result:
+@table @code
+@cindex @code{+}
+@item +
+addition
+@cindex @code{-}
+@item -
+subtraction
+@cindex @code{*}
+@item *
+multiplication
+@cindex @code{/}
+@item /
+division
+@cindex integer division
+@cindex @code{#}
+@item #
+integer division; equivalent to @code{quotient(x,y)}. Noting that the
+@code{Python3} community adopted our comment symbol (@code{//}) for
+integer division, we decided to reciprocate and use their comment
+symbol for integer division in @code{Asymptote}!
+@cindex @code{%}
+@item %
+modulo; the result always has the same sign as the divisor.
+In particular, this makes @code{q*(p # q)+p % q == p} for all
+integers @code{p} and nonzero integers @code{q}.
+@cindex @code{^}
+@item ^
+@cindex @code{**}
+power; if the exponent (second argument) is an int, recursive
+multiplication is used; otherwise, logarithms and exponentials are used
+(@code{**} is a synonym for @code{^}).
+
+@end table
+
+The usual boolean operators are also defined:
+@table @code
+@cindex @code{==}
+@item ==
+equals
+@cindex @code{!=}
+@item !=
+not equals
+@cindex @code{<}
+@item <
+less than
+@cindex @code{<=}
+@item <=
+less than or equals
+@cindex @code{>=}
+@item >=
+greater than or equals
+@cindex @code{>}
+@item >
+greater than
+@cindex @code{&&}
+@item &&
+and (with conditional evaluation of right-hand argument)
+@cindex @code{&}
+@item &
+and
+@cindex @code{||}
+@item ||
+or (with conditional evaluation of right-hand argument)
+@cindex @code{|}
+@item |
+or
+@cindex @code{^}
+@item ^
+xor
+@cindex @code{!}
+@item !
+not
+@end table
+
+@code{Asymptote} also supports the C-like conditional syntax:
+@cindex @code{:}
+@cindex @code{?}
+@cindex conditional
+@verbatim
+bool positive=(pi > 0) ? true : false;
+@end verbatim
+
+@cindex @code{interp}
+The function @code{T interp(T a, T b, real t)} returns @code{(1-t)*a+t*b}
+for nonintegral built-in arithmetic types @code{T}. If @code{a} and
+@code{b} are pens, they are first promoted to the same color space.
+
+@cindex @code{AND}
+@cindex @code{OR}
+@cindex @code{XOR}
+@cindex @code{NOT}
+@cindex @code{CLZ}
+@cindex @code{CTZ}
+@code{Asymptote} also defines bitwise functions @code{int AND(int,int)},
+@code{int OR(int,int)}, @code{int XOR(int,int)}, @code{int NOT(int)},
+@code{int CLZ(int)} (count leading zeros),
+@code{int CTZ(int)} (count trailing zeros),
+@code{int popcount(int)} (count bits populated by ones), and
+@code{int bitreverse(int a, int bits)} (reverse bits within a word of
+length bits).
+
+@node Self & prefix operators, User-defined operators, Arithmetic & logical, Operators
+@subsection Self & prefix operators
+@cindex self operators
+@cindex prefix operators
+@cindex @code{+=}
+@cindex @code{-=}
+@cindex @code{*=}
+@cindex @code{/=}
+@cindex @code{%=}
+@cindex @code{^=}
+@cindex @code{++}
+@cindex @code{--}
+
+As in C, each of the arithmetic operators @code{+}, @code{-}, @code{*},
+@code{/}, @code{#}, @code{%}, and @code{^} can be used as a self operator.
+The prefix operators @code{++} (increment by one) and @code{--} (decrement
+by one) are also defined.
+For example,
+@verbatim
+int i=1;
+i += 2;
+int j=++i;
+@end verbatim
+
+@noindent
+is equivalent to the code
+@verbatim
+int i=1;
+i=i+2;
+int j=i=i+1;
+@end verbatim
+
+@cindex postfix operators
+However, postfix operators like @code{i++} and @code{i--} are not defined
+(because of the inherent ambiguities that would arise with the @code{--}
+path-joining operator). In the rare instances where @code{i++}
+and @code{i--} are really needed, one can substitute the expressions
+@code{(++i-1)} and @code{(--i+1)}, respectively.
+
+@node User-defined operators, , Self & prefix operators, Operators
+@subsection User-defined operators
+@cindex user-defined operators
+@cindex @code{operator}
+The following symbols may be used with @code{operator} to define or redefine
+operators on structures and built-in types:
+@verbatim
+- + * / % ^ ! < > == != <= >= & | ^^ .. :: -- --- ++
+<< >> $ $$ @ @@ <>
+@end verbatim
+@noindent
+The operators on the second line have precedence one higher than the
+boolean operators @code{<}, @code{>}, @code{<=}, and @code{>=}.
+
+Guide operators like @code{..} may be overloaded, say, to write
+a user function that produces a new guide from a given guide:
+@verbatim
+guide dots(... guide[] g)=operator ..;
+
+guide operator ..(... guide[] g) {
+ guide G;
+ if(g.length > 0) {
+ write(g[0]);
+ G=g[0];
+ }
+ for(int i=1; i < g.length; ++i) {
+ write(g[i]);
+ write();
+ G=dots(G,g[i]);
+ }
+ return G;
+}
+
+guide g=(0,0){up}..{SW}(100,100){NE}..{curl 3}(50,50)..(10,10);
+write("g=",g);
+@end verbatim
+
+@node Implicit scaling, Functions, Operators, Programming
+@section Implicit scaling
+@cindex implicit scaling
+
+If a numeric literal is in front of certain types of expressions, then the two
+are multiplied:
+@verbatim
+int x=2;
+real y=2.0;
+real cm=72/2.540005;
+
+write(3x);
+write(2.5x);
+write(3y);
+write(-1.602e-19 y);
+write(0.5(x,y));
+write(2x^2);
+write(3x+2y);
+write(3(x+2y));
+write(3sin(x));
+write(3(sin(x))^2);
+write(10cm);
+@end verbatim
+
+This produces the output
+@verbatim
+6
+5
+6
+-3.204e-19
+(1,1)
+8
+10
+18
+2.72789228047704
+2.48046543129542
+283.464008929116
+@end verbatim
+
+@node Functions, Arrays, Implicit scaling, Programming
+@section Functions
+@cindex functions
+
+@menu
+* Default arguments:: Default values can appear anywhere
+* Named arguments:: Assigning function arguments by keyword
+* Rest arguments:: Functions with a variable number of arguments
+* Mathematical functions:: Standard libm functions
+@end menu
+
+@code{Asymptote} functions are treated as variables with a signature
+(non-function variables have null signatures). Variables with the
+same name are allowed, so long as they have distinct signatures.
+
+Function arguments are passed by value. To pass an argument by
+reference, simply enclose it in a structure (@pxref{Structures}).
+
+Here are some significant features of @code{Asymptote} functions:
+
+@enumerate
+@item Variables with signatures (functions) and without signatures
+(nonfunction variables) are distinct:
+@verbatim
+int x, x();
+x=5;
+x=new int() {return 17;};
+x=x(); // calls x() and puts the result, 17, in the scalar x
+@end verbatim
+
+@item Traditional function definitions are allowed:
+@verbatim
+int sqr(int x)
+{
+ return x*x;
+}
+sqr=null; // but the function is still just a variable.
+@end verbatim
+
+@item Casting can be used to resolve ambiguities:
+@verbatim
+int a, a(), b, b(); // Valid: creates four variables.
+a=b; // Invalid: assignment is ambiguous.
+a=(int) b; // Valid: resolves ambiguity.
+(int) (a=b); // Valid: resolves ambiguity.
+(int) a=b; // Invalid: cast expressions cannot be L-values.
+
+int c();
+c=a; // Valid: only one possible assignment.
+@end verbatim
+
+@item Anonymous (so-called "high-order") functions are also allowed:
+@cindex @code{typedef}
+@verbatim
+typedef int intop(int);
+intop adder(int m)
+{
+ return new int(int n) {return m+n;};
+}
+intop addby7=adder(7);
+write(addby7(1)); // Writes 8.
+@end verbatim
+
+@item
+@cindex overloading functions
+One may redefine a function @code{f}, even for calls to @code{f} in previously
+declared functions, by assigning another (anonymous or named)
+function to it. However, if @code{f} is overloaded by a
+new function definition, previous calls will still access the original
+version of @code{f}, as illustrated in this example:
+@verbatim
+void f() {
+ write("hi");
+}
+
+void g() {
+ f();
+}
+
+g(); // writes "hi"
+
+f=new void() {write("bye");};
+
+g(); // writes "bye"
+
+void f() {write("overloaded");};
+
+f(); // writes "overloaded"
+g(); // writes "bye"
+@end verbatim
+
+@cindex function declarations
+@item Anonymous functions can be used to redefine a function variable
+that has been declared (and implicitly initialized to the null function)
+but not yet explicitly defined:
+@verbatim
+void f(bool b);
+
+void g(bool b) {
+ if(b) f(b);
+ else write(b);
+}
+
+f=new void(bool b) {
+ write(b);
+ g(false);
+};
+
+g(true); // Writes true, then writes false.
+@end verbatim
+
+@end enumerate
+
+@code{Asymptote} is the only language we know of that treats functions
+as variables, but allows overloading by distinguishing variables
+based on their signatures.
+
+@cindex @code{libsigsegv}
+@cindex stack overflow
+@anchor{stack overflow}
+@cindex recursion
+@cindex stack overflow
+Functions are allowed to call themselves recursively. As in C++, infinite
+nested recursion will generate a stack overflow (reported as a
+segmentation fault, unless a fully working version of the @acronym{GNU}
+library @code{libsigsegv} (e.g.@ 2.4 or later) is installed at
+configuration time).
+
+@node Default arguments, Named arguments, Functions, Functions
+@subsection Default arguments
+@cindex default arguments
+@cindex arguments
+
+@code{Asymptote} supports a more flexible mechanism for default function
+arguments than C++: they may appear anywhere in the function prototype.
+Because certain data types are implicitly cast to more sophisticated
+types (@pxref{Casts}) one can often avoid ambiguities by ordering
+function arguments from the simplest to the most complicated.
+For example, given
+@verbatim
+real f(int a=1, real b=0) {return a+b;}
+@end verbatim
+@noindent
+then @code{f(1)} returns 1.0, but @code{f(1.0)} returns 2.0.
+
+The value of a default argument is determined by evaluating the
+given @code{Asymptote} expression in the scope where the called
+function is defined.
+
+@node Named arguments, Rest arguments, Default arguments, Functions
+@subsection Named arguments
+@cindex keywords
+@cindex named arguments
+
+It is sometimes difficult to remember the order in which arguments
+appear in a function declaration. Named (keyword) arguments make calling
+functions with multiple arguments easier. Unlike in the C and C++
+languages, an assignment in a function argument is interpreted as an
+assignment to a parameter of the same name in the function signature,
+@emph{not within the local scope}. The command-line option @code{-d}
+may be used to check @code{Asymptote} code for cases where a
+named argument may be mistaken for a local assignment.
+
+When matching arguments to signatures, first all of the keywords are
+matched, then the arguments without names are matched against the
+unmatched formals as usual. For example,
+@verbatim
+int f(int x, int y) {
+ return 10x+y;
+}
+write(f(4,x=3));
+@end verbatim
+@noindent
+outputs 34, as @code{x} is already matched when we try to match the
+unnamed argument @code{4}, so it gets matched to the next item, @code{y}.
+
+For the rare occasions where it is desirable to assign a value to
+local variable within a function argument (generally @emph{not} a good
+programming practice), simply enclose the assignment in
+parentheses. For example, given the definition of @code{f} in the
+previous example,
+@verbatim
+int x;
+write(f(4,(x=3)));
+@end verbatim
+@noindent
+is equivalent to the statements
+@verbatim
+int x;
+x=3;
+write(f(4,3));
+@end verbatim
+@noindent
+and outputs 43.
+
+@cindex @code{keyword}
+@cindex keyword-only
+Parameters can be specified as ``keyword-only'' by putting @code{keyword}
+immediately before the parameter name, as in @code{int f(int keyword x)} or
+@code{int f(int keyword x=77)}. This forces the caller of the function to use
+a named argument to give a value for this parameter. That is, @code{f(x=42)}
+is legal, but @code{f(25)} is not. Keyword-only parameters must be listed
+after normal parameters in a function definition.
+
+
+As a technical detail, we point out that, since variables of the same
+name but different signatures are allowed in the same scope, the code
+@verbatim
+int f(int x, int x()) {
+ return x+x();
+}
+int seven() {return 7;}
+@end verbatim
+@noindent
+is legal in @code{Asymptote}, with @code{f(2,seven)} returning 9.
+A named argument matches the first unmatched formal of the same name, so
+@code{f(x=2,x=seven)} is an equivalent call, but @code{f(x=seven,2)}
+is not, as the first argument is matched to the first formal, and
+@code{int ()} cannot be implicitly cast to @code{int}. Default
+arguments do not affect which formal a named argument is matched to,
+so if @code{f} were defined as
+@verbatim
+int f(int x=3, int x()) {
+ return x+x();
+}
+@end verbatim
+@noindent
+then @code{f(x=seven)} would be illegal, even though @code{f(seven)}
+obviously would be allowed.
+
+@node Rest arguments, Mathematical functions, Named arguments, Functions
+@subsection Rest arguments
+@cindex rest arguments
+
+Rest arguments allow one to write functions that take a variable
+number of arguments:
+@verbatim
+// This function sums its arguments.
+int sum(... int[] nums) {
+ int total=0;
+ for(int i=0; i < nums.length; ++i)
+ total += nums[i];
+ return total;
+}
+
+sum(1,2,3,4); // returns 10
+sum(); // returns 0
+
+// This function subtracts subsequent arguments from the first.
+int subtract(int start ... int[] subs) {
+ for(int i=0; i < subs.length; ++i)
+ start -= subs[i];
+ return start;
+}
+
+subtract(10,1,2); // returns 7
+subtract(10); // returns 10
+subtract(); // illegal
+@end verbatim
+
+@cindex packing
+Putting an argument into a rest array is called @emph{packing}.
+One can give an explicit list of arguments for the rest
+argument, so @code{subtract} could alternatively be implemented as
+@verbatim
+int subtract(int start ... int[] subs) {
+ return start - sum(... subs);
+}
+@end verbatim
+
+One can even combine normal arguments with rest arguments:
+@verbatim
+sum(1,2,3 ... new int[] {4,5,6}); // returns 21
+@end verbatim
+@noindent
+@cindex unpacking
+This builds a new six-element array that is passed to @code{sum} as
+@code{nums}. The opposite operation, @emph{unpacking}, is not allowed:
+@verbatim
+subtract(... new int[] {10, 1, 2});
+@end verbatim
+@noindent
+is illegal, as the start formal is not matched.
+
+If no arguments are packed, then a zero-length array (as opposed to
+@code{null}) is bound to the rest parameter. Note that default
+arguments are ignored for rest formals and the rest argument is not
+bound to a keyword.
+
+In some cases, keyword-only parameters are helpful to avoid arguments intended
+for the rest parameter to be assigned to other parameters. For example, here
+the use of @code{keyword} is to avoid @code{pnorm(1.0,2.0,0.3)} matching
+@code{1.0} to @code{p}.
+@verbatim
+real pnorm(real keyword p=2.0 ... real[] v)
+{
+ return sum(v^p)^(1/p);
+}
+@end verbatim
+
+The overloading resolution in @code{Asymptote} is similar to the
+function matching rules used in C++. Every argument match is given a
+score. Exact matches score better than matches with casting, and
+matches with formals (regardless of casting) score better than packing
+an argument into the rest array. A candidate is maximal if all of the
+arguments score as well in it as with any other candidate. If there
+is one unique maximal candidate, it is chosen; otherwise, there is an
+ambiguity error.
+
+@verbatim
+int f(path g);
+int f(guide g);
+f((0,0)--(100,100)); // matches the second; the argument is a guide
+
+int g(int x, real y);
+int g(real x, int x);
+
+g(3,4); // ambiguous; the first candidate is better for the first argument,
+ // but the second candidate is better for the second argument
+
+int h(... int[] rest);
+int h(real x ... int[] rest);
+
+h(1,2); // the second definition matches, even though there is a cast,
+ // because casting is preferred over packing
+
+int i(int x ... int[] rest);
+int i(real x, real y ... int[] rest);
+
+i(3,4); // ambiguous; the first candidate is better for the first argument,
+ // but the second candidate is better for the second one
+@end verbatim
+
+@node Mathematical functions, , Rest arguments, Functions
+@subsection Mathematical functions
+@cindex mathematical functions
+@cindex functions
+@cindex @code{libm} routines
+
+@cindex @code{sin}
+@cindex @code{cos}
+@cindex @code{tan}
+@cindex @code{asin}
+@cindex @code{acos}
+@cindex @code{atan}
+@cindex @code{exp}
+@cindex @code{log}
+@cindex @code{pow10}
+@cindex @code{log10}
+@cindex @code{sinh}
+@cindex @code{cosh}
+@cindex @code{tanh}
+@cindex @code{asinh}
+@cindex @code{acosh}
+@cindex @code{atanh}
+@cindex @code{sqrt}
+@cindex @code{cbrt}
+@cindex @code{fabs}
+@cindex @code{expm1}
+@cindex @code{log1p}
+@cindex @code{identity}
+@cindex @code{J}
+@cindex @code{Y}
+@cindex @code{gamma}
+@cindex @code{erf}
+@cindex @code{erfc}
+@cindex @code{atan2}
+@cindex @code{hypot}
+@cindex @code{fmod}
+@cindex @code{remainder}
+@code{Asymptote} has built-in versions of the standard @code{libm} mathematical
+real(real) functions @code{sin}, @code{cos}, @code{tan}, @code{asin},
+@code{acos}, @code{atan}, @code{exp}, @code{log}, @code{pow10},
+@code{log10}, @code{sinh}, @code{cosh}, @code{tanh}, @code{asinh},
+@code{acosh}, @code{atanh}, @code{sqrt}, @code{cbrt}, @code{fabs}, @code{expm1},
+@code{log1p}, as well as the identity function @code{identity}.
+@code{Asymptote} also defines the order @code{n} Bessel functions of
+the first kind @code{Jn(int n, real)} and second kind
+@code{Yn(int n, real)}, as well as the gamma function @code{gamma},
+the error function @code{erf}, and the complementary error function
+@code{erfc}. The standard real(real, real) functions @code{atan2},
+@code{hypot}, @code{fmod}, @code{remainder} are also included.
+
+@cindex @code{degrees}
+@cindex @code{radians}
+@cindex @code{Degrees}
+The functions @code{degrees(real radians)} and @code{radians(real degrees)}
+can be used to convert between radians and degrees. The function
+@code{Degrees(real radians)} returns the angle in degrees in the
+interval [0,360).
+@cindex @code{Sin}
+@cindex @code{Cos}
+@cindex @code{Tan}
+@cindex @code{aSin}
+@cindex @code{aCos}
+@cindex @code{aTan}
+For convenience, @code{Asymptote} defines variants @code{Sin},
+@code{Cos}, @code{Tan}, @code{aSin}, @code{aCos}, and @code{aTan} of
+the standard trigonometric functions that use degrees rather than radians.
+We also define complex versions of the @code{sqrt}, @code{sin}, @code{cos},
+@code{exp}, @code{log}, and @code{gamma} functions.
+
+@cindex @code{floor}
+@cindex @code{ceil}
+@cindex @code{round}
+@cindex @code{sgn}
+The functions @code{floor}, @code{ceil}, and @code{round} differ from
+their usual definitions in that they all return an int value rather than
+a real (since that is normally what one wants).
+The functions @code{Floor}, @code{Ceil}, and @code{Round} are
+respectively similar, except that if the result cannot be converted
+to a valid int, they return @code{intMax}
+for positive arguments and @code{intMin} for negative arguments,
+rather than generating an integer overflow.
+We also define a function @code{sgn}, which returns the sign of its
+real argument as an integer (-1, 0, or 1).
+
+@cindex @code{abs}
+There is an @code{abs(int)} function, as well as an @code{abs(real)}
+function (equivalent to @code{fabs(real)}), an @code{abs(pair)} function
+(equivalent to @code{length(pair)}).
+
+@cindex @code{srand}
+@cindex @code{rand}
+@cindex @code{randMax}
+@cindex @code{unitrand}
+@cindex @code{Gaussrand}
+@cindex @code{histogram}
+@cindex @code{factorial}
+@cindex @code{choose}
+Random numbers can be seeded with @code{srand(int)} and generated with
+the @code{int rand()} function, which returns a random integer between 0
+and the integer @code{randMax}. The @code{unitrand()} function returns
+a random number uniformly distributed in the interval [0,1].
+A Gaussian random number generator
+@code{Gaussrand} and a collection of statistics routines, including
+@code{histogram}, are provided in the module @code{stats}.
+The functions @code{factorial(int n)}, which returns @math{n!}, and
+@code{choose(int n, int k)}, which returns @math{n!/(k!(n-k)!)}, are
+also defined.
+
+@cindex @acronym{GNU} Scientific Library
+@cindex @code{gsl}
+@cindex Airy
+@cindex Bessel
+@cindex Legendre
+@cindex elliptic functions
+@cindex exponential integral
+@cindex trigonometric integrals
+@cindex Riemann zeta function
+@cindex @code{Ai}
+@cindex @code{Bi}
+@cindex @code{Ai_deriv}
+@cindex @code{Bi_deriv}
+@cindex @code{zero_Ai}
+@cindex @code{zero_Bi}
+@cindex @code{zero_Ai_deriv}
+@cindex @code{zero_Bi_deriv}
+@cindex @code{J}
+@cindex @code{Y}
+@cindex @code{I}
+@cindex @code{K}
+@cindex @code{i_scaled}
+@cindex @code{k_scaled}
+@cindex @code{zero_J}
+@cindex @code{F}
+@cindex @code{E}
+@cindex @code{P}
+@cindex @code{sncndn}
+@cindex @code{Ei}
+@cindex @code{Si}
+@cindex @code{Ci}
+@cindex @code{Pl}
+@cindex @code{zeta}
+When configured with the @acronym{GNU} Scientific Library (GSL), available from
+@url{https://www.gnu.org/software/gsl/},
+@code{Asymptote} contains an internal module @code{gsl} that
+defines the airy functions @code{Ai(real)},
+@code{Bi(real)}, @code{Ai_deriv(real)}, @code{Bi_deriv(real)},
+@code{zero_Ai(int)}, @code{zero_Bi(int)},
+@code{zero_Ai_deriv(int)}, @code{zero_Bi_deriv(int)}, the Bessel functions
+@code{I(int, real)}, @code{K(int, real)}, @code{j(int, real)},
+@code{y(int, real)}, @code{i_scaled(int, real)}, @code{k_scaled(int, real)},
+@code{J(real, real)}, @code{Y(real, real)}, @code{I(real, real)},
+@code{K(real, real)}, @code{zero_J(real, int)}, the elliptic functions
+@code{F(real, real)}, @code{E(real, real)}, and @code{P(real, real)},
+the Jacobi elliptic functions @code{real[] sncndn(real,real)},
+the exponential/trigonometric integrals @code{Ei}, @code{Si}, and @code{Ci},
+the Legendre polynomials @code{Pl(int, real)}, and the Riemann zeta
+function @code{zeta(real)}. For example, to compute the sine integral
+@code{Si} of 1.0:
+@verbatim
+import gsl;
+write(Si(1.0));
+@end verbatim
+
+@code{Asymptote} also provides a few general purpose numerical routines:
+
+@table @code
+
+@cindex @code{newton}
+@item @code{real newton(int iterations=100, real f(real), real fprime(real), real x, bool verbose=false);}
+Use Newton-Raphson iteration to solve for a root of a real-valued
+differentiable function @code{f}, given its derivative @code{fprime} and
+an initial guess @code{x}. Diagnostics for
+each iteration are printed if @code{verbose=true}.
+If the iteration fails after the maximum allowed number of loops
+(@code{iterations}), @code{realMax} is returned.
+
+@cindex @code{newton}
+@item @code{real newton(int iterations=100, real f(real), real fprime(real), real x1, real x2, bool verbose=false);}
+Use bracketed Newton-Raphson bisection to solve for a root of a real-valued
+differentiable function @code{f} within an interval
+[@code{x1},@code{x2}] (on which the endpoint values of @code{f} have
+opposite signs), given its derivative @code{fprime}. Diagnostics for
+each iteration are printed if @code{verbose=true}.
+If the iteration fails after the maximum allowed number of loops
+(@code{iterations}), @code{realMax} is returned.
+
+@cindex integral
+@cindex integrate
+@cindex @code{simpson}
+@item @code{real simpson(real f(real), real a, real b, real acc=realEpsilon, real dxmax=b-a)}
+returns the integral of @code{f} from @code{a} to @code{b} using adaptive Simpson integration.
+
+@end table
+
+@node Arrays, Casts, Functions, Programming
+@section Arrays
+@cindex arrays
+
+@menu
+* Slices:: Python-style array slices
+@end menu
+
+Appending @code{[]} to a built-in or user-defined type yields an array.
+The array element @code{i} of an array @code{A} can be accessed as @code{A[i]}.
+By default, attempts to access or assign to an array element using a negative
+index generates an error. Reading an array element with an index
+beyond the length of the array also generates an error; however,
+assignment to an element beyond the length of the array causes the
+array to be resized to accommodate the new element.
+One can also index an array @code{A} with an integer array @code{B}:
+the array @code{A[B]} is formed by indexing array @code{A} with
+successive elements of array @code{B}.
+A convenient Java-style shorthand exists for iterating over all elements of an
+array; see @ref{array iteration}.
+
+The declaration
+@verbatim
+real[] A;
+@end verbatim
+
+@noindent
+initializes @code{A} to be an empty (zero-length) array. Empty arrays should be
+distinguished from null arrays. If we say
+@verbatim
+real[] A=null;
+@end verbatim
+
+@noindent
+then @code{A} cannot be dereferenced at all (null arrays have no length
+and cannot be read from or assigned to).
+
+Arrays can be explicitly initialized like this:
+@verbatim
+real[] A={0,1,2};
+@end verbatim
+
+Array assignment in @code{Asymptote} does a shallow copy: only
+the pointer is copied (if one copy if modified, the other will be too).
+The @code{copy} function listed below provides a deep copy of an array.
+
+@cindex @code{length}
+@cindex @code{cyclic}
+@cindex @code{keys}
+@cindex @code{push}
+@cindex @code{append}
+@cindex @code{pop}
+@cindex @code{insert}
+@cindex @code{delete}
+@cindex @code{initialized}
+Every array @code{A} of type @code{T[]} has the virtual members
+@itemize
+@item @code{int length},
+@item @code{int cyclic},
+@item @code{int[] keys},
+@item @code{T push(T x)},
+@item @code{void append(T[] a)},
+@item @code{T pop()},
+@item @code{void insert(int i ... T[] x)},
+@item @code{void delete(int i, int j=i)},
+@item @code{void delete()}, and
+@item @code{bool initialized(int n)}.
+@end itemize
+
+The member @code{A.length} evaluates to the length of the array.
+Setting @code{A.cyclic=true} signifies that array indices should be reduced
+modulo the current array length. Reading from or writing to a nonempty
+cyclic array never leads to out-of-bounds errors or array resizing.
+
+The member @code{A.keys} evaluates to an array of integers containing the
+indices of initialized entries in the array in ascending order. Hence, for an
+array of length @code{n} with all entries initialized, @code{A.keys} evaluates
+to @code{@{0,1,...,n-1@}}. A new keys array is produced each time
+@code{A.keys} is evaluated.
+
+The functions @code{A.push} and @code{A.append} append their
+arguments onto the end of the array, while @code{A.insert(int i ... T[] x)}
+inserts @code{x} into the array at index @code{i}.
+For convenience @code{A.push} returns the pushed item.
+The function @code{A.pop()} pops and returns the last element,
+while @code{A.delete(int i, int j=i)} deletes elements with indices in
+the range [@code{i},@code{j}], shifting the position of all higher-indexed
+elements down. If no arguments are given, @code{A.delete()} provides a
+convenient way of deleting all elements of @code{A}. The routine
+@code{A.initialized(int n)} can be used to examine whether the element
+at index @code{n} is initialized. Like all @code{Asymptote} functions,
+@code{push}, @code{append}, @code{pop}, @code{insert},
+@code{delete}, and @code{initialized} can be "pulled off" of the array
+and used on their own. For example,
+@verbatim
+int[] A={1};
+A.push(2); // A now contains {1,2}.
+A.append(A); // A now contains {1,2,1,2}.
+int f(int)=A.push;
+f(3); // A now contains {1,2,1,2,3}.
+int g()=A.pop;
+write(g()); // Outputs 3.
+A.delete(0); // A now contains {2,1,2}.
+A.delete(0,1); // A now contains {2}.
+A.insert(1,3); // A now contains {2,3}.
+A.insert(1 ... A); // A now contains {2,2,3,3}
+A.insert(2,4,5); // A now contains {2,2,4,5,3,3}.
+@end verbatim
+
+The @code{[]} suffix can also appear after the variable name; this
+is sometimes convenient for declaring a list of variables and arrays
+of the same type:
+@verbatim
+real a,A[];
+@end verbatim
+@noindent
+This declares @code{a} to be @code{real} and implicitly declares @code{A} to
+be of type @code{real[]}.
+
+In the following list of built-in array functions, @code{T} represents a
+generic type. Note that the internal functions @code{alias}, @code{array},
+@code{copy}, @code{concat}, @code{sequence}, @code{map}, and
+@code{transpose}, which depend on type @code{T[]}, are defined only after the
+first declaration of a variable of type @code{T[]}.
+
+@table @code
+
+@cindex @code{new}
+@item new T[]
+returns a new empty array of type @code{T[]};
+
+@cindex @code{new}
+@item new T[] @{list@}
+returns a new array of type @code{T[]} initialized with @code{list} (a comma
+delimited list of elements);
+
+@item new T[n]
+returns a new array of @code{n} elements of type @code{T[]}.
+These @code{n} array elements are not initialized unless they are arrays
+themselves (in which case they are each initialized to empty arrays);
+
+@cindex @code{array}
+@item T[] array(int n, T value, int depth=intMax)
+returns an array consisting of @code{n} copies of @code{value}.
+If @code{value} is itself an array, a deep copy of @code{value} is made
+for each entry. If @code{depth} is specified, this deep copying only
+recurses to the specified number of levels;
+
+@cindex @code{sequence}
+@item int[] sequence(int n)
+if @code{n >= 1} returns the array @code{@{0,1,...,n-1@}} (otherwise returns
+a null array);
+
+@item int[] sequence(int n, int m)
+if @code{m >= n} returns an array @code{@{n,n+1,...,m@}} (otherwise
+returns a null array);
+
+@item T[] sequence(T f(int), int n)
+if @code{n >= 1} returns the sequence @code{@{f_i :i=0,1,...n-1@}} given a
+function @code{T f(int)} and integer @code{int n} (otherwise returns a
+null array);
+
+@cindex @code{map}
+@item T[] map(T f(T), T[] a)
+returns the array obtained by applying the function @code{f} to each
+element of the array @code{a}. This is equivalent to
+@code{sequence(new T(int i) @{return f(a[i]);@},a.length)};
+
+@cindex @code{map}
+@item T2[] map(T2 f(T1), T1[] a)
+constructed by calling @code{mapArray("T1","T2")}, returns the array
+obtained by applying the function @code{f} to each element of the
+array @code{a};
+
+@cindex @code{reverse}
+@item int[] reverse(int n)
+if @code{n >= 1} returns the array @code{@{n-1,n-2,...,0@}} (otherwise
+returns a null array);
+
+@cindex @code{complement}
+@item int[] complement(int[] a, int n)
+returns the complement of the integer array @code{a} in
+@code{@{0,1,2,...,n-1@}}, so that @code{b[complement(a,b.length)]} yields the
+complement of @code{b[a]};
+
+@cindex @code{uniform}
+@item real[] uniform(real a, real b, int n)
+if @code{n >= 1} returns a uniform partition of @code{[a,b]} into
+@code{n} subintervals (otherwise returns a null array);
+
+@cindex @code{find}
+@item int find(bool[] a, int n=1)
+returns the index of the @code{n}th @code{true} value in the boolean array
+@code{a} or -1 if not found. If @code{n} is negative, search backwards
+from the end of the array for the @code{-n}th value;
+
+@cindex @code{findall}
+@item int[] findall(bool[] a)
+returns the indices of all @code{true} values in the boolean array @code{a};
+
+@cindex @code{search}
+@item int search(T[] a, T key)
+For built-in ordered types @code{T}, searches a sorted array
+@code{a} of @code{n} elements for k, returning the index @code{i}
+if @code{a[i] <= key < a[i+1]}, @code{-1} if @code{key} is
+less than all elements of @code{a}, or @code{n-1} if @code{key} is
+greater than or equal to the last element of @code{a};
+
+@cindex @code{search}
+@item int search(T[] a, T key, bool less(T i, T j))
+searches an array @code{a} sorted in ascending order such that element
+@code{i} precedes element @code{j} if @code{less(i,j)} is true;
+
+@cindex @code{copy}
+@item T[] copy(T[] a)
+returns a deep copy of the array @code{a};
+
+@cindex @code{concat}
+@item T[] concat(... T[][] a)
+returns a new array formed by concatenating the given one-dimensional
+arrays given as arguments;
+
+@cindex @code{alias}
+@item bool alias(T[] a, T[] b)
+returns @code{true} if the arrays @code{a} and @code{b} are identical;
+
+@cindex @code{sort}
+@item T[] sort(T[] a)
+For built-in ordered types @code{T}, returns a copy of @code{a} sorted in
+ascending order;
+
+@cindex @code{sort}
+@anchor{sort}
+@item T[][] sort(T[][] a)
+For built-in ordered types @code{T}, returns a copy of @code{a} with the rows
+sorted by the first column, breaking ties with successively higher
+columns. For example:
+@verbatim
+string[][] a={{"bob","9"},{"alice","5"},{"pete","7"},
+ {"alice","4"}};
+// Row sort (by column 0, using column 1 to break ties):
+write(sort(a));
+@end verbatim
+
+produces
+@verbatim
+alice 4
+alice 5
+bob 9
+pete 7
+@end verbatim
+
+@cindex @code{sort}
+@item T[] sort(T[] a, bool less(T i, T j), bool stable=true)
+returns a copy of @code{a} sorted in ascending order such that
+element @code{i} precedes element @code{j} if @code{less(i,j)} is
+true, subject to (if @code{stable} is @code{true}) the stability constraint
+that the original order of elements @code{i} and @code{j} is preserved if
+@code{less(i,j)} and @code{less(j,i)} are both @code{false};
+
+@cindex @code{transpose}
+@item T[][] transpose(T[][] a)
+returns the transpose of @code{a};
+
+@cindex @code{transpose}
+@item T[][][] transpose(T[][][] a, int[] perm)
+returns the 3D transpose of @code{a} obtained by applying the permutation
+@code{perm} of @code{new int[]@{0,1,2@}} to the indices of each entry;
+
+@cindex @code{sum}
+@item T sum(T[] a)
+for arithmetic types @code{T}, returns the sum of @code{a}.
+In the case where @code{T} is @code{bool}, the number of true elements in
+@code{a} is returned;
+
+@cindex @code{min}
+@item T min(T[] a)
+@item T min(T[][] a)
+@item T min(T[][][] a)
+for built-in ordered types @code{T}, returns the minimum element of @code{a};
+
+@cindex @code{max}
+@item T max(T[] a)
+@item T max(T[][] a)
+@item T max(T[][][] a)
+for built-in ordered types @code{T}, returns the maximum element of @code{a};
+
+@cindex @code{min}
+@item T[] min(T[] a, T[] b)
+for built-in ordered types @code{T}, and arrays @code{a} and @code{b}
+of the same length, returns an array composed of the minimum of the
+corresponding elements of @code{a} and @code{b};
+
+@cindex @code{max}
+@item T[] max(T[] a, T[] b)
+for built-in ordered types @code{T}, and arrays @code{a} and @code{b}
+of the same length, returns an array composed of the maximum of the
+corresponding elements of @code{a} and @code{b};
+
+@cindex @code{pairs}
+@item pair[] pairs(real[] x, real[] y);
+for arrays @code{x} and @code{y} of the same length, returns the pair array
+@code{sequence(new pair(int i) @{return (x[i],y[i]);@},x.length)};
+
+@cindex @code{fft}
+@item pair[] fft(pair[] a, int sign=1)
+returns the unnormalized Fast Fourier Transform of @code{a} (if the optional
+@code{FFTW} package is installed), using the given @code{sign}. Here
+is a simple example:
+@verbatim
+int n=4;
+pair[] f=sequence(n);
+write(f);
+pair[] g=fft(f,-1);
+write();
+write(g);
+f=fft(g,1);
+write();
+write(f/n);
+@end verbatim
+
+@cindex @code{fft}
+@item pair[][] fft(pair[][] a, int sign=1)
+returns the unnormalized two-dimensional Fourier transform of @code{a}
+using the given @code{sign};
+
+@cindex @code{fft}
+@item pair[][][] fft(pair[][][] a, int sign=1)
+returns the unnormalized three-dimensional Fourier transform of
+@code{a} using the given @code{sign};
+
+@cindex @code{dot}
+@item real dot(real[] a, real[] b)
+returns the dot product of the vectors @code{a} and @code{b};
+
+@cindex @code{dot}
+@item pair dot(pair[] a, pair[] b)
+returns the complex dot product @code{sum(a*conj(b))} of the vectors
+@code{a} and @code{b};
+
+@anchor{tridiagonal}
+@cindex @code{tridiagonal}
+@item real[] tridiagonal(real[] a, real[] b, real[] c, real[] f);
+Solve the periodic tridiagonal problem @math{L@code{x}=@code{f}} and return the
+solution @code{x}, where @code{f}
+is an @math{n} vector and @math{L} is the @math{n \times n} matrix
+@verbatim
+[ b[0] c[0] a[0] ]
+[ a[1] b[1] c[1] ]
+[ a[2] b[2] c[2] ]
+[ ... ]
+[ c[n-1] a[n-1] b[n-1] ]
+@end verbatim
+For Dirichlet boundary conditions (denoted here by @code{u[-1]} and
+@code{u[n]}), replace @code{f[0]} by @code{f[0]-a[0]u[-1]} and
+@code{f[n-1]-c[n-1]u[n]}; then set @code{a[0]=c[n-1]=0};
+
+@cindex @code{solve}
+@item real[] solve(real[][] a, real[] b, bool warn=true)
+Solve the linear equation @math{@code{a}x=@code{b}} by LU decomposition
+and return the solution @math{x}, where @code{a} is an
+@math{n \times n} matrix and @code{b} is an array of length @math{n}.
+For example:
+@verbatim
+import math;
+real[][] a={{1,-2,3,0},{4,-5,6,2},{-7,-8,10,5},{1,50,1,-2}};
+real[] b={7,19,33,3};
+real[] x=solve(a,b);
+write(a); write();
+write(b); write();
+write(x); write();
+write(a*x);
+@end verbatim
+If @code{a} is a singular matrix and @code{warn} is @code{false}, return an
+empty array.
+If the matrix @code{a} is tridiagonal, the routine @code{tridiagonal} provides
+a more efficient algorithm (@pxref{tridiagonal});
+
+@anchor{solve}
+@cindex @code{solve}
+@item real[][] solve(real[][] a, real[][] b, bool warn=true)
+Solve the linear equation @math{@code{a}x=@code{b}} and return the
+solution @math{x}, where @code{a} is an @math{n \times n} matrix and
+@code{b} is an @math{n \times m} matrix. If @code{a} is a singular
+matrix and @code{warn} is @code{false}, return an empty matrix;
+
+@cindex @code{identity}
+@item real[][] identity(int n);
+returns the @math{n \times n} identity matrix;
+
+@cindex @code{diagonal}
+@item real[][] diagonal(... real[] a)
+returns the diagonal matrix with diagonal entries given by a;
+
+@cindex @code{inverse}
+@item real[][] inverse(real[][] a)
+returns the inverse of a square matrix @code{a};
+
+@cindex @code{quadraticroots}
+@item @code{real[] quadraticroots(real a, real b, real c);}
+This numerically robust solver returns the real roots of the
+quadratic equation @math{ax^2+bx+c=0}, in ascending order. Multiple
+roots are listed separately;
+
+@cindex @code{quadraticroots}
+@item @code{pair[] quadraticroots(explicit pair a, explicit pair b, explicit pair c);}
+This numerically robust solver returns the complex roots of the
+quadratic equation @math{ax^2+bx+c=0};
+
+@cindex @code{cubicroots}
+@item @code{real[] cubicroots(real a, real b, real c, real d);}
+This numerically robust solver returns the real roots of the
+cubic equation @math{ax^3+bx^2+cx+d=0}. Multiple roots are listed separately.
+
+@end table
+
+@cindex vectorization
+@code{Asymptote} includes a full set of vectorized array instructions for
+arithmetic (including self) and logical operations. These
+element-by-element instructions are implemented in C++ code for speed. Given
+@verbatim
+real[] a={1,2};
+real[] b={3,2};
+@end verbatim
+@noindent
+then @code{a == b} and @code{a >= 2} both evaluate to the vector
+@code{@{false, true@}}.
+@cindex @code{all}
+To test whether all components of @code{a} and @code{b} agree,
+use the boolean function @code{all(a == b)}. One can also use conditionals like
+@code{(a >= 2) ? a : b}, which returns the array @code{@{3,2@}}, or
+@code{write((a >= 2) ? a : null}, which returns the array @code{@{2@}}.
+
+All of the standard built-in @code{libm} functions of signature
+@code{real(real)} also take a real array as an argument, effectively like an
+implicit call to @code{map}.
+
+As with other built-in types, arrays of the basic data types can be read
+in by assignment. In this example, the code
+@verbatim
+file fin=input("test.txt");
+real[] A=fin;
+@end verbatim
+
+@cindex @code{eof}
+@cindex @code{eol}
+@cindex @code{line}
+@cindex line mode
+@noindent
+reads real values into @code{A} until the end-of-file is reached (or an
+I/O error occurs).
+
+The virtual members @code{dimension}, @code{line}, @code{csv},
+@code{word}, and @code{read} of a file are useful for reading arrays.
+@cindex @code{line}
+For example, if line mode is set with @code{file line(bool b=true)}, then
+reading will stop once the end of the line is reached instead:
+@verbatim
+file fin=input("test.txt");
+real[] A=fin.line();
+@end verbatim
+
+@cindex reading string arrays
+@cindex @code{word}
+@cindex white-space string delimiter mode
+Since string reads by default read up to the end of line anyway, line mode
+normally has no effect on string array reads.
+However, there is a white-space delimiter mode for reading strings,
+@code{file word(bool b=true)}, which causes string reads to respect
+white-space delimiters, instead of the default end-of-line delimiter:
+@verbatim
+file fin=input("test.txt").line().word();
+real[] A=fin;
+@end verbatim
+
+@cindex @code{csv}
+@cindex comma-separated-value mode
+Another useful mode is comma-separated-value mode,
+@code{file csv(bool b=true)}, which causes reads to respect comma delimiters:
+@verbatim
+file fin=input("test.txt").csv();
+real[] A=fin;
+@end verbatim
+
+@cindex @code{dimension}
+To restrict the number of values read, use the @code{file dimension(int)}
+function:
+@verbatim
+file fin=input("test.txt");
+real[] A=fin.dimension(10);
+@end verbatim
+
+This reads 10 values into A, unless end-of-file (or end-of-line in line mode)
+occurs first. Attempting to read beyond the end of the file will produce a
+runtime error message. Specifying a value of 0 for the integer limit is
+equivalent to the previous example of reading until end-of-file (or
+end-of-line in line mode) is encountered.
+
+Two- and three-dimensional arrays of the basic data types can be read
+in like this:
+@verbatim
+file fin=input("test.txt");
+real[][] A=fin.dimension(2,3);
+real[][][] B=fin.dimension(2,3,4);
+@end verbatim
+@noindent
+
+@cindex @code{read}
+Sometimes the array dimensions are stored with the data as integer
+fields at the beginning of an array. Such 1, 2, or 3 dimensional
+arrays can be read in with the virtual member functions
+@code{read(1)}, @code{read(2)}, or @code{read(3)}, respectively:
+@verbatim
+file fin=input("test.txt");
+real[] A=fin.read(1);
+real[][] B=fin.read(2);
+real[][][] C=fin.read(3);
+@end verbatim
+
+@cindex @code{write}
+One, two, and three-dimensional arrays of the basic data types can be
+output with the functions @code{write(file,T[])},
+@code{write(file,T[][])}, @code{write(file,T[][][])}, respectively.
+
+@node Slices, , Arrays, Arrays
+@subsection Slices
+@cindex slices
+
+Asymptote allows a section of an array to be addressed as a slice
+using a Python-like syntax. If @code{A} is an array, the expression
+@code{A[m:n]} returns a new array consisting of the elements of @code{A} with
+indices from @code{m} up to but not including @code{n}. For example,
+@verbatim
+int[] x={0,1,2,3,4,5,6,7,8,9};
+int[] y=x[2:6]; // y={2,3,4,5};
+int[] z=x[5:10]; // z={5,6,7,8,9};
+@end verbatim
+
+If the left index is omitted, it is taken be @code{0}. If the right index is
+omitted it is taken to be the length of the array. If both are omitted, the
+slice then goes from the start of the array to the end, producing a non-cyclic
+deep copy of the array. For example:
+@verbatim
+int[] x={0,1,2,3,4,5,6,7,8,9};
+int[] y=x[:4]; // y={0,1,2,3}
+int[] z=x[5:]; // z={5,6,7,8,9}
+int[] w=x[:]; // w={0,1,2,3,4,5,6,7,8,9}, distinct from array x.
+@end verbatim
+
+If A is a non-cyclic array, it is illegal to use negative values for either of
+the indices. If the indices exceed the length of the array, however, they are
+politely truncated to that length.
+
+For cyclic arrays, the slice @code{A[m:n]} still consists of the cells with
+indices in the set [@code{m},@code{n}), but now negative
+values and values beyond the length of the array are allowed. The indices
+simply wrap around. For example:
+
+@verbatim
+int[] x={0,1,2,3,4,5,6,7,8,9};
+x.cyclic=true;
+int[] y=x[8:15]; // y={8,9,0,1,2,3,4}.
+int[] z=x[-5:5]; // z={5,6,7,8,9,0,1,2,3,4}
+int[] w=x[-3:17]; // w={7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6}
+@end verbatim
+
+Notice that with cyclic arrays, it is possible to include the same element of
+the original array multiple times within a slice. Regardless of the original
+array, arrays produced by slices are always non-cyclic.
+
+If the left and right indices of a slice are the same, the result is an empty
+array. If the array being sliced is empty, the result is an empty array. Any
+slice with a left index greater than its right index will yield an error.
+
+Slices can also be assigned to, changing the value of the original array. If
+the array being assigned to the slice has a different length than the
+slice itself, elements will be inserted or removed from the array to
+accommodate it. For instance:
+@verbatim
+string[] toppings={"mayo", "salt", "ham", "lettuce"};
+toppings[0:2]=new string[] {"mustard", "pepper"};
+ // Now toppings={"mustard", "pepper", "ham", "lettuce"}
+toppings[2:3]=new string[] {"turkey", "bacon" };
+ // Now toppings={"mustard", "pepper", "turkey", "bacon", "lettuce"}
+toppings[0:3]=new string[] {"tomato"};
+ // Now toppings={"tomato", "bacon", "lettuce"}
+@end verbatim
+
+If an array is assigned to a slice of itself, a copy of the original array
+is assigned to the slice. That is, code such as @code{x[m:n]=x} is equivalent
+to @code{x[m:n]=copy(x)}. One can use the shorthand @code{x[m:m]=y} to insert
+the contents of the array @code{y} into the array @code{x} starting at the
+location just before @code{x[m]}.
+
+For a cyclic array, a slice is bridging if it addresses cells up to the end of
+the array and then continues on to address cells at the start of the array.
+For instance, if @code{A} is a cyclic array of length 10, @code{A[8:12]},
+@code{A[-3:1]}, and @code{A[5:25]} are bridging slices whereas @code{A[3:7]},
+@code{A[7:10]}, @code{A[-3:0]} and @code{A[103:107]} are not. Bridging slices
+can only be assigned to if the number of elements in the slice is exactly equal
+to the number of elements we are assigning to it. Otherwise, there is no clear
+way to decide which of the new entries should be @code{A[0]} and an error is
+reported. Non-bridging slices may be assigned an array of any length.
+
+For a cyclic array @code{A} an expression of the form
+@code{A[A.length:A.length]} is equivalent to the expression @code{A[0:0]} and
+so assigning to this slice will insert values at the start of the array.
+@code{A.append()} can be used to insert values at the end of the array.
+
+It is illegal to assign to a slice of a cyclic array that repeats any of the
+cells.
+
+@node Casts, Import, Arrays, Programming
+@section Casts
+@cindex casts
+@cindex implicit casts
+@cindex @code{explicit}
+
+@code{Asymptote} implicitly casts @code{int} to @code{real}, @code{int} to
+@code{pair}, @code{real} to @code{pair}, @code{pair} to @code{path},
+@code{pair} to @code{guide}, @code{path} to @code{guide}, @code{guide}
+to @code{path}, @code{real} to @code{pen},
+@code{pair[]} to @code{guide[]}, @code{pair[]} to @code{path[]},
+@code{path} to @code{path[]}, and @code{guide} to @code{path[]},
+along with various three-dimensional casts defined in module @code{three}.
+Implicit casts are automatically attempted on assignment and when
+trying to match function calls with possible function
+signatures. Implicit casting can be inhibited by declaring individual
+arguments @code{explicit} in the function signature, say to avoid an
+ambiguous function call in the following example, which outputs 0:
+@verbatim
+int f(pair a) {return 0;}
+int f(explicit real x) {return 1;}
+
+write(f(0));
+@end verbatim
+
+@cindex explicit casts
+Other conversions, say @code{real} to @code{int} or
+@code{real} to @code{string}, require an explicit cast:
+@verbatim
+int i=(int) 2.5;
+string s=(string) 2.5;
+
+real[] a={2.5,-3.5};
+int[] b=(int []) a;
+write(stdout,b); // Outputs 2,-3
+@end verbatim
+In situations where casting from a string to a type @code{T} fails,
+an uninitialized variable is returned; this condition can be detected
+with the function @code{bool initialized(T);}
+@verbatim
+int i=(int) "2.5";
+assert(initialized(i),"Invalid cast.");
+
+real x=(real) "2.5a";
+assert(initialized(x),"Invalid cast.");
+@end verbatim
+
+@cindex @code{operator cast}
+Casting to user-defined types is also possible using @code{operator cast}:
+@verbatim
+struct rpair {
+ real radius;
+ real angle;
+}
+
+pair operator cast(rpair x) {
+ return (x.radius*cos(x.angle),x.radius*sin(x.angle));
+}
+
+rpair x;
+x.radius=1;
+x.angle=pi/6;
+
+write(x); // Outputs (0.866025403784439,0.5)
+@end verbatim
+
+One must use care when defining new cast operators. Suppose that in some
+code one wants all integers to represent multiples of 100. To convert them
+to reals, one would first want to multiply them by 100. However, the
+straightforward implementation
+@verbatim
+real operator cast(int x) {return x*100;}
+@end verbatim
+@noindent
+is equivalent to an infinite recursion, since the result @code{x*100}
+needs itself to be cast from an integer to a real. Instead, we want to
+use the standard conversion of int to real:
+@verbatim
+real convert(int x) {return x*100;}
+real operator cast(int x)=convert;
+@end verbatim
+
+@cindex @code{operator ecast}
+Explicit casts are implemented similarly, with @code{operator ecast}.
+
+@node Import, Static, Casts, Programming
+@section Import
+@cindex @code{access}
+While @code{Asymptote} provides many features by default,
+some applications require specialized features contained in
+external @code{Asymptote} modules. For instance, the lines
+@verbatim
+access graph;
+graph.axes();
+@end verbatim
+@noindent
+draw @math{x} and @math{y} axes on a two-dimensional graph. Here, the
+command looks up the module under the name @code{graph} in a global dictionary
+of modules and puts it in a new variable named @code{graph}.
+The module is a structure, and we can refer to its fields as we usually
+would with a structure.
+
+@cindex @code{from}
+Often, one wants to use module functions without having to specify
+the module name. The code
+@verbatim
+from graph access axes;
+@end verbatim
+@noindent
+adds the @code{axes} field of @code{graph} into the local name space,
+so that subsequently, one can just write @code{axes()}. If the given name
+is overloaded, all types and variables of that name are added. To add
+more than one name, just use a comma-separated list:
+@verbatim
+from graph access axes, xaxis, yaxis;
+@end verbatim
+@noindent
+Wild card notation can be used to add all non-private fields and types of a
+module to the local name space:
+
+@verbatim
+from graph access *;
+@end verbatim
+
+@cindex @code{unravel}
+Similarly, one can add the non-private fields and types of a structure
+to the local environment with the @code{unravel} keyword:
+@verbatim
+struct matrix {
+ real a,b,c,d;
+}
+
+real det(matrix m) {
+ unravel m;
+ return a*d-b*c;
+}
+@end verbatim
+Alternatively, one can unravel selective fields:
+@verbatim
+real det(matrix m) {
+ from m unravel a,b,c as C,d;
+ return a*d-b*C;
+}
+@end verbatim
+
+@cindex @code{import}
+@cindex @code{access}
+The command
+@verbatim
+import graph;
+@end verbatim
+is a convenient abbreviation for the commands
+@verbatim
+access graph;
+unravel graph;
+@end verbatim
+That is, @code{import graph} first loads a module into a structure called
+@code{graph} and then adds its non-private fields and types to the
+local environment. This way, if a member variable (or function) is
+overwritten with a local variable (or function of the same signature),
+the original one can still be accessed by qualifying it with the
+module name.
+
+Wild card importing will work fine in most cases, but one does not usually know
+all of the internal types and variables of a module, which can also
+change as the module writer adds or changes features of the module.
+As such, it is prudent to add @code{import} commands at the start of an
+@code{Asymptote} file, so that imported names won't shadow locally
+defined functions. Still, imported names may shadow other imported
+names, depending on the order in which they were imported, and
+imported functions may cause overloading resolution problems if they
+have the same name as local functions defined later.
+
+@cindex @code{as}
+To rename modules or fields when adding them to the local environment, use
+@code{as}:
+@verbatim
+access graph as graph2d;
+from graph access xaxis as xline, yaxis as yline;
+@end verbatim
+
+The command
+@verbatim
+import graph as graph2d;
+@end verbatim
+is a convenient abbreviation for the commands
+@verbatim
+access graph as graph2d;
+unravel graph2d;
+@end verbatim
+
+Except for a few built-in modules, such as @code{settings}, all modules
+are implemented as @code{Asymptote} files. When looking up a module
+that has not yet been loaded, @code{Asymptote} searches the standard
+search paths (@pxref{Search paths}) for the matching file. The file
+corresponding to that name is read and the code within it is interpreted
+as the body of a structure defining the module.
+
+If the file name contains
+nonalphanumeric characters, enclose it with quotation marks:
+
+@noindent
+@code{access "@value{Datadir}/asymptote/graph.asy" as graph;}
+
+@noindent
+@code{from "@value{Datadir}/asymptote/graph.asy" access axes;}
+
+@noindent
+@code{import "@value{Datadir}/asymptote/graph.asy" as graph;}
+
+@cindex @acronym{URL}
+@cindex @acronym{libcurl}
+If @code{Asymptote} is compiled with support for @code{libcurl},
+the file name can even be a @acronym{URL}:
+@noindent
+@code{import "https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/doc/axis3.asy" as axis3;}
+
+It is an error if modules import themselves (or each other in a cycle).
+The module name to be imported must be known at compile time.
+
+@cindex runtime imports
+@cindex @code{eval}
+However, you can import an @code{Asymptote} module determined by the
+string @code{s} at runtime like this:
+@verbatim
+eval("import "+s,true);
+@end verbatim
+
+@cindex @code{asy}
+To conditionally execute an array of asy files, use
+@verbatim
+void asy(string format, bool overwrite ... string[] s);
+@end verbatim
+The file will only be processed, using output format @code{format}, if
+overwrite is @code{true} or the output file is missing.
+
+One can evaluate an @code{Asymptote} expression (without any return
+value, however) contained in the string @code{s} with:
+@cindex @code{eval}
+@verbatim
+void eval(string s, bool embedded=false);
+@end verbatim
+It is not necessary to terminate the string @code{s} with a semicolon.
+If @code{embedded} is @code{true}, the string will be evaluated
+at the top level of the current environment.
+If @code{embedded} is @code{false} (the default), the string
+will be evaluated in an independent environment, sharing the same
+@code{settings} module (@pxref{settings}).
+
+@cindex @code{quote}
+One can evaluate arbitrary @code{Asymptote} code (which may
+contain unescaped quotation marks) with the command
+@verbatim
+void eval(code s, bool embedded=false);
+@end verbatim
+Here @code{code} is a special type used with @code{quote @{@}}
+to enclose @code{Asymptote code} like this:
+@verbatim
+real a=1;
+code s=quote {
+ write(a);
+};
+eval(s,true); // Outputs 1
+@end verbatim
+
+One application of @code{eval} is the creation of parametrized Asymptote
+code, such as a map from one type to another (@pxref{map}).
+
+@cindex @code{include}
+To include the contents of an existing file @code{graph} verbatim (as if the
+contents of the file were inserted at that point), use one of the forms:
+@verbatim
+include graph;
+@end verbatim
+
+@noindent
+@code{include "@value{Datadir}/asymptote/graph.asy";}
+
+To list all global functions and variables defined in a module named
+by the contents of the string @code{s}, use the function
+@verbatim
+void list(string s, bool imports=false);
+@end verbatim
+@noindent
+Imported global functions and variables are also listed if
+@code{imports} is @code{true}.
+
+@node Static, , Import, Programming
+@section Static
+@cindex @code{static}
+
+Static qualifiers allocate the memory address of a variable in a higher
+enclosing level.
+
+For a function body, the variable is allocated in the block where the
+function is defined; so in the code
+@verbatim
+struct s {
+ int count() {
+ static int c=0;
+ ++c;
+ return c;
+ }
+}
+@end verbatim
+
+@noindent
+there is one instance of the variable @code{c} for each
+object @code{s} (as opposed to each call of @code{count}).
+
+Similarly, in
+@verbatim
+int factorial(int n) {
+ int helper(int k) {
+ static int x=1;
+ x *= k;
+ return k == 1 ? x : helper(k-1);
+ }
+ return helper(n);
+}
+@end verbatim
+
+@noindent
+there is one instance of @code{x} for every call to
+@code{factorial} (and not for every call to @code{helper}), so this is
+a correct, but ugly, implementation of factorial.
+
+Similarly, a static variable declared within a structure is allocated in
+the block where the structure is defined. Thus,
+@verbatim
+struct A {
+ struct B {
+ static pair z;
+ }
+}
+@end verbatim
+
+@noindent
+creates one object @code{z} for each object of type @code{A} created.
+
+In this example,
+@verbatim
+int pow(int n, int k) {
+ struct A {
+ static int x=1;
+ void helper() {
+ x *= n;
+ }
+ }
+ for(int i=0; i < k; ++i) {
+ A a;
+ a.helper();
+ }
+ return A.x;
+}
+@end verbatim
+
+@noindent
+there is one instance of @code{x} for each call to @code{pow}, so this
+is an ugly implementation of exponentiation.
+
+Loop constructs allocate a new frame in every iteration. This is so that
+higher-order functions can refer to variables of a specific iteration of a
+loop:
+@verbatim
+void f();
+for(int i=0; i < 10; ++i) {
+ int x=i;
+ if(x==5) {
+ f=new void() {write(x);};
+ }
+}
+f();
+@end verbatim
+
+Here, every iteration of the loop has its own variable @code{x}, so @code{f()}
+will write @code{5}. If a variable in a loop is declared static, it will be
+allocated where the enclosing function or structure was defined (just as if it
+were declared static outside of the loop). For instance, in:
+@verbatim
+void f() {
+ static int x;
+ for(int i=0; i < 10; ++i) {
+ static int y;
+ }
+}
+@end verbatim
+@noindent
+both @code{x} and @code{y} will be allocated in the same place, which is
+also where @code{f} is allocated.
+
+Statements may also be declared static, in which case they are run at the place
+where the enclosing function or structure is defined.
+Declarations or statements not enclosed in a function or structure definition
+are already at the top level, so static modifiers are meaningless. A warning is
+given in such a case.
+
+Since structures can have static fields, it is not always clear for a qualified
+name whether the qualifier is a variable or a type. For instance, in:
+
+@verbatim
+struct A {
+ static int x;
+}
+pair A;
+
+int y=A.x;
+@end verbatim
+@noindent
+does the @code{A} in @code{A.x} refer to the structure or to the pair variable.
+It is the convention in Asymptote that, if there is a non-function variable with
+the same name as the qualifier, the qualifier refers to that variable, and not
+to the type. This is regardless of what fields the variable actually possesses.
+
+@node LaTeX usage, Base modules, Programming, Top
+@chapter @code{LaTeX} usage
+@cindex @code{LaTeX} usage
+@cindex @code{asymptote.sty}
+
+@code{Asymptote} comes with a convenient @code{LaTeX} style file
+@code{asymptote.sty} (v1.36 or later required) that makes @code{LaTeX}
+@code{Asymptote}-aware. Entering @code{Asymptote} code
+directly into the @code{LaTeX} source file, at the point where it is
+needed, keeps figures organized and avoids the need to invent new file
+names for each figure. Simply add the line
+@code{\usepackage@{asymptote@}} at the beginning of your file
+and enclose your @code{Asymptote} code within a
+@code{\begin@{asy@}...\end@{asy@}} environment. As with the
+@code{LaTeX} @code{comment} environment, the @code{\end@{asy@}} command
+must appear on a line by itself, with no trailing commands/comments.
+A blank line is not allowed after @code{\begin@{asy@}}.
+
+The sample @code{LaTeX} file below, named @code{latexusage.tex}, can
+be run as follows:
+@verbatim
+latex latexusage
+asy latexusage-*.asy
+latex latexusage
+@end verbatim
+
+@noindent
+or
+@verbatim
+pdflatex latexusage
+asy latexusage-*.asy
+pdflatex latexusage
+@end verbatim
+@noindent
+To switch between using inline Asymptote code with @code{latex} and
+@code{pdflatex} you may first need to remove the files @code{latexusage-*.tex}.
+
+@cindex @code{latexmk}
+@cindex @code{perl}
+An even better method for processing a @code{LaTeX} file with embedded
+@code{Asymptote} code is to use the @code{latexmk} utility from
+@quotation
+@url{http://mirror.ctan.org/support/latexmk/}
+@end quotation
+@noindent
+after putting the contents of
+@url{https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/doc/latexmkrc}
+@noindent
+in a file @code{latexmkrc} in the same directory. The command
+@verbatim
+latexmk -pdf latexusage
+@end verbatim
+@noindent
+will then call @code{Asymptote} automatically, recompiling only the figures
+that have changed. Since each figure is compiled in a separate
+system process, this method also tends to use less memory.
+To store the figures in a separate directory named @code{asy}, one can define
+@verbatim
+\def\asydir{asy}
+@end verbatim
+in @code{latexusage.tex} and put the contents of
+@url{https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/doc/latexmkrc_asydir}
+in a file @code{latexmkrc} in the same directory.
+@noindent
+External @code{Asymptote} code can be included with
+@cindex @code{asyinclude}
+@verbatim
+\asyinclude[<options>]{<filename.asy>}
+@end verbatim
+@noindent
+so that @code{latexmk} will recognize when the code is changed. Note that
+@code{latemk} requires @code{perl}, available from @url{https://www.perl.org/}.
+
+@cindex @code{width}
+@cindex @code{height}
+@cindex @code{keepAspect}
+@cindex @code{viewportwidth}
+@cindex @code{viewportheight}
+@cindex @code{attach}
+@cindex @code{inline}
+One can specify @code{width}, @code{height}, @code{keepAspect},
+@code{viewportwidth}, @code{viewportheight}, @code{attach}, and @code{inline}.
+@code{keyval}-style options to the @code{asy} and @code{asyinclude}
+environments.
+Three-dimensional @acronym{PRC} files may either be embedded within
+the page (the default) or attached as annotated (but printable)
+attachments, using the @code{attach} option and the @code{attachfile2}
+(or older @code{attachfile}) @code{LaTeX} package.
+The @code{inline} option generates
+inline @code{LaTeX} code instead of @acronym{EPS} or @acronym{PDF}
+files. This makes 2D LaTeX symbols visible to the
+@code{\begin@{asy@}...\end@{asy@}} environment. In this mode,
+Asymptote correctly aligns 2D LaTeX symbols defined outside of
+@code{\begin@{asy@}...\end@{asy@}}, but treats their size as zero; an
+optional second string can be given to @code{Label} to provide an
+estimate of the unknown label size.
+
+Note that if the @code{latex} @TeX{} engine is used with the
+@code{inline} option, labels might not show up in @acronym{DVI}
+viewers that cannot handle raw @code{PostScript} code. One can use
+@code{dvips}/@code{dvipdf} to produce @code{PostScript}/@acronym{PDF}
+output (we recommend using the modified version of @code{dvipdf} in
+the @code{Asymptote} patches directory, which accepts the @code{dvips -z}
+hyperdvi option).
+
+Here now is @code{latexusage.tex}:
+@verbatiminclude latexusage.tex
+@page
+@image{./latexusage,,25cm}
+
+@node Base modules, Options, LaTeX usage, Top
+@chapter Base modules
+@cindex base modules
+
+@code{Asymptote} currently ships with the following base modules:
+
+@menu
+* plain:: Default @code{Asymptote} base file
+* simplex:: Linear programming: simplex method
+* math:: Extend @code{Asymptote}'s math capabilities
+* interpolate:: Interpolation routines
+* geometry:: Geometry routines
+* trembling:: Wavy lines
+* stats:: Statistics routines and histograms
+* patterns:: Custom fill and draw patterns
+* markers:: Custom path marker routines
+* map:: Map keys to values
+* tree:: Dynamic binary search tree
+* binarytree:: Binary tree drawing module
+* drawtree:: Tree drawing module
+* syzygy:: Syzygy and braid drawing module
+* feynman:: Feynman diagrams
+* roundedpath:: Round the sharp corners of paths
+* animation:: Embedded @acronym{PDF} and @acronym{MPEG} movies
+* embed:: Embedding movies, sounds, and 3D objects
+* slide:: Making presentations with @code{Asymptote}
+* MetaPost:: @code{MetaPost} compatibility routines
+* babel:: Interface to @code{LaTeX} @code{babel} package
+* labelpath:: Drawing curved labels
+* labelpath3:: Drawing curved labels in 3D
+* annotate:: Annotate your @acronym{PDF} files
+* CAD:: 2D CAD pen and measurement functions (DIN 15)
+* graph:: 2D linear & logarithmic graphs
+* palette:: Color density images and palettes
+* three:: 3D vector graphics
+* obj:: 3D obj files
+* graph3:: 3D linear & logarithmic graphs
+* grid3:: 3D grids
+* solids:: 3D solid geometry
+* tube:: 3D rotation minimizing tubes
+* flowchart:: Flowchart drawing routines
+* contour:: Contour lines
+* contour3:: Contour surfaces
+* smoothcontour3:: Smooth implicit surfaces
+* slopefield:: Slope fields
+* ode:: Ordinary differential equations
+@end menu
+
+@node plain, simplex, Base modules, Base modules
+@section @code{plain}
+@cindex @code{plain}
+
+This is the default @code{Asymptote} base file, which defines key parts of the
+drawing language (such as the @code{picture} structure).
+
+By default, an implicit @code{private import plain;} occurs before
+translating a file and before the first command given in interactive
+mode. This also applies when translating files for module definitions
+(except when translating @code{plain}, of course). This means that
+the types and functions defined in @code{plain} are accessible in
+almost all @code{Asymptote} code. Use the @code{-noautoplain} command-line
+option to disable this feature.
+
+@node simplex, math, plain, Base modules
+@section @code{simplex}
+@cindex @code{simplex}
+@cindex @code{deferred drawing}
+This module solves the two-variable linear programming problem using the
+simplex method. It is used by the module @code{plain} for automatic
+sizing of pictures.
+
+@node math, interpolate, simplex, Base modules
+@section @code{math}
+@cindex @code{math}
+This module extends @code{Asymptote}'s mathematical capabilities with
+useful functions such as
+
+@table @code
+
+@cindex @code{drawline}
+@item void drawline(picture pic=currentpicture, pair P, pair Q, pen p=currentpen);
+draw the visible portion of the (infinite) line going through
+@code{P} and @code{Q}, without altering the size of picture @code{pic},
+using pen @code{p}.
+
+@cindex @code{intersect}
+@item real intersect(triple P, triple Q, triple n, triple Z);
+returns the intersection time of the extension of the line segment @code{PQ}
+with the plane perpendicular to @code{n} and passing through @code{Z}.
+
+@cindex @code{intersectionpoint}
+@item triple intersectionpoint(triple n0, triple P0, triple n1, triple P1);
+Return any point on the intersection of the two planes with normals
+@code{n0} and @code{n1} passing through points @code{P0} and @code{P1},
+respectively. If the planes are parallel, return
+@code{(infinity,infinity,infinity)}.
+
+@cindex @code{quarticroots}
+@item pair[] quarticroots(real a, real b, real c, real d, real e);
+returns the four complex roots of the quartic equation
+@math{ax^4+bx^3+cx^2+dx+e=0}.
+
+@cindex @code{time}
+@item real time(path g, real x, int n=0)
+returns the @code{n}th intersection time of path @code{g} with the vertical
+line through x.
+
+@cindex @code{time}
+@item real time(path g, explicit pair z, int n=0)
+returns the @code{n}th intersection time of path @code{g} with the horizontal
+line through @code{(0,z.y)}.
+
+@cindex @code{value}
+@item real value(path g, real x, int n=0)
+returns the @code{n}th @code{y} value of @code{g} at @code{x}.
+
+@cindex @code{value}
+@item real value(path g, explicit pair z, int n=0)
+returns the @code{n}th @code{x} value of @code{g} at @code{y=z.y}.
+
+@cindex @code{slope}
+@item real slope(path g, real x, int n=0)
+returns the @code{n}th slope of @code{g} at @code{x}.
+
+@cindex @code{slope}
+@item real slope(path g, explicit pair z, int n=0)
+returns the @code{n}th slope of @code{g} at @code{y=z.y}.
+
+@cindex @code{segment}
+int[][] segment(bool[] b)
+returns the indices of consecutive true-element segments of bool[] @code{b}.
+
+@cindex @code{partialsum}
+@item real[] partialsum(real[] a)
+returns the partial sums of a real array @code{a}.
+
+@cindex @code{partialsum}
+@item real[] partialsum(real[] a, real[] dx)
+returns the partial @code{dx}-weighted sums of a real array @code{a}.
+
+@cindex @code{increasing}
+@item bool increasing(real[] a, bool strict=false)
+returns, if @code{strict=false}, whether @code{i > j} implies
+@code{a[i] >= a[j]}, or if @code{strict=true}, whether @code{i > j} implies
+implies @code{a[i] > a[j]}.
+
+@cindex @code{unique}
+@item int unique(real[] a, real x)
+if the sorted array @code{a} does not contain @code{x}, insert it
+sequentially, returning the index of @code{x} in the resulting array.
+
+@cindex @code{lexorder}
+@item bool lexorder(pair a, pair b)
+returns the strict lexicographical partial order of @code{a} and @code{b}.
+
+@cindex @code{lexorder}
+@item bool lexorder(triple a, triple b)
+returns the strict lexicographical partial order of @code{a} and @code{b}.
+@end table
+
+@node interpolate, geometry, math, Base modules
+@section @code{interpolate}
+@cindex @code{interpolate}
+This module implements Lagrange, Hermite, and standard cubic spline
+interpolation in @code{Asymptote}, as illustrated in the example
+@code{interpolate1.asy}.
+
+@node geometry, trembling, interpolate, Base modules
+@section @code{geometry}
+@cindex @code{geometry}
+@cindex @code{triangle}
+@cindex @code{perpendicular}
+This module, written by Philippe Ivaldi, provides an extensive set of
+geometry routines, including @code{perpendicular} symbols and a @code{triangle}
+structure. Link to the documentation for the @code{geometry} module
+are posted here:
+@url{https://asymptote.sourceforge.io/links.html},
+including an extensive set of examples,
+@url{http://www.piprime.fr/files/asymptote/geometry/}, and an index:
+@quotation
+@url{http://www.piprime.fr/files/asymptote/geometry/modules/geometry.asy.index.type.html}
+@end quotation
+
+@node trembling, stats, geometry, Base modules
+@section @code{trembling}
+@cindex @code{trembling}
+This module, written by Philippe Ivaldi and illustrated in the example
+@code{@uref{https://asymptote.sourceforge.io/gallery/floatingdisk.svg,,floatingdisk}@uref{https://asymptote.sourceforge.io/gallery/floatingdisk.asy,,.asy}}, allows one to draw wavy lines, as if drawn by
+hand.
+
+@node stats, patterns, trembling, Base modules
+@section @code{stats}
+@cindex @code{stats}
+@cindex @code{leastsquares}
+This module implements a Gaussian random number generator
+and a collection of statistics routines, including @code{histogram}
+and @code{leastsquares}.
+
+@node patterns, markers, stats, Base modules
+@section @code{patterns}
+@cindex @code{patterns}
+This module implements @code{PostScript} tiling patterns and includes
+several convenient pattern generation routines.
+
+@node markers, tree, patterns, Base modules
+@section @code{markers}
+@cindex @code{markers}
+This module implements specialized routines for marking paths and angles.
+The principal mark routine provided by this module is
+@verbatim
+markroutine markinterval(int n=1, frame f, bool rotated=false);
+@end verbatim
+@noindent
+which centers @code{n} copies of frame @code{f} within uniformly space
+intervals in arclength along the path, optionally rotated by the angle of the
+local tangent.
+
+The @code{marker} (@pxref{marker}) routine can be used to construct new
+markers from these predefined frames:
+
+@cindex @code{stickframe}
+@verbatim
+frame stickframe(int n=1, real size=0, pair space=0, real angle=0,
+ pair offset=0, pen p=currentpen);
+@end verbatim
+@cindex @code{circlebarframe}
+@verbatim
+frame circlebarframe(int n=1, real barsize=0,
+ real radius=0,real angle=0,
+ pair offset=0, pen p=currentpen,
+ filltype filltype=NoFill, bool above=false);
+@end verbatim
+@cindex @code{crossframe}
+@verbatim
+frame crossframe(int n=3, real size=0, pair space=0,
+ real angle=0, pair offset=0, pen p=currentpen);
+@end verbatim
+@cindex @code{tildeframe}
+@verbatim
+frame tildeframe(int n=1, real size=0, pair space=0,
+ real angle=0, pair offset=0, pen p=currentpen);
+@end verbatim
+
+For convenience, this module also constructs the markers
+@code{StickIntervalMarker}, @code{CrossIntervalMarker},
+@code{CircleBarIntervalMarker}, and @code{TildeIntervalMarker}
+from the above frames. The example @code{@uref{https://asymptote.sourceforge.io/gallery/markers1.svg,,markers1}@uref{https://asymptote.sourceforge.io/gallery/markers1.asy,,.asy}} illustrates the
+use of these markers:
+
+@sp 1
+@center @image{./markers1}
+
+This module also provides a routine for marking an angle @math{AOB}:
+@cindex @code{markangle}
+@verbatim
+void markangle(picture pic=currentpicture, Label L="",
+ int n=1, real radius=0, real space=0,
+ pair A, pair O, pair B, arrowbar arrow=None,
+ pen p=currentpen, margin margin=NoMargin,
+ marker marker=nomarker);
+@end verbatim
+@noindent
+as illustrated in the example @code{@uref{https://asymptote.sourceforge.io/gallery/markers2.svg,,markers2}@uref{https://asymptote.sourceforge.io/gallery/markers2.asy,,.asy}}.
+
+@sp 1
+@center @image{./markers2}
+
+@node map, tree, markers, Base modules
+@section @code{map}
+@cindex @code{map}
+This module creates a struct parameterized by the types specified in
+strings @code{key} and @code{value}, mapping keys to values with a
+specified default:
+@verbatim
+import map;
+
+mapTemplate(name="map",key="string",value="int",default="-1");
+
+map M;
+
+M.add("z",2);
+M.add("a",3);
+M.add("d",4);
+write(M.lookup("a"));
+write(M.lookup("y"));
+@end verbatim
+
+@node tree, binarytree, markers, Base modules
+@section @code{tree}
+@cindex @code{tree}
+This module implements an example of a dynamic binary search tree.
+
+@node binarytree, drawtree, tree, Base modules
+@section @code{binarytree}
+@cindex @code{binarytree}
+This module can be used to draw an arbitrary binary tree and includes an
+input routine for the special case of a binary search tree, as
+illustrated in the example @code{@uref{https://asymptote.sourceforge.io/gallery/binarytreetest.svg,,binarytreetest}@uref{https://asymptote.sourceforge.io/gallery/binarytreetest.asy,,.asy}}:
+@verbatiminclude binarytreetest.asy
+@sp 1
+@center @image{./binarytreetest}
+
+@node drawtree, syzygy, binarytree, Base modules
+@section @code{drawtree}
+@cindex @code{drawtree}
+This is a simple tree drawing module used by the example @code{@uref{https://asymptote.sourceforge.io/gallery/treetest.svg,,treetest}@uref{https://asymptote.sourceforge.io/gallery/treetest.asy,,.asy}}.
+
+@node syzygy, feynman, drawtree, Base modules
+@section @code{syzygy}
+@cindex @code{syzygy}
+This module automates the drawing of braids, relations, and syzygies,
+along with the corresponding equations, as illustrated in the example
+@code{@uref{https://asymptote.sourceforge.io/gallery/knots.svg,,knots}@uref{https://asymptote.sourceforge.io/gallery/knots.asy,,.asy}}.
+
+@node feynman, roundedpath, syzygy, Base modules
+@section @code{feynman}
+@cindex @code{feynman}
+This module, contributed by Martin Wiebusch, is useful for drawing
+Feynman diagrams, as illustrated by the examples @code{@uref{https://asymptote.sourceforge.io/gallery/eetomumu.svg,,eetomumu}@uref{https://asymptote.sourceforge.io/gallery/eetomumu.asy,,.asy}}
+and @code{@uref{https://asymptote.sourceforge.io/gallery/fermi.svg,,fermi}@uref{https://asymptote.sourceforge.io/gallery/fermi.asy,,.asy}}.
+
+@node roundedpath, animation, feynman, Base modules
+@section @code{roundedpath}
+@cindex @code{roundedpath}
+This module, contributed by Stefan Knorr, is useful for rounding the
+sharp corners of paths, as illustrated in the example file @code{@uref{https://asymptote.sourceforge.io/gallery/roundpath.svg,,roundpath}@uref{https://asymptote.sourceforge.io/gallery/roundpath.asy,,.asy}}.
+
+@node animation, embed, roundedpath, Base modules
+@section @code{animation}
+@cindex @code{animation}
+@cindex @code{convert}
+@cindex animation
+@cindex @code{ImageMagick}
+This module allows one to generate animations, as illustrated by the
+files @code{@uref{https://asymptote.sourceforge.io/gallery/animations/wheel.gif,,wheel}@uref{https://asymptote.sourceforge.io/gallery/animations/wheel.asy,,.asy}}, @code{@uref{https://asymptote.sourceforge.io/gallery/animations/wavepacket.gif,,wavepacket}@uref{https://asymptote.sourceforge.io/gallery/animations/wavepacket.asy,,.asy}}, and @code{@uref{https://asymptote.sourceforge.io/gallery/animations/cube.gif,,cube}@uref{https://asymptote.sourceforge.io/gallery/animations/cube.asy,,.asy}} in
+the @code{animations} subdirectory of the examples directory. These
+animations use the @code{ImageMagick} @code{convert} program to
+merge multiple images into a @acronym{GIF} or @acronym{MPEG}
+movie.
+
+@cindex @code{animate}
+@anchor{animate}
+The related @code{animate} module, derived from the @code{animation}
+module, generates higher-quality portable clickable @acronym{PDF} movies, with
+optional controls. This requires installing the module
+@quotation
+@url{http://mirror.ctan.org/macros/latex/contrib/animate/animate.sty}
+@noindent
+@end quotation
+@noindent
+(version 2007/11/30 or later) in a new directory @code{animate} in the
+local @code{LaTeX} directory (for example, in
+@code{/usr/local/share/texmf/tex/latex/animate}). On @code{UNIX} systems,
+one must then execute the command @code{texhash}.
+
+The example @code{@uref{https://asymptote.sourceforge.io/gallery/animations/pdfmovie.pdf,,pdfmovie}@uref{https://asymptote.sourceforge.io/gallery/animations/pdfmovie.asy,,.asy}} in the @code{animations}
+directory, along with the slide presentations @code{@uref{https://asymptote.sourceforge.io/gallery/animations/slidemovies.pdf,,slidemovies}@uref{https://asymptote.sourceforge.io/gallery/animations/slidemovies.asy,,.asy}}
+and @code{@uref{https://asymptote.sourceforge.io/intro.pdf,,intro}}, illustrate the use of embedded @acronym{PDF} movies.
+The examples @code{inlinemovie.tex} and @code{inlinemovie3.tex}
+show how to generate and embed @acronym{PDF} movies directly within a
+@code{LaTeX} file (@pxref{LaTeX usage}).
+The member function
+@verbatim
+string pdf(fit fit=NoBox, real delay=animationdelay, string options="",
+ bool keep=settings.keep, bool multipage=true);
+@end verbatim
+@noindent
+of the @code{animate} structure accepts any of the @code{animate.sty} options,
+as described here:
+@quotation
+@url{http://mirror.ctan.org/macros/latex/contrib/animate/doc/animate.pdf}
+@end quotation
+
+@node embed, slide, animation, Base modules
+@section @code{embed}
+@cindex @code{embed}
+This module provides an interface to the @code{LaTeX} package
+(included with @code{MikTeX})
+@quotation
+@url{http://mirror.ctan.org/macros/latex/contrib/media9}
+@end quotation
+@noindent
+for embedding movies, sounds, and 3D objects into a @acronym{PDF} document.
+
+@cindex @code{external}
+A more portable method for embedding movie files, which should work on any
+platform and does not require the @code{media9} package, is provided
+by using the @code{external} module instead of @code{embed}.
+
+Examples of the above two interfaces is provided in the file
+@code{embeddedmovie.asy} in the @code{animations} subdirectory of the
+examples directory and in
+@code{@uref{https://asymptote.sourceforge.io/gallery/animations/externalmovie.pdf,,externalmovie}@uref{https://asymptote.sourceforge.io/gallery/animations/externalmovie.asy,,.asy}}.
+For a higher quality embedded movie generated directly by
+@code{Asymptote}, use the @code{animate} module along with the
+@code{animate.sty} package to embed a portable @acronym{PDF} animation
+(@pxref{animate}).
+
+@cindex @code{U3D}
+An example of embedding @code{U3D} code is provided in the file
+@code{embeddedu3d}.
+
+@node slide, MetaPost, embed, Base modules
+@section @code{slide}
+@cindex @code{slide}
+This module provides a simple yet high-quality facility for making
+presentation slides, including portable embedded @acronym{PDF} animations (see
+the file @code{@uref{https://asymptote.sourceforge.io/gallery/animations/slidemovies.pdf,,slidemovies}@uref{https://asymptote.sourceforge.io/gallery/animations/slidemovies.asy,,.asy}}). A simple example is provided in
+@code{slidedemo.asy}.
+
+@node MetaPost, babel, slide, Base modules
+@section @code{MetaPost}
+@cindex @code{MetaPost}
+This module provides some useful routines to help @code{MetaPost} users
+migrate old @code{MetaPost} code to @code{Asymptote}. Further
+contributions here are welcome.
+
+@cindex @code{implicit linear solver}
+@cindex @code{MetaPost whatever}
+@cindex @code{extension}
+Unlike @code{MetaPost}, @code{Asymptote} does not implicitly solve
+linear equations and therefore does not have the notion of a
+@code{whatever} unknown. The routine @code{extension} (@pxref{extension})
+provides a useful replacement for a common use of @code{whatever}: finding the
+intersection point of the lines through @code{P}, @code{Q} and
+@code{p}, @code{q}. For less common occurrences of @code{whatever}, one
+can use the built-in explicit linear equation solver @code{solve} instead.
+
+@node babel, labelpath, MetaPost, Base modules
+@section @code{babel}
+@cindex @code{babel}
+This module implements the @code{LaTeX} @code{babel} package in
+@code{Asymptote}. For example:
+@verbatim
+import babel;
+babel("german");
+@end verbatim
+
+@node labelpath, labelpath3, babel, Base modules
+@section @code{labelpath}
+@cindex @code{labelpath}
+This module uses the @code{PSTricks} @code{pstextpath} macro to fit labels
+along a path (properly kerned, as illustrated in the example file
+@code{@uref{https://asymptote.sourceforge.io/gallery/curvedlabel.svg,,curvedlabel}@uref{https://asymptote.sourceforge.io/gallery/curvedlabel.asy,,.asy}}), using the command
+@verbatim
+void labelpath(picture pic=currentpicture, Label L, path g,
+ string justify=Centered, pen p=currentpen);
+@end verbatim
+@noindent
+Here @code{justify} is one of @code{LeftJustified}, @code{Centered}, or
+@code{RightJustified}. The @math{x} component of a shift transform
+applied to the Label is interpreted as a shift along the curve, whereas
+the @math{y} component is interpreted as a shift away from the curve.
+All other Label transforms are ignored. This module requires the
+@code{latex} tex engine and inherits the limitations of the
+@code{PSTricks} @code{\pstextpath} macro.
+
+@node labelpath3, annotate, labelpath, Base modules
+@section @code{labelpath3}
+@cindex @code{labelpath3}
+This module, contributed by Jens Schwaiger, implements a 3D version of
+@code{labelpath} that does not require the @code{PSTricks} package.
+An example is provided in @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/curvedlabel3.html,,curvedlabel3}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/curvedlabel3.asy,,.asy}}.
+
+@node annotate, CAD, labelpath3, Base modules
+@section @code{annotate}
+@cindex @code{annotate}
+This module supports @acronym{PDF} annotations for viewing with
+@code{Adobe Reader}, via the function
+@verbatim
+void annotate(picture pic=currentpicture, string title, string text,
+ pair position);
+@end verbatim
+@noindent
+Annotations are illustrated in the example file @code{@uref{https://asymptote.sourceforge.io/gallery/annotation.pdf,,annotation}@uref{https://asymptote.sourceforge.io/gallery/annotation.asy,,.asy}}.
+Currently, annotations are only implemented for the @code{latex}
+(default) and @code{tex} @TeX{} engines.
+
+@node CAD, graph, annotate, Base modules
+@section @code{CAD}
+@cindex @code{CAD}
+This module, contributed by Mark Henning, provides basic pen
+definitions and measurement functions for simple 2D CAD drawings
+according to DIN 15. It is documented separately, in the file
+@code{CAD.pdf}.
+
+@node graph, palette, CAD, Base modules
+@section @code{graph}
+@cindex @code{graph}
+@cindex 2D graphs
+This module implements two-dimensional linear and logarithmic graphs,
+including automatic scale and tick selection (with the ability to
+override manually). A graph is a @code{guide} (that can be drawn with
+the draw command, with an optional legend) constructed with one of
+the following routines:
+
+@itemize
+@item
+@verbatim
+guide graph(picture pic=currentpicture, real f(real), real a, real b,
+ int n=ngraph, real T(real)=identity,
+ interpolate join=operator --);
+guide[] graph(picture pic=currentpicture, real f(real), real a, real b,
+ int n=ngraph, real T(real)=identity, bool3 cond(real),
+ interpolate join=operator --);
+@end verbatim
+
+Returns a graph using the scaling information for picture @code{pic}
+(@pxref{automatic scaling}) of the function @code{f} on the interval
+[@code{T}(@code{a}),@code{T}(@code{b})], sampling at @code{n} points
+evenly spaced in [@code{a},@code{b}], optionally restricted by the
+bool3 function @code{cond} on [@code{a},@code{b}]. If @code{cond} is:
+@itemize @bullet
+@item @code{true}, the point is added to the existing guide;
+@item @code{default}, the point is added to a new guide;
+@item @code{false}, the point is omitted and a new guide is begun.
+@end itemize
+The points are connected using the interpolation specified by @code{join}:
+@itemize @bullet
+
+@cindex @code{operator --}
+@cindex @code{Straight}
+@item @code{operator --} (linear interpolation; the abbreviation
+@code{Straight} is also accepted);
+
+@cindex @code{operator ..}
+@cindex @code{Spline}
+@item @code{operator ..} (piecewise Bezier cubic spline interpolation;
+the abbreviation @code{Spline} is also accepted);
+
+@cindex @code{Hermite}
+@cindex @code{notaknot}
+@cindex @code{natural}
+@cindex @code{periodic}
+@cindex @code{clamped}
+@cindex @code{monotonic}
+@cindex @code{Hermite(splinetype splinetype}
+@item @code{Hermite} (standard cubic spline interpolation using boundary
+condition @code{notaknot}, @code{natural}, @code{periodic},
+@code{clamped(real slopea, real slopeb)}), or @code{monotonic}.
+The abbreviation @code{Hermite} is equivalent to
+@code{Hermite(notaknot)} for nonperiodic data and
+@code{Hermite(periodic)} for periodic data).
+
+@end itemize
+
+@item
+@verbatim
+guide graph(picture pic=currentpicture, real x(real), real y(real),
+ real a, real b, int n=ngraph, real T(real)=identity,
+ interpolate join=operator --);
+guide[] graph(picture pic=currentpicture, real x(real), real y(real),
+ real a, real b, int n=ngraph, real T(real)=identity,
+ bool3 cond(real), interpolate join=operator --);
+@end verbatim
+
+Returns a graph using the scaling information for picture @code{pic}
+of the parametrized function
+(@code{x}(@math{t}),@code{y}(@math{t})) for @math{t} in the interval
+[@code{T}(@code{a}),@code{T}(@code{b})], sampling at @code{n} points
+evenly spaced in [@code{a},@code{b}], optionally restricted by the
+bool3 function @code{cond} on [@code{a},@code{b}], using the given
+interpolation type.
+
+@item
+@verbatim
+guide graph(picture pic=currentpicture, pair z(real), real a, real b,
+ int n=ngraph, real T(real)=identity,
+ interpolate join=operator --);
+guide[] graph(picture pic=currentpicture, pair z(real), real a, real b,
+ int n=ngraph, real T(real)=identity, bool3 cond(real),
+ interpolate join=operator --);
+@end verbatim
+
+Returns a graph using the scaling information for picture @code{pic}
+of the parametrized function
+@code{z}(@math{t}) for @math{t} in the interval
+[@code{T}(@code{a}),@code{T}(@code{b})], sampling at @code{n} points
+evenly spaced in [@code{a},@code{b}], optionally restricted by the
+bool3 function @code{cond} on [@code{a},@code{b}], using the given
+interpolation type.
+
+@item
+@verbatim
+guide graph(picture pic=currentpicture, pair[] z,
+ interpolate join=operator --);
+guide[] graph(picture pic=currentpicture, pair[] z, bool3[] cond,
+ interpolate join=operator --);
+@end verbatim
+
+Returns a graph using the scaling information for picture @code{pic}
+of the elements of the array @code{z}, optionally restricted to
+those indices for which the elements of the boolean array @code{cond} are
+@code{true}, using the given interpolation type.
+
+@item
+@verbatim
+guide graph(picture pic=currentpicture, real[] x, real[] y,
+ interpolate join=operator --);
+guide[] graph(picture pic=currentpicture, real[] x, real[] y,
+ bool3[] cond, interpolate join=operator --);
+@end verbatim
+
+Returns a graph using the scaling information for picture @code{pic}
+of the elements of the arrays (@code{x},@code{y}), optionally
+restricted to those indices for which the elements of the boolean
+array @code{cond} are @code{true}, using the given interpolation type.
+
+@item
+@cindex @code{polargraph}
+@verbatim
+guide polargraph(picture pic=currentpicture, real f(real), real a,
+ real b, int n=ngraph, interpolate join=operator --);
+@end verbatim
+
+Returns a polar-coordinate graph using the scaling information for
+picture @code{pic} of the function @code{f} on the interval
+[@code{a},@code{b}], sampling at @code{n} evenly spaced points, with
+the given interpolation type.
+
+@item
+@verbatim
+guide polargraph(picture pic=currentpicture, real[] r, real[] theta,
+ interpolate join=operator--);
+@end verbatim
+Returns a polar-coordinate graph using the scaling information for
+picture @code{pic} of the elements of the arrays (@code{r},@code{theta}),
+using the given interpolation type.
+
+@end itemize
+
+@verbatim
+
+
+@end verbatim
+
+An axis can be drawn on a picture with one of the following commands:
+
+@itemize
+
+@item
+@verbatim
+void xaxis(picture pic=currentpicture, Label L="", axis axis=YZero,
+ real xmin=-infinity, real xmax=infinity, pen p=currentpen,
+ ticks ticks=NoTicks, arrowbar arrow=None, bool above=false);
+@end verbatim
+
+Draw an @math{x} axis on picture @code{pic} from @math{x}=@code{xmin} to
+@math{x}=@code{xmax} using pen @code{p}, optionally labelling it with
+Label @code{L}. The relative label location along the axis (a real number from
+[0,1]) defaults to 1 (@pxref{Label}), so that the label is drawn at the
+end of the axis. An infinite value of @code{xmin}
+or @code{xmax} specifies that the corresponding axis limit will be
+automatically determined from the picture limits.
+The optional @code{arrow} argument takes the same values as in the
+@code{draw} command (@pxref{arrows}). The axis is drawn before any
+existing objects in @code{pic} unless @code{above=true}.
+The axis placement is determined by one of the following @code{axis} types:
+
+@table @code
+
+@cindex @code{YZero}
+@item YZero(bool extend=true)
+Request an @math{x} axis at @math{y}=0 (or @math{y}=1 on a logarithmic axis)
+extending to the full dimensions of the picture, unless @code{extend}=false.
+
+@cindex @code{YEquals}
+@item YEquals(real Y, bool extend=true)
+Request an @math{x} axis at @math{y}=@code{Y} extending to the full
+dimensions of the picture, unless @code{extend}=false.
+
+@cindex @code{Bottom}
+@item Bottom(bool extend=false)
+Request a bottom axis.
+
+@cindex @code{Top}
+@item Top(bool extend=false)
+Request a top axis.
+
+@cindex @code{BottomTop}
+@item BottomTop(bool extend=false)
+Request a bottom and top axis.
+
+@end table
+
+@cindex custom axis types
+Custom axis types can be created by following the examples in the
+module @code{graph.asy}.
+One can easily override the default values for the standard axis types:
+@verbatim
+import graph;
+
+YZero=new axis(bool extend=true) {
+ return new void(picture pic, axisT axis) {
+ real y=pic.scale.x.scale.logarithmic ? 1 : 0;
+ axis.value=I*pic.scale.y.T(y);
+ axis.position=1;
+ axis.side=right;
+ axis.align=2.5E;
+ axis.value2=Infinity;
+ axis.extend=extend;
+ };
+};
+YZero=YZero();
+
+@end verbatim
+
+@anchor{ticks}
+@cindex @code{ticks}
+@cindex @code{NoTicks}
+@cindex @code{LeftTicks}
+@cindex @code{RightTicks}
+@cindex @code{Ticks}
+The default tick option is @code{NoTicks}.
+The options @code{LeftTicks}, @code{RightTicks}, or @code{Ticks} can be
+used to draw ticks on the left, right, or both sides of the path,
+relative to the direction in which the path is drawn.
+These tick routines accept a number of optional arguments:
+@verbatim
+ticks LeftTicks(Label format="", ticklabel ticklabel=null,
+ bool beginlabel=true, bool endlabel=true,
+ int N=0, int n=0, real Step=0, real step=0,
+ bool begin=true, bool end=true, tickmodifier modify=None,
+ real Size=0, real size=0, bool extend=false,
+ pen pTick=nullpen, pen ptick=nullpen);
+@end verbatim
+
+If any of these parameters are omitted, reasonable defaults will
+be chosen:
+@table @code
+@item Label format
+@cindex @code{defaultformat}
+@cindex @code{trailingzero}
+override the default tick label format (@code{defaultformat}, initially
+"$%.4g$"), rotation, pen, and alignment (for example, @code{LeftSide},
+@code{Center}, or @code{RightSide}) relative to the axis. To enable
+@code{LaTeX} math mode fonts, the format string should begin and
+end with @code{$} @pxref{format}. If the format string is @code{trailingzero},
+trailing zeros will be added to the tick labels; if the format string is
+@code{"%"}, the tick label will be suppressed;
+@item ticklabel
+is a function @code{string(real x)} returning the label (by default,
+format(format.s,x)) for each major tick value @code{x};
+@item bool beginlabel
+include the first label;
+@item bool endlabel
+include the last label;
+@item int N
+when automatic scaling is enabled (the default; @pxref{automatic scaling}),
+divide a linear axis evenly into this many intervals, separated by major ticks;
+for a logarithmic axis, this is the number of decades between labelled ticks;
+@item int n
+divide each interval into this many subintervals, separated by minor ticks;
+@item real Step
+the tick value spacing between major ticks
+(if @code{N}=@code{0});
+@item real step
+the tick value spacing between minor ticks (if @code{n}=@code{0});
+@item bool begin
+include the first major tick;
+@item bool end
+include the last major tick;
+@item tickmodifier modify;
+an optional function that takes and returns a @code{tickvalue} structure having
+real[] members @code{major} and @code{minor} consisting of the tick values
+(to allow modification of the automatically generated tick values);
+@item real Size
+the size of the major ticks (in @code{PostScript} coordinates);
+@item real size
+the size of the minor ticks (in @code{PostScript} coordinates);
+@item bool extend;
+extend the ticks between two axes (useful for drawing a grid on the graph);
+@item pen pTick
+an optional pen used to draw the major ticks;
+@item pen ptick
+an optional pen used to draw the minor ticks.
+
+@end table
+
+@cindex @code{OmitTick}
+@cindex @code{OmitTickInterval}
+@cindex @code{OmitTickIntervals}
+For convenience, the predefined tickmodifiers @code{OmitTick(... real[] x)},
+@code{OmitTickInterval(real a, real b)}, and
+@code{OmitTickIntervals(real[] a, real[] b)}
+can be used to remove specific auto-generated ticks and
+their labels. The @code{OmitFormat(string s=defaultformat ... real[] x)}
+ticklabel can be used to remove specific tick labels but not the
+corresponding ticks. The tickmodifier @code{NoZero} is an abbreviation for
+@code{OmitTick(0)} and the ticklabel @code{NoZeroFormat} is an
+abbrevation for @code{OmitFormat(0)}.
+
+@cindex custom tick locations
+@cindex @code{LeftTicks}
+@cindex @code{RightTicks}
+@cindex @code{Ticks}
+It is also possible to specify custom tick locations with
+@code{LeftTicks}, @code{RightTicks}, and @code{Ticks} by passing explicit real
+arrays @code{Ticks} and (optionally) @code{ticks} containing the
+locations of the major and minor ticks, respectively:
+@verbatim
+ticks LeftTicks(Label format="", ticklabel ticklabel=null,
+ bool beginlabel=true, bool endlabel=true,
+ real[] Ticks, real[] ticks=new real[],
+ real Size=0, real size=0, bool extend=false,
+ pen pTick=nullpen, pen ptick=nullpen)
+@end verbatim
+
+@item
+@verbatim
+void yaxis(picture pic=currentpicture, Label L="", axis axis=XZero,
+ real ymin=-infinity, real ymax=infinity, pen p=currentpen,
+ ticks ticks=NoTicks, arrowbar arrow=None, bool above=false,
+ bool autorotate=true);
+@end verbatim
+
+Draw a @math{y} axis on picture @code{pic} from @math{y}=@code{ymin} to
+@math{y}=@code{ymax} using pen @code{p}, optionally labelling it with
+a Label @code{L} that is autorotated unless @code{autorotate=false}.
+The relative location of the label (a real number from
+[0,1]) defaults to 1 (@pxref{Label}). An infinite value of @code{ymin}
+or @code{ymax} specifies that the corresponding axis limit will be
+automatically determined from the picture limits.
+The optional @code{arrow} argument takes the same values as in the
+@code{draw} command (@pxref{arrows}). The axis is drawn before any
+existing objects in @code{pic} unless @code{above=true}.
+The tick type is specified by @code{ticks} and the axis placement is
+determined by one of the following @code{axis} types:
+
+@table @code
+
+@cindex @code{XZero}
+@item XZero(bool extend=true)
+Request a @math{y} axis at @math{x}=0 (or @math{x}=1 on a logarithmic axis)
+extending to the full dimensions of the picture, unless @code{extend}=false.
+
+@cindex @code{XEquals}
+@item XEquals(real X, bool extend=true)
+Request a @math{y} axis at @math{x}=@code{X} extending to the full
+dimensions of the picture, unless @code{extend}=false.
+
+@cindex @code{Left}
+@item Left(bool extend=false)
+Request a left axis.
+
+@cindex @code{Right}
+@item Right(bool extend=false)
+Request a right axis.
+
+@cindex @code{LeftRight}
+@item LeftRight(bool extend=false)
+Request a left and right axis.
+
+@end table
+
+@item
+@cindex @code{xequals}
+@cindex @code{yequals}
+For convenience, the functions
+@verbatim
+void xequals(picture pic=currentpicture, Label L="", real x,
+ bool extend=false, real ymin=-infinity, real ymax=infinity,
+ pen p=currentpen, ticks ticks=NoTicks, bool above=true,
+ arrowbar arrow=None);
+@end verbatim
+and
+@verbatim
+void yequals(picture pic=currentpicture, Label L="", real y,
+ bool extend=false, real xmin=-infinity, real xmax=infinity,
+ pen p=currentpen, ticks ticks=NoTicks, bool above=true,
+ arrowbar arrow=None);
+@end verbatim
+can be respectively used to call @code{yaxis} and
+@code{xaxis} with the appropriate axis types @code{XEquals(x,extend)} and
+@code{YEquals(y,extend)}. This is the recommended way of drawing vertical
+or horizontal lines and axes at arbitrary locations.
+
+@item
+@verbatim
+void axes(picture pic=currentpicture, Label xlabel="", Label ylabel="",
+ bool extend=true,
+ pair min=(-infinity,-infinity), pair max=(infinity,infinity),
+ pen p=currentpen, arrowbar arrow=None, bool above=false);
+@end verbatim
+This convenience routine draws both @math{x} and @math{y} axes
+on picture @code{pic} from @code{min} to @code{max},
+with optional labels @code{xlabel} and @code{ylabel}
+and any arrows specified by @code{arrow}. The axes are drawn on top of
+existing objects in @code{pic} only if @code{above=true}.
+
+@item
+@verbatim
+void axis(picture pic=currentpicture, Label L="", path g,
+ pen p=currentpen, ticks ticks, ticklocate locate,
+ arrowbar arrow=None, int[] divisor=new int[],
+ bool above=false, bool opposite=false);
+@end verbatim
+
+This routine can be used to draw on picture @code{pic} a general axis
+based on an arbitrary path @code{g}, using pen @code{p}.
+One can optionally label the axis with Label @code{L} and add an arrow
+@code{arrow}. The tick type is given by @code{ticks}.
+The optional integer array @code{divisor} specifies what tick divisors
+to try in the attempt to produce uncrowded tick labels. A @code{true}
+value for the flag @code{opposite} identifies an unlabelled secondary
+axis (typically drawn opposite a primary axis). The axis is drawn before
+any existing objects in @code{pic} unless @code{above=true}.
+The tick locator @code{ticklocate} is constructed by the routine
+@verbatim
+ticklocate ticklocate(real a, real b, autoscaleT S=defaultS,
+ real tickmin=-infinity, real tickmax=infinity,
+ real time(real)=null, pair dir(real)=zero);
+@end verbatim
+@noindent
+where @code{a} and @code{b} specify the respective tick values at
+@code{point(g,0)} and @code{point(g,length(g))}, @code{S} specifies
+the autoscaling transformation, the function @code{real time(real v)}
+returns the time corresponding to the value @code{v}, and
+@code{pair dir(real t)} returns the absolute tick direction as a
+function of @code{t} (zero means draw the tick perpendicular to the axis).
+
+@item These routines are useful for manually putting ticks and labels on axes
+(if the variable @code{Label} is given as the @code{Label}
+argument, the @code{format} argument will be used to format a string based on
+the tick location):
+@cindex xtick
+@cindex ytick
+@cindex labelx
+@cindex labely
+@cindex tick
+@cindex Label
+@verbatim
+void xtick(picture pic=currentpicture, Label L="", explicit pair z,
+ pair dir=N, string format="",
+ real size=Ticksize, pen p=currentpen);
+void xtick(picture pic=currentpicture, Label L="", real x,
+ pair dir=N, string format="",
+ real size=Ticksize, pen p=currentpen);
+void ytick(picture pic=currentpicture, Label L="", explicit pair z,
+ pair dir=E, string format="",
+ real size=Ticksize, pen p=currentpen);
+void ytick(picture pic=currentpicture, Label L="", real y,
+ pair dir=E, string format="",
+ real size=Ticksize, pen p=currentpen);
+void tick(picture pic=currentpicture, pair z,
+ pair dir, real size=Ticksize, pen p=currentpen);
+void labelx(picture pic=currentpicture, Label L="", explicit pair z,
+ align align=S, string format="", pen p=currentpen);
+void labelx(picture pic=currentpicture, Label L="", real x,
+ align align=S, string format="", pen p=currentpen);
+void labelx(picture pic=currentpicture, Label L,
+ string format="", explicit pen p=currentpen);
+void labely(picture pic=currentpicture, Label L="", explicit pair z,
+ align align=W, string format="", pen p=currentpen);
+void labely(picture pic=currentpicture, Label L="", real y,
+ align align=W, string format="", pen p=currentpen);
+void labely(picture pic=currentpicture, Label L,
+ string format="", explicit pen p=currentpen);
+@end verbatim
+@end itemize
+
+Here are some simple examples of two-dimensional graphs:
+
+@enumerate
+
+@cindex textbook graph
+@item This example draws a textbook-style graph of
+@math{y=} exp@math{(x)}, with the @math{y} axis starting at @math{y=0}:
+@verbatiminclude exp.asy
+@sp 1
+@center @image{./exp}
+
+
+@item The next example draws a scientific-style graph with a legend.
+The position of the legend can be adjusted either explicitly or by using the
+graphical user interface (@pxref{GUI}). If an
+@code{UnFill(real xmargin=0, real ymargin=xmargin)} or
+@code{Fill(pen)} option is specified to @code{add}, the legend will obscure
+any underlying objects. Here we illustrate how to clip the portion of
+the picture covered by a label:
+
+@cindex scientific graph
+@verbatiminclude lineargraph0.asy
+@sp 1
+@center @image{./lineargraph0}
+
+@cindex @code{attach}
+To specify a fixed size for the graph proper, use @code{attach}:
+@verbatiminclude lineargraph.asy
+
+@cindex @code{legend}
+A legend can have multiple entries per line:
+@verbatiminclude legend.asy
+@sp 1
+@center @image{./legend}
+
+@item This example draws a graph of one array versus another (both of
+the same size) using custom tick locations and a smaller font size for
+the tick labels on the @math{y} axis.
+@verbatiminclude datagraph.asy
+@sp 1
+@center @image{./datagraph}
+
+@item This example shows how to graph columns of data read from a file.
+@verbatiminclude filegraph.asy
+@sp 1
+@center @image{./filegraph}
+
+@cindex @code{polygon}
+@cindex @code{cross}
+@cindex @code{errorbars}
+@cindex @code{marker}
+@cindex @code{marknodes}
+@cindex @code{markuniform}
+@cindex @code{mark}
+@cindex path markers
+@anchor{pathmarkers}
+@item The next example draws two graphs of an array of coordinate pairs,
+using frame alignment and data markers. In the left-hand graph, the
+markers, constructed with
+@verbatim
+marker marker(path g, markroutine markroutine=marknodes,
+ pen p=currentpen, filltype filltype=NoFill,
+ bool above=true);
+@end verbatim
+using the path @code{unitcircle} (@pxref{filltype}), are drawn
+below each node. Any frame can be converted to a marker, using
+@anchor{marker}
+@verbatim
+marker marker(frame f, markroutine markroutine=marknodes,
+ bool above=true);
+@end verbatim
+In the right-hand graph, the unit @math{n}-sided regular polygon
+@code{polygon(int n)} and the unit @math{n}-point cyclic cross
+@code{cross(int n, bool round=true, real r=0)} (where @code{r} is an
+optional ``inner'' radius) are used to build a custom marker frame.
+@anchor{markuniform}
+Here @code{markuniform(bool centered=false, int n, bool rotated=false)}
+adds this frame at @code{n} uniformly spaced points along the arclength
+of the path, optionally rotated by the angle of the local tangent to the path
+(if centered is true, the frames will be centered within @code{n} evenly
+spaced arclength intervals). Alternatively, one can use
+markroutine @code{marknodes} to request that the marks be placed at each
+Bezier node of the path, or
+markroutine @code{markuniform(pair z(real t), real a, real b, int n)}
+to place marks at points @code{z(t)} for n evenly spaced values of
+@code{t} in @code{[a,b]}.
+
+These markers are predefined:
+@verbatim
+marker[] Mark={
+ marker(scale(circlescale)*unitcircle),
+ marker(polygon(3)),marker(polygon(4)),
+ marker(polygon(5)),marker(invert*polygon(3)),
+ marker(cross(4)),marker(cross(6))
+};
+
+marker[] MarkFill={
+ marker(scale(circlescale)*unitcircle,Fill),marker(polygon(3),Fill),
+ marker(polygon(4),Fill),marker(polygon(5),Fill),
+ marker(invert*polygon(3),Fill)
+};
+@end verbatim
+
+The example also illustrates the @code{errorbar} routines:
+
+@verbatim
+void errorbars(picture pic=currentpicture, pair[] z, pair[] dp,
+ pair[] dm={}, bool[] cond={}, pen p=currentpen,
+ real size=0);
+
+void errorbars(picture pic=currentpicture, real[] x, real[] y,
+ real[] dpx, real[] dpy, real[] dmx={}, real[] dmy={},
+ bool[] cond={}, pen p=currentpen, real size=0);
+@end verbatim
+
+@noindent
+Here, the positive and negative extents of the error are given by the
+absolute values of the elements of the pair array @code{dp} and the
+optional pair array @code{dm}. If @code{dm} is not specified, the
+positive and negative extents of the error are assumed to be equal.
+@anchor{errorbars}
+@cindex error bars
+@verbatiminclude errorbars.asy
+@sp 1
+@center @image{./errorbars}
+
+@cindex custom mark routine
+@item A custom mark routine can be also be specified:
+@verbatiminclude graphmarkers.asy
+@sp 1
+@center @image{./graphmarkers}
+
+@item This example shows how to label an axis with arbitrary strings.
+@verbatiminclude monthaxis.asy
+@sp 1
+@center @image{./monthaxis}
+
+@item The next example draws a graph of a parametrized curve.
+@cindex parametrized curve
+@cindex cropping graphs
+@cindex @code{xlimits}
+@cindex @code{ylimits}
+@cindex @code{limits}
+@cindex @code{crop}
+The calls to
+@verbatim
+xlimits(picture pic=currentpicture, real min=-infinity,
+ real max=infinity, bool crop=NoCrop);
+@end verbatim
+@noindent
+and the analogous function @code{ylimits} can be uncommented
+to set the respective axes limits for picture @code{pic} to the
+specified @code{min} and @code{max} values. Alternatively, the function
+@verbatim
+void limits(picture pic=currentpicture, pair min, pair max, bool crop=NoCrop);
+@end verbatim
+can be used to limit the axes to the box having opposite vertices at
+the given pairs). Existing objects in picture @code{pic} will be cropped to lie
+within the given limits if @code{crop}=@code{Crop}. The function
+@code{crop(picture pic)} can be used to crop a graph to the current
+graph limits.
+@verbatiminclude parametricgraph.asy
+@sp 1
+@center @image{./parametricgraph}
+
+@cindex scaled graph
+The next example illustrates how one can extract a common axis scaling
+factor.
+@verbatiminclude scaledgraph.asy
+@sp 1
+@center @image{./scaledgraph}
+
+@anchor{automatic scaling}
+@cindex automatic scaling
+@cindex @code{scale}
+@cindex @code{Linear}
+@cindex @code{Log}
+@cindex automatic scaling
+Axis scaling can be requested and/or automatic selection of the
+axis limits can be inhibited with one of these @code{scale} routines:
+@verbatim
+void scale(picture pic=currentpicture, scaleT x, scaleT y);
+
+void scale(picture pic=currentpicture, bool xautoscale=true,
+ bool yautoscale=xautoscale, bool zautoscale=yautoscale);
+@end verbatim
+
+This sets the scalings for picture @code{pic}. The @code{graph} routines
+accept an optional @code{picture} argument for determining the appropriate
+scalings to use; if none is given, it uses those set for
+@code{currentpicture}.
+
+Two frequently used scaling routines
+@code{Linear} and @code{Log} are predefined in @code{graph}.
+
+All picture coordinates (including those in paths and those given
+to the @code{label} and @code{limits} functions) are always treated as linear
+(post-scaled) coordinates. Use
+@cindex @code{Scale}
+@verbatim
+pair Scale(picture pic=currentpicture, pair z);
+@end verbatim
+to convert a graph coordinate into a scaled picture coordinate.
+
+The @math{x} and @math{y} components can be individually scaled using
+the analogous routines
+@verbatim
+real ScaleX(picture pic=currentpicture, real x);
+real ScaleY(picture pic=currentpicture, real y);
+@end verbatim
+
+The predefined scaling routines can be given two optional boolean arguments:
+@code{automin=false} and @code{automax=automin}. These default to
+@code{false} but can be respectively set to @code{true} to enable
+automatic selection of "nice" axis minimum and maximum values. The
+@code{Linear} scaling can also take as optional final arguments a
+multiplicative scaling factor and intercept (e.g.@ for a depth axis,
+@code{Linear(-1)} requests axis reversal).
+
+@cindex logarithmic graph
+@cindex log-log graph
+For example, to draw a log/log graph of a function, use @code{scale(Log,Log)}:
+@verbatiminclude loggraph.asy
+@sp 1
+@center @image{./loggraph}
+
+@cindex grid
+By extending the ticks, one can easily produce a logarithmic grid:
+@verbatiminclude loggrid.asy
+
+@sp 1
+@center @image{./loggrid}
+
+One can also specify custom tick locations and formats for logarithmic axes:
+@verbatiminclude logticks.asy
+@sp 1
+@center @image{./logticks}
+
+@cindex @code{log2} graph
+It is easy to draw logarithmic graphs with respect to other bases:
+@verbatiminclude log2graph.asy
+@sp 1
+@center @image{./log2graph}
+
+@cindex broken axis
+Here is an example of "broken" linear @math{x} and logarithmic
+@math{y} axes that omit the segments [3,8] and [100,1000], respectively.
+In the case of a logarithmic axis, the break endpoints are automatically
+rounded to the nearest integral power of the base.
+@verbatiminclude brokenaxis.asy
+@sp 1
+@center @image{./brokenaxis}
+
+@cindex secondary axis
+@cindex @code{secondaryX}
+@cindex @code{secondaryY}
+@item @code{Asymptote} can draw secondary axes with the routines
+@verbatim
+picture secondaryX(picture primary=currentpicture, void f(picture));
+picture secondaryY(picture primary=currentpicture, void f(picture));
+@end verbatim
+
+In this example, @code{secondaryY} is used to draw a secondary linear
+@math{y} axis against a primary logarithmic @math{y} axis:
+@verbatiminclude Bode.asy
+@sp 1
+@center @image{./Bode}
+
+A secondary logarithmic @math{y} axis can be drawn like this:
+@verbatiminclude secondaryaxis.asy
+@sp 1
+@center @image{./secondaryaxis}
+
+@item Here is a histogram example, which uses the @code{stats} module.
+@cindex @code{axis}
+@verbatiminclude histogram.asy
+@sp 1
+@center @image{./histogram}
+
+@item Here is an example of reading column data in from a file and a
+least-squares fit, using the @code{stats} module.
+@cindex @code{leastsquares}
+@verbatiminclude leastsquares.asy
+@sp 1
+@center @image{./leastsquares}
+
+@item Here is an example that illustrates the general @code{axis} routine.
+@cindex @code{axis}
+@verbatiminclude generalaxis.asy
+@sp 1
+@center @image{./generalaxis}
+
+@item To draw a vector field of @code{n} arrows evenly spaced along
+the arclength of a path, use the routine
+@cindex @code{vectorfield}
+@verbatim
+picture vectorfield(path vector(real), path g, int n, bool truesize=false,
+ pen p=currentpen, arrowbar arrow=Arrow);
+@end verbatim
+as illustrated in this simple example of a flow field:
+@verbatiminclude flow.asy
+@sp 1
+@center @image{./flow}
+
+@item To draw a vector field of @code{nx}@math{\times}@code{ny} arrows
+in @code{box(a,b)}, use the routine
+@cindex @code{vectorfield}
+@verbatim
+picture vectorfield(path vector(pair), pair a, pair b,
+ int nx=nmesh, int ny=nx, bool truesize=false,
+ real maxlength=truesize ? 0 : maxlength(a,b,nx,ny),
+ bool cond(pair z)=null, pen p=currentpen,
+ arrowbar arrow=Arrow, margin margin=PenMargin)
+@end verbatim
+as illustrated in this example:
+@verbatiminclude vectorfield.asy
+@sp 1
+@center @image{./vectorfield}
+
+@item The following scientific graphs, which illustrate many features of
+@code{Asymptote}'s graphics routines, were generated from the examples
+@code{@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/diatom.svg,,diatom}@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/diatom.asy,,.asy}} and @code{@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/westnile.svg,,westnile}@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/westnile.asy,,.asy}}, using the comma-separated
+data in @code{@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/diatom.csv,,diatom.csv}} and @code{@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/westnile.csv,,westnile.csv}}.
+@page
+
+@sp 1
+@center @image{./diatom}
+@sp 1
+@center @image{./westnile,,7.5cm}
+@end enumerate
+
+@page
+@node palette, three, graph, Base modules
+@section @code{palette}
+@anchor{images}
+@cindex images
+@code{Asymptote} can also generate color density images
+and palettes. The following palettes are predefined in
+@code{palette.asy}:
+
+@table @code
+
+@cindex @code{Grayscale}
+@item pen[] Grayscale(int NColors=256)
+a grayscale palette;
+
+@cindex @code{Rainbow}
+@item pen[] Rainbow(int NColors=32766)
+a rainbow spectrum;
+
+@cindex @code{BWRainbow}
+@item pen[] BWRainbow(int NColors=32761)
+a rainbow spectrum tapering off to black/white at the ends;
+
+@cindex @code{BWRainbow2}
+@item pen[] BWRainbow2(int NColors=32761)
+a double rainbow palette tapering off to black/white at the ends, with
+a linearly scaled intensity.
+
+@cindex @code{Wheel}
+@item pen[] Wheel(int NColors=32766)
+a full color wheel palette;
+
+@cindex @code{Gradient}
+@item pen[] Gradient(int NColors=256 ... pen[] p)
+a palette varying linearly over the specified array of pens, using
+NColors in each interpolation interval;
+
+@end table
+
+The function @code{cmyk(pen[] Palette)} may be used to convert any
+of these palettes to the @acronym{CMYK} colorspace.
+
+A color density plot using palette @code{palette} can be generated from
+a function @code{f}(@math{x},@math{y}) and added to a picture @code{pic}:
+@cindex @code{image}
+@verbatim
+bounds image(picture pic=currentpicture, real f(real, real),
+ range range=Full, pair initial, pair final,
+ int nx=ngraph, int ny=nx, pen[] palette, bool antialias=false)
+@end verbatim
+The function @code{f} will be sampled at @code{nx} and @code{ny}
+evenly spaced points over a rectangle defined by the points
+@code{initial} and @code{final}, respecting the current graphical
+scaling of @code{pic}. The color space is scaled according to the
+@math{z} axis scaling (@pxref{automatic scaling}). A bounds structure
+for the function values is returned:
+@verbatim
+struct bounds {
+ real min;
+ real max;
+ // Possible tick intervals:
+ int[] divisor;
+}
+@end verbatim
+@noindent
+This information can be used for generating an optional palette bar.
+The palette color space corresponds to a range of values specified by
+the argument @code{range}, which can be @code{Full}, @code{Automatic},
+or an explicit range @code{Range(real min, real max)}.
+Here @code{Full} specifies a range varying from the
+minimum to maximum values of the function over the sampling interval,
+while @code{Automatic} selects "nice" limits.
+The example @code{@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/imagecontour.svg,,imagecontour}@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/imagecontour.asy,,.asy}} illustrates how level sets
+(contour lines) can be drawn on a color density plot (@pxref{contour}).
+
+A color density plot can also be generated from an explicit real[][]
+array @code{data}:
+@cindex @code{image}
+@verbatim
+bounds image(picture pic=currentpicture, real[][] f, range range=Full,
+ pair initial, pair final, pen[] palette,
+ bool transpose=(initial.x < final.x && initial.y < final.y),
+ bool copy=true, bool antialias=false);
+@end verbatim
+@noindent
+If the initial point is to the left and below the final point,
+by default the array indices are interpreted according to the
+Cartesian convention (first index: @math{x}, second index: @math{y})
+rather than the usual matrix convention (first index: @math{-y},
+second index: @math{x}).
+
+To construct an image from an array of irregularly spaced points
+and an array of values @code{f} at these points, use one of the routines
+@verbatim
+bounds image(picture pic=currentpicture, pair[] z, real[] f,
+ range range=Full, pen[] palette)
+bounds image(picture pic=currentpicture, real[] x, real[] y, real[] f,
+ range range=Full, pen[] palette)
+@end verbatim
+
+An optionally labelled palette bar may be generated with the routine
+@verbatim
+void palette(picture pic=currentpicture, Label L="", bounds bounds,
+ pair initial, pair final, axis axis=Right, pen[] palette,
+ pen p=currentpen, paletteticks ticks=PaletteTicks,
+ bool copy=true, bool antialias=false);
+@end verbatim
+The color space of @code{palette} is taken to be over bounds @code{bounds} with
+scaling given by the @math{z} scaling of @code{pic}.
+The palette orientation is specified by @code{axis}, which may be one of
+@code{Right}, @code{Left}, @code{Top}, or @code{Bottom}.
+The bar is drawn over the rectangle from @code{initial} to @code{final}.
+The argument @code{paletteticks} is a special tick type (@pxref{ticks})
+that takes the following arguments:
+@verbatim
+paletteticks PaletteTicks(Label format="", ticklabel ticklabel=null,
+ bool beginlabel=true, bool endlabel=true,
+ int N=0, int n=0, real Step=0, real step=0,
+ pen pTick=nullpen, pen ptick=nullpen);
+@end verbatim
+
+The image and palette bar can be fit to a frame and added and
+optionally aligned to a picture at the desired location:
+
+@anchor{image}
+@verbatiminclude image.asy
+@sp 1
+@center @image{./image}
+
+Here is an example that uses logarithmic scaling of the function values:
+
+@anchor{logimage}
+@verbatiminclude logimage.asy
+@sp 1
+@center @image{./logimage}
+
+One can also draw an image directly from a two-dimensional pen array
+or a function @code{pen f(int, int)}:
+@verbatim
+void image(picture pic=currentpicture, pen[][] data,
+ pair initial, pair final,
+ bool transpose=(initial.x < final.x && initial.y < final.y),
+ bool copy=true, bool antialias=false);
+void image(picture pic=currentpicture, pen f(int, int), int width, int height,
+ pair initial, pair final,
+ bool transpose=(initial.x < final.x && initial.y < final.y),
+ bool antialias=false);
+@end verbatim
+@noindent
+as illustrated in the following examples:
+
+@anchor{penimage}
+@verbatiminclude penimage.asy
+@sp 1
+@center @image{./penimage}
+
+@anchor{penfunctionimage}
+@verbatiminclude penfunctionimage.asy
+@sp 1
+@center @image{./penfunctionimage}
+
+For convenience, the module @code{palette} also defines functions
+that may be used to construct a pen array from a given function and palette:
+@verbatim
+pen[] palette(real[] f, pen[] palette);
+pen[][] palette(real[][] f, pen[] palette);
+@end verbatim
+
+@node three, obj, palette, Base modules
+@section @code{three}
+@cindex @code{three}
+@cindex @code{guide3}
+@cindex @code{path3}
+@cindex @code{cycle}
+@cindex @code{curl}
+@cindex @code{tension}
+@cindex @code{controls}
+This module fully extends the notion of guides and paths in @code{Asymptote}
+to three dimensions. It introduces the new types guide3, path3, and surface.
+Guides in three dimensions are specified with the same syntax as in two
+dimensions except that triples @code{(x,y,z)} are used in place of pairs
+@code{(x,y)} for the nodes and direction specifiers. This
+generalization of John Hobby's spline algorithm is shape-invariant under
+three-dimensional rotation, scaling, and shifting, and reduces in the
+planar case to the two-dimensional algorithm used in @code{Asymptote},
+@code{MetaPost}, and @code{MetaFont} [cf.@ J. C. Bowman, Proceedings in
+Applied Mathematics and Mechanics, 7:1, 2010021-2010022 (2007)].
+
+For example, a unit circle in the @math{XY} plane may be filled and
+drawn like this:
+@verbatiminclude unitcircle3.asy
+@sp 1
+@center @image{./unitcircle3}
+@noindent
+and then distorted into a saddle:
+@verbatiminclude saddle.asy
+@sp 1
+@center @image{./saddle}
+@noindent
+
+Module @code{three} provides constructors for converting two-dimensional
+paths to three-dimensional ones, and vice-versa:
+@cindex @code{path3}
+@cindex @code{path}
+@verbatim
+path3 path3(path p, triple plane(pair)=XYplane);
+path path(path3 p, pair P(triple)=xypart);
+@end verbatim
+
+@cindex @code{surface}
+@cindex @code{render}
+@cindex @code{defaultrender}
+A Bezier surface, the natural two-dimensional generalization of Bezier
+curves, is defined in @code{three_surface.asy} as a structure
+containing an array of Bezier patches. Surfaces may drawn with one of
+the routines
+@verbatim
+void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
+ material surfacepen=currentpen, pen meshpen=nullpen,
+ light light=currentlight, light meshlight=nolight, string name="",
+ render render=defaultrender);
+void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
+ material[] surfacepen, pen meshpen,
+ light light=currentlight, light meshlight=nolight, string name="",
+ render render=defaultrender);
+void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
+ material[] surfacepen, pen[] meshpen=nullpens,
+ light light=currentlight, light meshlight=nolight, string name="",
+ render render=defaultrender);
+
+@end verbatim
+The parameters @code{nu} and @code{nv} specify the number of subdivisions
+for drawing optional mesh lines for each Bezier patch. The optional
+@code{name} parameter is used as a prefix for naming the surface
+patches in the @acronym{PRC} model tree.
+Here material is a structure defined in @code{three_light.asy}:
+@cindex @code{material}
+@cindex @code{diffusepen}
+@cindex @code{emissivepen}
+@cindex @code{specularpen}
+@cindex @code{opacity}
+@cindex @code{shininess}
+@cindex @code{metallic}
+@cindex @code{freshnel0}
+@verbatim
+struct material {
+ pen[] p; // diffusepen,emissivepen,specularpen
+ real opacity;
+ real shininess;
+ real metallic;
+ real fresnel0;
+}
+@end verbatim
+@noindent
+@cindex @code{PBR}
+@cindex @code{physically based rendering}
+These material properties are used to implement physically based
+rendering (PBR) using light properties defined in @code{plain_prethree.asy}
+and @code{three_light.asy}:
+@cindex @code{light}
+@cindex @code{diffuse}
+@cindex @code{specular}
+@cindex @code{background}
+@cindex @code{specularfactor}
+@cindex @code{position}
+@cindex @code{currentlight}
+@cindex @code{Viewport}
+@cindex @code{White}
+@cindex @code{Headlamp}
+@cindex @code{nolight}
+@verbatim
+struct light {
+ real[][] diffuse;
+ real[][] specular;
+ pen background=nullpen; // Background color of the canvas.
+ real specularfactor;
+ triple[] position; // Only directional lights are currently implemented.
+}
+
+light Viewport=light(specularfactor=3,(0.25,-0.25,1));
+
+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[] {(-2,-1.5,-0.5),(2,1.1,-2.5),(-0.5,0,2)});
+
+light Headlamp=light(gray(0.8),specular=gray(0.7),
+ specularfactor=3,dir(42,48));
+
+currentlight=Headlamp;
+
+light nolight;
+@end verbatim
+@cindex @code{background}
+@cindex @code{transparent}
+The @code{currentlight.background} (or @code{background} member of the
+specified @code{light}) can be used
+to set the background colour for 2D (or 3D) images. The default
+background is white for @code{HTML} images and transparent for all
+other formats. One can request a completely transparent background for
+3D @code{WebGL} images with
+@code{currentlight.background=black+opacity(0.0);}
+
+Sample Bezier surfaces are
+contained in the example files @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/BezierSurface.html,,BezierSurface}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/BezierSurface.asy,,.asy}}, @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/teapot.html,,teapot}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/teapot.asy,,.asy}},
+and @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/parametricsurface.html,,parametricsurface}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/parametricsurface.asy,,.asy}}. The structure @code{render} contains
+specialized rendering options documented at the beginning of module
+@code{three}.
+
+@cindex patch-dependent colors
+@cindex vertex-dependent colors
+The examples
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/elevation.html,,elevation}@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/elevation.asy,,.asy}} and @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/sphericalharmonic.html,,sphericalharmonic}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/sphericalharmonic.asy,,.asy}}
+illustrate how to draw a surface with patch-dependent colors.
+The examples @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/vertexshading.html,,vertexshading}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/vertexshading.asy,,.asy}} and @code{@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/smoothelevation.html,,smoothelevation}@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/smoothelevation.asy,,.asy}} illustrate
+vertex-dependent colors, which are supported by
+@code{Asymptote}'s native @code{OpenGL}/@code{WebGL} renderers
+and the two-dimensional vector output format (@code{settings.render=0}). Since
+the @acronym{PRC} output format does not currently support vertex
+shading of Bezier surfaces, @acronym{PRC} patches are shaded with the mean of the four vertex colors.
+
+@cindex @code{surface}
+@cindex @code{planar}
+@cindex @code{Bezier patch}
+@cindex @code{Bezier triangle}
+A surface can be constructed from a cyclic @code{path3} with the constructor
+@verbatim
+surface surface(path3 external, triple[] internal=new triple[],
+ pen[] colors=new pen[], bool3 planar=default);
+@end verbatim
+@noindent
+and then filled:
+@verbatim
+draw(surface(unitsquare3,new triple[] {X,Y,Z,O}),red);
+draw(surface(O--X{Y}..Y{-X}--cycle,new triple[] {Z}),red);
+draw(surface(path3(polygon(5))),red,nolight);
+draw(surface(unitcircle3),red,nolight);
+draw(surface(unitcircle3,new pen[] {red,green,blue,black}),nolight);
+@end verbatim
+@noindent
+The first example draws a Bezier patch and the second example draws
+a Bezier triangle. The third and fourth examples are planar surfaces.
+The last example constructs a patch with vertex-specific colors.
+A three-dimensional planar surface in the plane @code{plane} can be
+constructed from a two-dimensional cyclic path @code{g} with the constructor
+@cindex @code{surface}
+@verbatim
+surface surface(path p, triple plane(pair)=XYplane);
+@end verbatim
+@noindent
+and then filled:
+@verbatim
+draw(surface((0,0)--E+2N--2E--E+N..0.2E..cycle),red);
+@end verbatim
+@noindent
+@cindex @code{bezulate}
+Planar Bezier surfaces patches are constructed using Orest Shardt's
+@code{bezulate} routine, which decomposes (possibly nonsimply
+connected) regions bounded (according to the @code{zerowinding} fill rule)
+by simple cyclic paths (intersecting only at the endpoints)
+into subregions bounded by cyclic paths of length @code{4} or less.
+
+A more efficient routine also exists for drawing tessellations
+composed of many 3D triangles, with specified vertices, and optional
+normals or vertex colors:
+@cindex @code{draw}
+@cindex @code{triangles}
+@cindex @code{tessellation}
+@verbatim
+void draw(picture pic=currentpicture, triple[] v, int[][] vi,
+ triple[] n={}, int[][] ni=vi, material m=currentpen, pen[] p={},
+ int[][] pi=vi, light light=currentlight);
+@end verbatim
+Here, the triple array @code{v} lists the (typically distinct) vertices, while
+the array @code{vi} contains integer arrays of length 3 containing
+the indices of the elements in @code{v} that form the vertices of each
+triangle. Similarly, the arguments @code{n} and @code{ni} contain
+optional normal data and @code{p} and @code{pi} contain optional pen
+vertex data. If more than one normal or pen is specified for a vertex, the
+last one specified is used.
+An example of this tessellation facility is given in @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/triangles.html,,triangles}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/triangles.asy,,.asy}}.
+
+@cindex @code{thin}
+@cindex @code{thick}
+@cindex @code{tube}
+Arbitrary thick three-dimensional curves and line caps (which the
+@code{OpenGL} standard does not require implementations to provide) are
+constructed with
+@verbatim
+tube tube(path3 p, real width, render render=defaultrender);
+@end verbatim
+@noindent
+this returns a tube structure representing a tube of diameter @code{width}
+centered approximately on @code{g}. The tube structure consists of a
+surface @code{s} and the actual tube center, path3 @code{center}.
+Drawing thick lines as tubes can be slow to render,
+especially with the @code{Adobe Reader} renderer. The setting
+@code{thick=false} can be used to disable this feature and force all
+lines to be drawn with @code{linewidth(0)} (one pixel wide, regardless
+of the resolution). By default, mesh and contour lines in three-dimensions
+are always drawn thin, unless an explicit line width is given in the pen
+parameter or the setting @code{thin} is set to @code{false}. The pens
+@code{thin()} and @code{thick()} defined in @code{plain_pens.asy} can
+also be used to override these defaults for specific draw commands.
+
+@noindent
+There are five choices for viewing 3D @code{Asymptote} output:
+@enumerate
+
+@cindex @code{OpenGL}
+@cindex @code{render}
+@cindex @code{outformat}
+@cindex @code{multisample}
+@cindex @code{devicepixelratio}
+@cindex @code{position}
+@item Use the native @code{Asymptote} adaptive @code{OpenGL}-based
+renderer (with the command-line option @code{-V} and the default settings
+@code{outformat=""} and @code{render=-1}). On @code{UNIX} systems with
+graphics support for multisampling, the sample width can be
+controlled with the setting @code{multisample}. The ratio of physical to
+logical screen pixels can be specified with the setting @code{devicepixelratio}. An initial screen position can be specified with the pair setting
+@code{position}, where negative values are interpreted as relative to the
+corresponding maximum screen dimension. The default settings
+@cindex mouse bindings
+@verbatim
+import settings;
+leftbutton=new string[] {"rotate","zoom","shift","pan"};
+middlebutton=new string[] {""};
+rightbutton=new string[] {"zoom","rotateX","rotateY","rotateZ"};
+wheelup=new string[] {"zoomin"};
+wheeldown=new string[] {"zoomout"};
+@end verbatim
+bind the mouse buttons as follows:
+@itemize
+@item Left: rotate
+@item Shift Left: zoom
+@item Ctrl Left: shift viewport
+@item Alt Left: pan
+@item Wheel Up: zoom in
+@item Wheel Down: zoom out
+@item Right: zoom
+@item Shift Right: rotate about the X axis
+@item Ctrl Right: rotate about the Y axis
+@item Alt Right: rotate about the Z axis
+@end itemize
+
+The keyboard shortcuts are:
+@cindex keyboard bindings:
+@itemize
+@item h: home
+@item f: toggle fitscreen
+@item x: spin about the X axis
+@item y: spin about the Y axis
+@item z: spin about the Z axis
+@item s: stop spinning
+@item m: rendering mode (solid/patch/mesh)
+@item e: export
+@item c: show camera parameters
+@item p: play animation
+@item r: reverse animation
+@item : step animation
+@item +: expand
+@item =: expand
+@item >: expand
+@item -: shrink
+@item _: shrink
+@item <: shrink
+@item q: exit
+@item Ctrl-q: exit
+@end itemize
+
+@cindex @code{WebGL}
+@cindex @code{HTML5}
+@cindex @code{mobile browser}
+@item Generate @code{WebGL} interactive vector graphics
+output with the the command-line option and @code{-f html}
+(or the setting @code{outformat="html"}). The resulting
+3D @acronym{HTML} file can then be viewed directly in any modern desktop or
+mobile browser, or even embedded within another web page:
+@verbatim
+<div>
+<object data="logo3.html"
+ style="width:210;height:140;position:relative;top:0;left:0;">
+</object>
+</div>
+@end verbatim
+
+Normally, @code{WebGL} files generated by @code{Asymptote} are
+dynamically remeshed to fit the browser window dimensions.
+However, the setting @code{absolute=true} can be used to force the image to be
+rendered at its designed size (accounting for multiple device pixels
+per @code{css} pixel).
+
+The interactive @code{WebGL} files produced by @code{Asymptote} use the
+default mouse and (many of the same) key bindings as the @code{OpenGL}
+renderer. Zooming via the mouse wheel of a @code{WebGL} image embedded
+within another page is disabled until the image is activated by a
+click or touch event and will remain enabled until the @code{ESC} key
+is pressed.
+
+By default, viewing the 3D @acronym{HTML} files generated by Asymptote requires
+network access to download the @code{AsyGL} rendering library, which
+is normally cached by the browser for future use.
+However, the setting @code{offline=true} can be used to embed this
+small (about 48kB) library within a stand-alone @acronym{HTML} file
+that can be viewed offline.
+
+@cindex @code{antialias}
+@cindex @code{maxviewport}
+@cindex @code{maxtile}
+@cindex @code{glOptions}
+@cindex @code{iconify}
+@cindex @code{black stripes}
+@item Render the scene to a specified rasterized format @code{outformat}
+at the resolution of @code{n} pixels per @code{bp}, as specified by the
+setting @code{render=n}. A negative value of @code{n} is interpreted
+as @code{|2n|} for @acronym{EPS} and @acronym{PDF} formats and
+@code{|n|} for other formats. The default value of @code{render} is -1.
+By default, the scene is internally rendered at twice the specified
+resolution; this can be disabled by setting @code{antialias=1}.
+High resolution rendering is done by tiling the image. If your
+graphics card allows it, the rendering can be made more efficient by
+increasing the maximum tile size @code{maxtile} to your screen
+dimensions (indicated by @code{maxtile=(0,0)}. If your video card
+generates unwanted black stripes in the output, try setting the
+horizontal and vertical components of @code{maxtiles} to something
+less than your screen dimensions. The tile size is also limited by the
+setting @code{maxviewport}, which restricts the maximum width and
+height of the viewport. On @code{UNIX} systems some graphics
+drivers support batch mode (@code{-noV}) rendering in an
+iconified window; this can be enabled with the setting @code{iconify=true}.
+
+@cindex @code{prc}
+@cindex @code{views}
+@item Embed the 3D @acronym{PRC} format in a @acronym{PDF} file
+and view the resulting @acronym{PDF} file with
+version @code{9.0} or later of @code{Adobe Reader}.
+In addition to the default @code{settings.prc=true}, this requires
+@code{settings.outformat="pdf"}, which can be specified by the command
+line option @code{-f pdf}, put in the @code{Asymptote} configuration
+file (@pxref{configuration file}), or specified in the script before
+module @code{three} (or @code{graph3}) is imported.
+The @code{media9} LaTeX package is also required (@pxref{embed}).
+The example @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/100d.html,,100d}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/pdb.asy,,.asy}} illustrates
+how one can generate a list of predefined views (see @code{100d.views}).
+A stationary preview image with a resolution of @code{n} pixels per
+@code{bp} can be embedded with the setting @code{render=n}; this allows
+the file to be viewed with other @code{PDF} viewers. Alternatively, the
+file @code{externalprc.tex} illustrates how the resulting @acronym{PRC} and
+rendered image files can be extracted and processed in a separate
+@code{LaTeX} file. However, see @ref{LaTeX usage} for an easier way
+to embed three-dimensional @code{Asymptote} pictures within @code{LaTeX}.
+For specialized applications where only the raw @acronym{PRC} file is
+required, specify @code{settings.outformat="prc"}.
+The @acronym{PRC} specification is available from
+@url{https://web.archive.org/web/20081204104459/http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/API_References/PRCReference/PRC_Format_Specification/}
+
+@item Project the scene to a two-dimensional vector (@acronym{EPS} or
+@acronym{PDF}) format with @code{render=0}. Only limited hidden surface
+removal facilities are currently available with this approach
+(@pxref{PostScript3D}).
+
+@end enumerate
+
+@cindex @code{double deferred drawing}
+Automatic picture sizing in three dimensions is accomplished with double
+deferred drawing. The maximal desired dimensions of the scene in each of
+the three dimensions can optionally be specified with the routine
+@cindex @code{size3}
+@verbatim
+void size3(picture pic=currentpicture, real x, real y=x, real z=y,
+ bool keepAspect=pic.keepAspect);
+@end verbatim
+@noindent
+@cindex margins
+@cindex @code{viewportmargin}
+@cindex @code{viewportsize}
+A simplex linear programming problem is then solved to
+produce a 3D version of a frame (actually implemented as a 3D picture).
+The result is then fit with another application of deferred drawing
+to the viewport dimensions corresponding to the usual two-dimensional
+picture @code{size} parameters. The global pair @code{viewportmargin}
+may be used to add horizontal and vertical margins to the viewport
+dimensions. Alternatively, a minimum @code{viewportsize} may be specified.
+A 3D picture @code{pic} can be explicitly fit to a 3D frame by calling
+@cindex @code{fit3}
+@verbatim
+frame pic.fit3(projection P=currentprojection);
+@end verbatim
+@noindent
+and then added to picture @code{dest} about @code{position} with
+@cindex @code{add}
+@verbatim
+void add(picture dest=currentpicture, frame src, triple position=(0,0,0));
+@end verbatim
+
+@cindex @code{O}
+@cindex @code{X}
+@cindex @code{Y}
+@cindex @code{Z}
+@cindex @code{unitcircle}
+For convenience, the @code{three} module defines @code{O=(0,0,0)},
+@code{X=(1,0,0)}, @code{Y=(0,1,0)}, and @code{Z=(0,0,1)}, along with a
+unitcircle in the XY plane:
+@verbatim
+path3 unitcircle3=X..Y..-X..-Y..cycle;
+@end verbatim
+
+@cindex @code{circle}
+A general (approximate) circle can be drawn perpendicular to the direction
+@code{normal} with the routine
+@verbatim
+path3 circle(triple c, real r, triple normal=Z);
+@end verbatim
+
+@cindex @code{arc}
+A circular arc centered at @code{c} with radius @code{r} from
+@code{c+r*dir(theta1,phi1)} to @code{c+r*dir(theta2,phi2)},
+drawing counterclockwise relative to the normal vector
+@code{cross(dir(theta1,phi1),dir(theta2,phi2))} if @code{theta2 > theta1}
+or if @code{theta2 == theta1} and @code{phi2 >= phi1}, can be constructed with
+@verbatim
+path3 arc(triple c, real r, real theta1, real phi1, real theta2, real phi2,
+ triple normal=O);
+@end verbatim
+The normal must be explicitly specified if @code{c} and the endpoints
+are colinear. If @code{r} < 0, the complementary arc of radius
+@code{|r|} is constructed.
+For convenience, an arc centered at @code{c} from triple @code{v1} to
+@code{v2} (assuming @code{|v2-c|=|v1-c|}) in the direction CCW
+(counter-clockwise) or CW (clockwise) may also be constructed with
+@verbatim
+path3 arc(triple c, triple v1, triple v2, triple normal=O,
+ bool direction=CCW);
+@end verbatim
+@noindent
+When high accuracy is needed, the routines @code{Circle} and
+@code{Arc} defined in @code{graph3} may be used instead.
+See @ref{GaussianSurface} for an example of a three-dimensional circular arc.
+
+@cindex @code{plane}
+The representation @code{O--O+u--O+u+v--O+v--cycle}
+of the plane passing through point @code{O} with normal
+@code{cross(u,v)} is returned by
+@verbatim
+path3 plane(triple u, triple v, triple O=O);
+@end verbatim
+A three-dimensional box with opposite vertices at triples @code{v1}
+and @code{v2} may be drawn with the function
+@cindex @code{box}
+@verbatim
+path3[] box(triple v1, triple v2);
+@end verbatim
+@noindent
+For example, a unit box is predefined as
+@cindex @code{box}
+@cindex @code{unitbox}
+@verbatim
+path3[] unitbox=box(O,(1,1,1));
+@end verbatim
+@code{Asymptote} also provides optimized definitions for the
+three-dimensional paths @code{unitsquare3} and @code{unitcircle3},
+along with the surfaces @code{unitdisk}, @code{unitplane}, @code{unitcube},
+@code{unitcylinder}, @code{unitcone}, @code{unitsolidcone},
+@code{unitfrustum(real t1, real t2)}, @code{unitsphere}, and
+@code{unithemisphere}.
+
+@noindent
+These projections to two dimensions are predefined:
+@table @code
+@item oblique
+@item oblique(real angle)
+@cindex @code{oblique}
+@cindex @code{obliqueZ}
+The point @code{(x,y,z)} is projected to @code{(x-0.5z,y-0.5z)}.
+If an optional real argument is given, the
+negative @math{z} axis is drawn at this angle in degrees.
+The projection @code{obliqueZ} is a synonym for @code{oblique}.
+
+@item obliqueX
+@item obliqueX(real angle)
+@cindex @code{obliqueX}
+The point @code{(x,y,z)} is projected to @code{(y-0.5x,z-0.5x)}.
+If an optional real argument is given, the
+negative @math{x} axis is drawn at this angle in degrees.
+
+@item obliqueY
+@item obliqueY(real angle)
+@cindex @code{obliqueY}
+The point @code{(x,y,z)} is projected to @code{(x+0.5y,z+0.5y)}.
+If an optional real argument is given, the
+positive @math{y} axis is drawn at this angle in degrees.
+
+@cindex @code{orthographic}
+@cindex @code{up}
+@cindex @code{target}
+@cindex @code{showtarget}
+@cindex @code{center}
+@item orthographic(triple camera, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ @ real zoom=1, pair viewportshift=0, bool showtarget=true, @*@ @ @ @ @ @ @ @ @ @ @ @ @ bool center=false)
+This projects from three to two dimensions using the view as seen at a point
+infinitely far away in the direction @code{unit(camera)}, orienting the camera
+so that, if possible, the vector @code{up} points upwards. Parallel
+lines are projected to parallel lines. The bounding volume is expanded
+to include @code{target} if @code{showtarget=true}.
+If @code{center=true}, the target will be adjusted to the center of the
+bounding volume.
+
+@item orthographic(real x, real y, real z, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ @ real zoom=1, pair viewportshift=0, bool showtarget=true, @*@ @ @ @ @ @ @ @ @ @ @ @ @ bool center=false)
+This is equivalent to
+@verbatim
+orthographic((x,y,z),up,target,zoom,viewportshift,showtarget,center)
+@end verbatim
+
+The routine
+@cindex @code{camera}
+@verbatim
+triple camera(real alpha, real beta);
+@end verbatim
+can be used to compute the camera position with the @math{x} axis below
+the horizontal at angle @code{alpha}, the @math{y} axis below the horizontal
+at angle @code{beta}, and the @math{z} axis up.
+
+@cindex @code{autoadjust}
+@item perspective(triple camera, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ real zoom=1, real angle=0, pair viewportshift=0, @*@ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, @*@ @ @ @ @ @ @ @ @ @ @ @ bool center=autoadjust)
+@cindex @code{perspective}
+@cindex @code{NURBS}
+This projects from three to two dimensions, taking account of
+perspective, as seen from the location @code{camera} looking at @code{target},
+orienting the camera so that, if possible, the vector @code{up} points upwards.
+If @code{render=0}, projection of three-dimensional cubic Bezier splines
+is implemented by approximating a two-dimensional nonuniform rational B-spline
+(@acronym{NURBS}) with a two-dimensional Bezier curve containing
+additional nodes and control points. If @code{autoadjust=true},
+the camera will automatically be adjusted to lie outside the bounding volume
+for all possible interactive rotations about @code{target}.
+If @code{center=true}, the target will be adjusted to the center of the
+bounding volume.
+
+@item perspective(real x, real y, real z, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ real zoom=1, real angle=0, pair viewportshift=0, @*@ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, @*@ @ @ @ @ @ @ @ @ @ @ @ bool center=autoadjust)
+This is equivalent to
+@verbatim
+perspective((x,y,z),up,target,zoom,angle,viewportshift,showtarget,
+ autoadjust,center)
+@end verbatim
+@end table
+
+@cindex @code{currentprojection}
+@noindent
+The default projection, @code{currentprojection}, is initially set to
+@code{perspective(5,4,2)}.
+
+@cindex @code{LeftView}
+@cindex @code{RightView}
+@cindex @code{FrontView}
+@cindex @code{BackView}
+@cindex @code{BottomView}
+@cindex @code{TopView}
+We also define standard orthographic views used in technical drawing:
+@verbatim
+projection LeftView=orthographic(-X,showtarget=true);
+projection RightView=orthographic(X,showtarget=true);
+projection FrontView=orthographic(-Y,showtarget=true);
+projection BackView=orthographic(Y,showtarget=true);
+projection BottomView=orthographic(-Z,showtarget=true);
+projection TopView=orthographic(Z,showtarget=true);
+@end verbatim
+@noindent
+The function
+@cindex @code{addViews}
+@verbatim
+void addViews(picture dest=currentpicture, picture src,
+ projection[][] views=SixViewsUS,
+ bool group=true, filltype filltype=NoFill);
+@end verbatim
+@noindent
+adds to picture @code{dest} an array of views of picture @code{src}
+using the layout projection[][] @code{views}. The default layout
+@code{SixViewsUS} aligns the projection @code{FrontView} below
+@code{TopView} and above @code{BottomView}, to the right of
+@code{LeftView} and left of @code{RightView} and @code{BackView}.
+The predefined layouts are:
+@cindex @code{ThreeViewsUS}
+@cindex @code{SixViewsUS}
+@cindex @code{ThreeViewsFR}
+@cindex @code{SixViewsFR}
+@cindex @code{ThreeViews}
+@cindex @code{SixViews}
+@verbatim
+projection[][] ThreeViewsUS={{TopView},
+ {FrontView,RightView}};
+
+projection[][] SixViewsUS={{null,TopView},
+ {LeftView,FrontView,RightView,BackView},
+ {null,BottomView}};
+
+projection[][] ThreeViewsFR={{RightView,FrontView},
+ {null,TopView}};
+
+projection[][] SixViewsFR={{null,BottomView},
+ {RightView,FrontView,LeftView,BackView},
+ {null,TopView}};
+
+projection[][] ThreeViews={{FrontView,TopView,RightView}};
+
+projection[][] SixViews={{FrontView,TopView,RightView},
+ {BackView,BottomView,LeftView}};
+
+@end verbatim
+
+A triple or path3 can be projected to a pair or path,
+with @code{project(triple, projection P=currentprojection)} or
+@code{project(path3, projection P=currentprojection)}.
+
+It is occasionally useful to be able to invert a projection, sending
+a pair @code{z} onto the plane perpendicular to @code{normal} and passing
+through @code{point}:
+@cindex @code{invert}
+@verbatim
+triple invert(pair z, triple normal, triple point,
+ projection P=currentprojection);
+@end verbatim
+@noindent
+A pair @code{z} on the projection plane can be inverted to a triple
+with the routine
+@verbatim
+triple invert(pair z, projection P=currentprojection);
+@end verbatim
+@noindent
+A pair direction @code{dir} on the projection plane can be inverted to
+a triple direction relative to a point @code{v} with the routine
+@verbatim
+triple invert(pair dir, triple v, projection P=currentprojection).
+@end verbatim
+
+@cindex @code{transform3}
+@cindex @code{identity4}
+Three-dimensional objects may be transformed with one of the following
+built-in transform3 types (the identity transformation is @code{identity4}):
+
+@table @code
+@item shift(triple v)
+@cindex @code{shift}
+translates by the triple @code{v};
+@item xscale3(real x)
+@cindex @code{xscale3}
+scales by @code{x} in the @math{x} direction;
+@item yscale3(real y)
+@cindex @code{yscale3}
+scales by @code{y} in the @math{y} direction;
+@item zscale3(real z)
+@cindex @code{zscale3}
+scales by @code{z} in the @math{z} direction;
+@item scale3(real s)
+@cindex @code{scale3}
+scales by @code{s} in the @math{x}, @math{y}, and @math{z} directions;
+@item scale(real x, real y, real z)
+@cindex @code{scale}
+scales by @code{x} in the @math{x} direction,
+by @code{y} in the @math{y} direction, and by @code{z} in the @math{z}
+direction;
+@cindex @code{rotate}
+@item rotate(real angle, triple v)
+rotates by @code{angle} in degrees about an axis @code{v} through the origin;
+@item rotate(real angle, triple u, triple v)
+rotates by @code{angle} in degrees about the axis @code{u--v};
+@item reflect(triple u, triple v, triple w)
+reflects about the plane through @code{u}, @code{v}, and @code{w}.
+@cindex @code{XY}
+@end table
+
+When not multiplied on the left by a transform3, three-dimensional
+@TeX{} Labels are drawn as Bezier surfaces directly on the projection plane:
+@cindex @code{label}
+@verbatim
+void label(picture pic=currentpicture, Label L, triple position,
+ align align=NoAlign, pen p=currentpen,
+ light light=nolight, string name="",
+ render render=defaultrender, interaction interaction=
+ settings.autobillboard ? Billboard : Embedded)
+@end verbatim
+@noindent
+@cindex @code{Billboard}
+@cindex @code{Embedded}
+The optional @code{name} parameter is used as a prefix for naming the label
+patches in the @acronym{PRC} model tree.
+The default interaction is @code{Billboard}, which means that labels
+are rotated interactively so that they always face the camera.
+The interaction @code{Embedded} means that the label interacts as a
+normal @code{3D} surface, as illustrated in the example @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/billboard.html,,billboard}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/billboard.asy,,.asy}}.
+@cindex @code{transform}
+@cindex @code{XY}
+@cindex @code{YZ}
+@cindex @code{ZX}
+@cindex @code{YX}
+@cindex @code{ZY}
+@cindex @code{ZX}
+Alternatively, a label can be transformed from the @code{XY} plane by an
+explicit transform3 or mapped to a specified two-dimensional plane with
+the predefined transform3 types @code{XY}, @code{YZ}, @code{ZX}, @code{YX},
+@code{ZY}, @code{ZX}. There are also modified versions of these
+transforms that take an optional argument @code{projection
+P=currentprojection} that rotate and/or flip the label so that it is
+more readable from the initial viewpoint.
+
+@cindex @code{planeproject}
+A transform3 that projects in the direction @code{dir} onto the plane
+with normal @code{n} through point @code{O} is returned by
+@verbatim
+transform3 planeproject(triple n, triple O=O, triple dir=n);
+@end verbatim
+@noindent
+One can use
+@cindex @code{normal}
+@verbatim
+triple normal(path3 p);
+@end verbatim
+@noindent
+to find the unit normal vector to a planar three-dimensional path @code{p}.
+As illustrated in the example @code{@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/planeproject.html,,planeproject}@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/planeproject.asy,,.asy}}, a transform3
+that projects in the direction @code{dir} onto the plane defined by a
+planar path @code{p} is returned by
+@verbatim
+transform3 planeproject(path3 p, triple dir=normal(p));
+@end verbatim
+
+The functions
+@cindex @code{extrude}
+@verbatim
+surface extrude(path p, triple axis=Z);
+surface extrude(Label L, triple axis=Z);
+@end verbatim
+@noindent
+return the surface obtained by extruding path @code{p} or
+Label @code{L} along @code{axis}.
+
+@cindex @code{length}
+@cindex @code{size}
+@cindex @code{point}
+@cindex @code{dir}
+@cindex @code{accel}
+@cindex @code{radius}
+@cindex @code{precontrol}
+@cindex @code{postcontrol}
+@cindex @code{arclength}
+@cindex @code{arctime}
+@cindex @code{reverse}
+@cindex @code{subpath}
+@cindex @code{intersect}
+@cindex @code{intersections}
+@cindex @code{intersectionpoint}
+@cindex @code{intersectionpoints}
+@cindex @code{min}
+@cindex @code{max}
+@cindex @code{cyclic}
+@cindex @code{straight}
+Three-dimensional versions of the path functions @code{length},
+@code{size}, @code{point}, @code{dir}, @code{accel}, @code{radius},
+@code{precontrol}, @code{postcontrol},
+@code{arclength}, @code{arctime}, @code{reverse}, @code{subpath},
+@code{intersect}, @code{intersections}, @code{intersectionpoint},
+@code{intersectionpoints}, @code{min}, @code{max}, @code{cyclic}, and
+@code{straight} are also defined.
+
+The routine
+@cindex @code{intersections}
+@verbatim
+real[] intersect(path3 p, surface s, real fuzz=-1);
+@end verbatim
+@noindent
+returns a real array of length 3 containing the intersection times, if any,
+of a path @code{p} with a surface @code{s}.
+The routine
+@verbatim
+real[][] intersections(path3 p, surface s, real fuzz=-1);
+@end verbatim
+@noindent
+returns all (unless there are infinitely many) intersection times of a
+path @code{p} with a surface @code{s} as a sorted array of real arrays
+of length 3, and
+@cindex @code{intersectionpoints}
+@verbatim
+triple[] intersectionpoints(path3 p, surface s, real fuzz=-1);
+@end verbatim
+@noindent
+returns the corresponding intersection points.
+Here, the computations are performed to the absolute error specified by
+@code{fuzz}, or if @code{fuzz < 0}, to machine precision.
+The routine
+@cindex @code{orient}
+@verbatim
+real orient(triple a, triple b, triple c, triple d);
+@end verbatim
+@noindent
+is a numerically robust computation of @code{dot(cross(a-d,b-d),c-d)},
+which is the determinant
+@verbatim
+|a.x a.y a.z 1|
+|b.x b.y b.z 1|
+|c.x c.y c.z 1|
+|d.x d.y d.z 1|
+@end verbatim
+The result is negative (positive) if @code{a}, @code{b}, @code{c} appear in
+counterclockwise (clockwise) order when viewed from @code{d} or zero
+if all four points are coplanar.
+
+The routine
+@cindex @code{insphere}
+@verbatim
+real insphere(triple a, triple b, triple c, triple d, triple e);
+@end verbatim
+@noindent
+returns a positive (negative) value if @code{e} lies inside (outside)
+the sphere passing through points @code{a,b,c,d} oriented so that
+@code{dot(cross(a-d,b-d),c-d)} is positive,
+or zero if all five points are cospherical.
+The value returned is the determinant
+@verbatim
+|a.x a.y a.z a.x^2+a.y^2+a.z^2 1|
+|b.x b.y b.z b.x^2+b.y^2+b.z^2 1|
+|c.x c.y c.z c.x^2+c.y^2+c.z^2 1|
+|d.x d.y d.z d.x^2+d.y^2+d.z^2 1|
+|e.x e.y e.z e.x^2+e.y^2+e.z^2 1|
+@end verbatim
+
+Here is an example showing all five guide3 connectors:
+@verbatiminclude join3.asy
+@sp 1
+@center @image{./join3}
+
+@cindex @code{BeginBar3}
+@cindex @code{EndBar3}
+@cindex @code{Bar3}
+@cindex @code{Bars3}
+@cindex @code{BeginArrow3}
+@cindex @code{MidArrow3}
+@cindex @code{EndArrow3}
+@cindex @code{Arrow3}
+@cindex @code{Arrows3}
+@cindex @code{BeginArcArrow3}
+@cindex @code{MidArcArrow3}
+@cindex @code{EndArcArrow3}
+@cindex @code{ArcArrow3}
+@cindex @code{ArcArrows3}
+@cindex @code{DefaultHead3}
+@cindex @code{HookHead3}
+@cindex @code{TeXHead3}
+Three-dimensional versions of bars or arrows can be drawn with one of
+the specifiers @code{None}, @code{Blank},
+@code{BeginBar3}, @code{EndBar3} (or equivalently @code{Bar3}), @code{Bars3},
+@code{BeginArrow3}, @code{MidArrow3},
+@code{EndArrow3} (or equivalently @code{Arrow3}), @code{Arrows3},
+@code{BeginArcArrow3}, @code{EndArcArrow3} (or equivalently
+@code{ArcArrow3}), @code{MidArcArrow3}, and @code{ArcArrows3}.
+Three-dimensional bars accept the optional arguments @code{(real size=0,
+triple dir=O)}. If @code{size=O}, the default bar length is used; if
+@code{dir=O}, the bar is drawn perpendicular to the path
+and the initial viewing direction. The predefined three-dimensional
+arrowhead styles are @code{DefaultHead3}, @code{HookHead3}, @code{TeXHead3}.
+Versions of the two-dimensional arrowheads lifted to three-dimensional
+space and aligned according to the initial viewpoint (or an optionally
+specified @code{normal} vector) are also defined:
+@code{DefaultHead2(triple normal=O)}, @code{HookHead2(triple normal=O)},
+@code{TeXHead2(triple normal=O)}. These are illustrated in the example
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/arrows3.html,,arrows3}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/arrows3.asy,,.asy}}.
+
+@cindex @code{NoMargin3}
+@cindex @code{BeginMargin3}
+@cindex @code{EndMargin3}
+@cindex @code{Margin3}
+@cindex @code{Margins3}
+@cindex @code{BeginPenMargin2}
+@cindex @code{EndPenMargin2}
+@cindex @code{PenMargin2}
+@cindex @code{PenMargins2}
+@cindex @code{BeginPenMargin3}
+@cindex @code{EndPenMargin3}
+@cindex @code{PenMargin3}
+@cindex @code{PenMargins3}
+@cindex @code{BeginDotMargin3}
+@cindex @code{EndDotMargin3}
+@cindex @code{DotMargin3}
+@cindex @code{DotMargins3}
+@cindex @code{Margin3}
+@cindex @code{TrueMargin3}
+Module @code{three} also defines the three-dimensional margins
+@code{NoMargin3}, @code{BeginMargin3}, @code{EndMargin3},
+@code{Margin3}, @code{Margins3},
+@code{BeginPenMargin2}, @code{EndPenMargin2}, @code{PenMargin2},
+@code{PenMargins2},
+@code{BeginPenMargin3}, @code{EndPenMargin3}, @code{PenMargin3},
+@code{PenMargins3},
+@code{BeginDotMargin3}, @code{EndDotMargin3}, @code{DotMargin3},
+@code{DotMargins3}, @code{Margin3}, and @code{TrueMargin3}.
+
+@cindex @code{pixel}
+The routine
+@verbatim
+void pixel(picture pic=currentpicture, triple v, pen p=currentpen,
+ real width=1);
+@end verbatim
+@noindent
+can be used to draw on picture @code{pic} a pixel of width @code{width} at
+position @code{v} using pen @code{p}.
+
+Further three-dimensional examples are provided in the files
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/near_earth.html,,near_earth}@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/near_earth.asy,,.asy}}, @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/conicurv.html,,conicurv}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/conicurv.asy,,.asy}}, and (in the @code{animations}
+subdirectory) @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/cube.html,,cube}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/cube.asy,,.asy}}.
+
+@anchor{PostScript3D}
+@cindex 3D @code{PostScript}
+Limited support for projected vector graphics (effectively three-dimensional
+nonrendered @code{PostScript}) is available with the setting
+@code{render=0}. This currently only works for piecewise planar
+surfaces, such as those produced by the parametric @code{surface}
+routines in the @code{graph3} module. Surfaces produced by the
+@code{solids} module will also be properly rendered if the parameter
+@code{nslices} is sufficiently large.
+
+@cindex hidden surface removal
+@cindex @code{face}
+In the module @code{bsp}, hidden surface removal of planar pictures is
+implemented using a binary space partition and picture clipping.
+A planar path is first converted to a structure @code{face} derived from
+@code{picture}. A @code{face} may be given to a two-dimensional drawing
+routine in place of any @code{picture} argument. An array of such faces
+may then be drawn, removing hidden surfaces:
+@verbatim
+void add(picture pic=currentpicture, face[] faces,
+ projection P=currentprojection);
+@end verbatim
+Labels may be projected to two dimensions, using projection @code{P},
+onto the plane passing through point @code{O} with normal
+@code{cross(u,v)} by multiplying it on the left by the transform
+@verbatim
+transform transform(triple u, triple v, triple O=O,
+ projection P=currentprojection);
+@end verbatim
+
+Here is an example that shows how a binary space partition may be used to draw a
+two-dimensional vector graphics projection of three orthogonal
+intersecting planes:
+@verbatiminclude planes.asy
+@sp 1
+@center @image{./planes}
+
+@node obj, graph3, three, Base modules
+@section @code{obj}
+@cindex @code{obj}
+This module allows one to construct surfaces from simple obj files,
+as illustrated in the example files @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/galleon.html,,galleon}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/galleon.asy,,.asy}} and
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/triceratops.html,,triceratops}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/triceratops.asy,,.asy}}.
+
+@node graph3, grid3, obj, Base modules
+@section @code{graph3}
+@cindex @code{graph3}
+@cindex 3D graphs
+This module implements three-dimensional versions of the
+functions in @code{graph.asy}.
+@cindex @code{xaxis3}
+@cindex @code{yaxis3}
+@cindex @code{zaxis3}
+@noindent
+To draw an @math{x} axis in three dimensions, use the routine
+@verbatim
+void xaxis3(picture pic=currentpicture, Label L="", axis axis=YZZero,
+ real xmin=-infinity, real xmax=infinity, pen p=currentpen,
+ ticks3 ticks=NoTicks3, arrowbar3 arrow=None, bool above=false);
+@end verbatim
+@noindent
+Analogous routines @code{yaxis} and @code{zaxis} can be used to draw
+@math{y} and @math{z} axes in three dimensions.
+There is also a routine for drawing all three axis:
+@verbatim
+void axes3(picture pic=currentpicture,
+ Label xlabel="", Label ylabel="", Label zlabel="",
+ bool extend=false,
+ triple min=(-infinity,-infinity,-infinity),
+ triple max=(infinity,infinity,infinity),
+ pen p=currentpen, arrowbar3 arrow=None);
+@end verbatim
+
+@cindex @code{YZEquals}
+@cindex @code{XZEquals}
+@cindex @code{XYEquals}
+@cindex @code{YZZero}
+@cindex @code{XZZero}
+@cindex @code{XYZero}
+@cindex @code{Bounds}
+@noindent
+The predefined three-dimensional axis types are
+@verbatim
+axis YZEquals(real y, real z, triple align=O, bool extend=false);
+axis XZEquals(real x, real z, triple align=O, bool extend=false);
+axis XYEquals(real x, real y, triple align=O, bool extend=false);
+axis YZZero(triple align=O, bool extend=false);
+axis XZZero(triple align=O, bool extend=false);
+axis XYZero(triple align=O, bool extend=false);
+axis Bounds(int type=Both, int type2=Both, triple align=O, bool extend=false);
+@end verbatim
+@noindent
+The optional @code{align} parameter to these routines can be used to
+specify the default axis and tick label alignments. The @code{Bounds}
+axis accepts two type parameters, each of which must be one of
+@code{Min}, @code{Max}, or @code{Both}. These parameters specify which
+of the four possible three-dimensional bounding box edges should be drawn.
+
+@cindex @code{NoTicks3}
+@cindex @code{InTicks}
+@cindex @code{OutTicks}
+@cindex @code{InOutTicks}
+The three-dimensional tick options are @code{NoTicks3}, @code{InTicks},
+@code{OutTicks}, and @code{InOutTicks}. These specify the tick
+directions for the @code{Bounds} axis type; other axis types inherit
+the direction that would be used for the @code{Bounds(Min,Min)} axis.
+
+Here is an example of a helix and bounding box axes with ticks
+and axis labels, using orthographic projection:
+@verbatiminclude helix.asy
+@sp 1
+@center @image{./helix}
+
+The next example illustrates three-dimensional @math{x}, @math{y}, and
+@math{z} axes, without autoscaling of the axis limits:
+@cindex @code{axis}
+@verbatiminclude axis3.asy
+@sp 1
+@center @image{./axis3}
+
+One can also place ticks along a general three-dimensional axis:
+@cindex @code{axis}
+@verbatiminclude generalaxis3.asy
+@sp 1
+@center @image{./generalaxis3}
+
+@cindex @code{surface}
+@cindex @code{Spline}
+@cindex parametric surface
+Surface plots of matrices and functions over the region
+@code{box(a,b)} in the @math{XY} plane are also implemented:
+@verbatim
+surface surface(real[][] f, pair a, pair b, bool[][] cond={});
+surface surface(real[][] f, pair a, pair b, splinetype xsplinetype,
+ splinetype ysplinetype=xsplinetype, bool[][] cond={});
+surface surface(real[][] f, real[] x, real[] y,
+ splinetype xsplinetype=null, splinetype ysplinetype=xsplinetype,
+ bool[][] cond={})
+surface surface(triple[][] f, bool[][] cond={});
+surface surface(real f(pair z), pair a, pair b, int nx=nmesh, int ny=nx,
+ bool cond(pair z)=null);
+surface surface(real f(pair z), pair a, pair b, int nx=nmesh, int ny=nx,
+ splinetype xsplinetype, splinetype ysplinetype=xsplinetype,
+ bool cond(pair z)=null);
+surface surface(triple f(pair z), real[] u, real[] v,
+ splinetype[] usplinetype, splinetype[] vsplinetype=Spline,
+ bool cond(pair z)=null);
+surface surface(triple f(pair z), pair a, pair b, int nu=nmesh, int nv=nu,
+ bool cond(pair z)=null);
+surface surface(triple f(pair z), pair a, pair b, int nu=nmesh, int nv=nu,
+ splinetype[] usplinetype, splinetype[] vsplinetype=Spline,
+ bool cond(pair z)=null);
+@end verbatim
+@noindent
+The final two versions draw parametric surfaces for a function
+@math{f(u,v)} over the parameter space @code{box(a,b)},
+as illustrated in the example @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/parametricsurface.html,,parametricsurface}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/parametricsurface.asy,,.asy}}.
+An optional splinetype @code{Spline} may be specified.
+The boolean array or function @code{cond} can be used to control which
+surface mesh cells are actually drawn (by default all mesh cells over
+@code{box(a,b)} are drawn).
+Surface lighting is illustrated in the example files
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/parametricsurface.html,,parametricsurface}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/parametricsurface.asy,,.asy}} and @code{@uref{https://asymptote.sourceforge.io/gallery/3D graphs/sinc.html,,sinc}@uref{https://asymptote.sourceforge.io/gallery/3D graphs/sinc.asy,,.asy}}.
+Lighting can be disabled by setting @code{light=nolight}, as in this example
+of a Gaussian surface:
+@anchor{GaussianSurface}
+@verbatiminclude GaussianSurface.asy
+@sp 1
+@center @image{./GaussianSurface}
+@noindent
+A mesh can be drawn without surface filling by specifying @code{nullpen}
+for the surfacepen.
+
+A vector field of @code{nu}@math{\times}@code{nv} arrows on a
+parametric surface @code{f} over @code{box(a,b)} can be drawn with the routine
+@cindex @code{vectorfield3}
+@verbatim
+picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b,
+ int nu=nmesh, int nv=nu, bool truesize=false,
+ real maxlength=truesize ? 0 : maxlength(f,a,b,nu,nv),
+ bool cond(pair z)=null, pen p=currentpen,
+ arrowbar3 arrow=Arrow3, margin3 margin=PenMargin3)
+@end verbatim
+as illustrated in the examples @code{@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/vectorfield3.html,,vectorfield3}@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/vectorfield3.asy,,.asy}} and
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/vectorfieldsphere.html,,vectorfieldsphere}@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/vectorfieldsphere.asy,,.asy}}.
+
+@node grid3, solids, graph3, Base modules
+@section @code{grid3}
+@cindex @code{grid3}
+@cindex 3D grids
+
+This module, contributed by Philippe Ivaldi, can be used for drawing
+3D grids. Here is an example (further examples can be found in
+@code{grid3.asy} and at @url{http://www.piprime.fr/files/asymptote/grid3/}):
+@verbatiminclude grid3xyz.asy
+@sp 1
+@center @image{./grid3xyz}
+
+@node solids, tube, grid3, Base modules
+@section @code{solids}
+@cindex @code{solids}
+This solid geometry module defines a structure @code{revolution} that
+can be used to fill and draw surfaces of revolution. The following example
+uses it to display the outline of a circular cylinder of radius 1
+with axis @code{O--1.5unit(Y+Z)} with perspective projection:
+@verbatiminclude cylinderskeleton.asy
+@sp 1
+@center @image{./cylinderskeleton}
+
+Further illustrations are provided in the example files @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/cylinder.html,,cylinder}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/cylinder.asy,,.asy}},
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/cones.html,,cones}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/cones.asy,,.asy}}, @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/hyperboloid.html,,hyperboloid}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/hyperboloid.asy,,.asy}}, and @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/torus.html,,torus}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/torus.asy,,.asy}}.
+
+The structure @code{skeleton} contains the three-dimensional wireframe
+used to visualize a volume of revolution:
+@verbatim
+struct skeleton {
+ struct curve {
+ path3[] front;
+ path3[] back;
+ }
+ // transverse skeleton (perpendicular to axis of revolution)
+ curve transverse;
+ // longitudinal skeleton (parallel to axis of revolution)
+ curve longitudinal;
+}
+@end verbatim
+
+@node tube, flowchart, solids, Base modules
+@section @code{tube}
+@cindex @code{tube}
+This module extends the @code{tube} surfaces constructed in
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/three_arrows.html,,three_arrows}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/three_arrows.asy,,.asy}} to arbitrary cross sections, colors, and spine
+transformations. The routine
+@verbatim
+surface tube(path3 g, coloredpath section,
+ transform T(real)=new transform(real t) {return identity();},
+ real corner=1, real relstep=0);
+@end verbatim
+@noindent
+draws a tube along @code{g} with cross section @code{section}, after
+applying the transformation @code{T(t)} at @code{point(g,t)}.
+The parameter @code{corner} controls the number of elementary tubes at
+the angular points of @code{g}. A nonzero value of @code{relstep}
+specifies a fixed relative time step (in the sense of
+@code{relpoint(g,t)}) to use in constructing elementary tubes along @code{g}.
+The type @code{coloredpath} is a generalization of @code{path} to
+which a @code{path} can be cast:
+@cindex @code{coloredpath}
+@verbatim
+struct coloredpath
+{
+ path p;
+ pen[] pens(real);
+ int colortype=coloredSegments;
+}
+@end verbatim
+@noindent
+@cindex @code{coloredSegments}
+@cindex @code{coloredNodes}
+Here @code{p} defines the cross section and
+the method @code{pens(real t)} returns an array of pens (interpreted
+as a cyclic array) used for shading the tube patches at
+@code{relpoint(g,t)}. If @code{colortype=coloredSegments}, the tube patches
+are filled as if each segment of the section was colored with the pen
+returned by @code{pens(t)}, whereas if @code{colortype=coloredNodes}, the
+tube components are vertex shaded as if the nodes of the section were colored.
+
+A @code{coloredpath} can be constructed with one of the routines:
+@verbatim
+coloredpath coloredpath(path p, pen[] pens(real),
+ int colortype=coloredSegments);
+coloredpath coloredpath(path p, pen[] pens=new pen[] {currentpen},
+ int colortype=coloredSegments);
+coloredpath coloredpath(path p, pen pen(real));
+@end verbatim
+@noindent
+In the second case, the pens are independent of the relative time.
+In the third case, the array of pens contains only one pen, which
+depends of the relative time.
+
+The casting of @code{path} to @code{coloredpath} allows the
+use of a @code{path} instead of a @code{coloredpath}; in this case the
+shading behaviour is the default shading behavior for a surface.
+
+An example of @code{tube} is provided in the file
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/trefoilknot.html,,trefoilknot}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/trefoilknot.asy,,.asy}}. Further examples can be found at
+@url{http://www.piprime.fr/files/asymptote/tube/}.
+
+@node flowchart, contour, tube, Base modules
+@section @code{flowchart}
+@cindex @code{flowchart}
+This module provides routines for drawing flowcharts. The primary
+structure is a @code{block}, which represents a single block on the
+flowchart. The following eight functions return a position on the appropriate
+edge of the block, given picture transform @code{t}:
+
+@verbatim
+pair block.top(transform t=identity());
+pair block.left(transform t=identity());
+pair block.right(transform t=identity());
+pair block.bottom(transform t=identity());
+pair block.topleft(transform t=identity());
+pair block.topright(transform t=identity());
+pair block.bottomleft(transform t=identity());
+pair block.bottomright(transform t=identity());
+@end verbatim
+@cindex @code{block.top}
+@cindex @code{block.left}
+@cindex @code{block.right}
+@cindex @code{block.bottom}
+@cindex @code{block.topleft}
+@cindex @code{block.topright}
+@cindex @code{block.bottomleft}
+@cindex @code{block.bottomright}
+
+@noindent
+To obtain an arbitrary position along the boundary of the block in user
+coordinates, use:
+@verbatim
+pair block.position(real x, transform t=identity());
+@end verbatim
+@cindex @code{block.position}
+
+@noindent
+@cindex @code{block.center}
+The center of the block in user coordinates is stored in
+@code{block.center} and the block size in @code{PostScript} coordinates
+is given by @code{block.size}.
+
+@noindent
+A frame containing the block is returned by
+@verbatim
+frame block.draw(pen p=currentpen);
+@end verbatim
+@cindex @code{block.draw}
+
+The following block generation routines accept a Label, string, or
+frame for their object argument:
+
+@table @dfn
+@item rectangular block with an optional header (and padding @code{dx} around header and body):
+@cindex @code{rectangle}
+@verbatim
+block rectangle(object header, object body, pair center=(0,0),
+ pen headerpen=mediumgray, pen bodypen=invisible,
+ pen drawpen=currentpen,
+ real dx=3, real minheaderwidth=minblockwidth,
+ real minheaderheight=minblockwidth,
+ real minbodywidth=minblockheight,
+ real minbodyheight=minblockheight);
+block rectangle(object body, pair center=(0,0),
+ pen fillpen=invisible, pen drawpen=currentpen,
+ real dx=3, real minwidth=minblockwidth,
+ real minheight=minblockheight);
+@end verbatim
+
+@item parallelogram block:
+@cindex @code{parallelogram}
+@verbatim
+block parallelogram(object body, pair center=(0,0),
+ pen fillpen=invisible, pen drawpen=currentpen,
+ real dx=3, real slope=2,
+ real minwidth=minblockwidth,
+ real minheight=minblockheight);
+@end verbatim
+
+@item diamond-shaped block:
+@cindex @code{diamond}
+@verbatim
+block diamond(object body, pair center=(0,0),
+ pen fillpen=invisible, pen drawpen=currentpen,
+ real ds=5, real dw=1,
+ real height=20, real minwidth=minblockwidth,
+ real minheight=minblockheight);
+@end verbatim
+
+@item circular block:
+@cindex @code{circle}
+@verbatim
+block circle(object body, pair center=(0,0), pen fillpen=invisible,
+ pen drawpen=currentpen, real dr=3,
+ real mindiameter=mincirclediameter);
+@end verbatim
+
+@item rectangular block with rounded corners:
+@cindex @code{roundrectangle}
+@verbatim
+block roundrectangle(object body, pair center=(0,0),
+ pen fillpen=invisible, pen drawpen=currentpen,
+ real ds=5, real dw=0, real minwidth=minblockwidth,
+ real minheight=minblockheight);
+@end verbatim
+
+@item rectangular block with beveled edges:
+@cindex @code{bevel}
+@verbatim
+block bevel(object body, pair center=(0,0), pen fillpen=invisible,
+ pen drawpen=currentpen, real dh=5, real dw=5,
+ real minwidth=minblockwidth, real minheight=minblockheight);
+@end verbatim
+
+@end table
+
+To draw paths joining the pairs in @code{point} with right-angled lines,
+use the routine:
+@cindex @code{path}
+@cindex @code{Horizontal}
+@cindex @code{Vertical}
+@verbatim
+path path(pair point[] ... flowdir dir[]);
+@end verbatim
+@noindent
+The entries in @code{dir} identify whether successive
+segments between the pairs specified by @code{point} should be drawn
+in the @code{Horizontal} or @code{Vertical} direction.
+
+Here is a simple flowchart example (see also the example
+@code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/controlsystem.html,,controlsystem}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/controlsystem.asy,,.asy}}):
+
+@verbatiminclude flowchartdemo.asy
+@sp 1
+@center @image{./flowchartdemo}
+
+@node contour, contour3, flowchart, Base modules
+@section @code{contour}
+@cindex @code{contour}
+This module draws contour lines.
+To construct contours corresponding to the values in a real array @code{c}
+for a function @code{f} on @code{box(a,b)}, use the routine
+@verbatim
+guide[][] contour(real f(real, real), pair a, pair b,
+ real[] c, int nx=ngraph, int ny=nx,
+ interpolate join=operator --, int subsample=1);
+@end verbatim
+@noindent
+The integers @code{nx} and @code{ny} define the resolution.
+The default resolution, @code{ngraph x ngraph} (here @code{ngraph}
+defaults to @code{100}) can be increased for greater accuracy.
+The default interpolation operator is @code{operator --} (linear). Spline
+interpolation (@code{operator ..}) may produce smoother
+contours but it can also lead to overshooting.
+The @code{subsample} parameter indicates the number of interior points
+that should be used to sample contours within each @code{1 x 1} box;
+the default value of @code{1} is usually sufficient.
+
+To construct contours for an array of data values on a uniform
+two-dimensional lattice on @code{box(a,b)}, use
+@verbatim
+guide[][] contour(real[][] f, pair a, pair b, real[] c,
+ interpolate join=operator --, int subsample=1);
+@end verbatim
+
+To construct contours for an array of data values on a nonoverlapping
+regular mesh specified by the two-dimensional array @code{z},
+@verbatim
+guide[][] contour(pair[][] z, real[][] f, real[] c,
+ interpolate join=operator --, int subsample=1);
+
+@end verbatim
+@noindent
+To construct contours for an array of values @code{f} specified at
+irregularly positioned points @code{z}, use the routine
+@verbatim
+guide[][] contour(pair[] z, real[] f, real[] c, interpolate join=operator --);
+@end verbatim
+@noindent
+The contours themselves can be drawn with one of the routines
+@verbatim
+void draw(picture pic=currentpicture, Label[] L=new Label[],
+ guide[][] g, pen p=currentpen);
+
+void draw(picture pic=currentpicture, Label[] L=new Label[],
+ guide[][] g, pen[] p);
+@end verbatim
+
+The following simple example draws the contour at value @code{1}
+for the function @math{z=x^2+y^2}, which is a unit circle:
+@verbatiminclude onecontour.asy
+@sp 1
+@center @image{./onecontour}
+
+The next example draws and labels multiple contours for the function
+@math{z=x^2-y^2} with the resolution @code{100 x 100}, using a dashed
+pen for negative contours and a solid pen for positive (and zero) contours:
+@verbatiminclude multicontour.asy
+@sp 1
+@center @image{./multicontour}
+
+The next example illustrates how contour lines can be drawn on color
+density images:
+@verbatiminclude imagecontour.asy
+@sp 1
+@center @image{./imagecontour}
+
+Finally, here is an example that illustrates the construction of contours
+from irregularly spaced data:
+@verbatiminclude irregularcontour.asy
+@sp 1
+@center @image{./irregularcontour}
+
+In the above example, the contours of irregularly spaced data are constructed by
+first creating a triangular mesh from an array @code{z} of pairs:
+
+@cindex @code{triangulate}
+@verbatim
+int[][] triangulate(pair[] z);
+@end verbatim
+
+@verbatiminclude triangulate.asy
+@sp 1
+@center @image{./triangulate}
+
+The example @code{@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/Gouraudcontour.pdf,,Gouraudcontour}@uref{https://asymptote.sourceforge.io/gallery/2Dgraphs/Gouraudcontour.asy,,.asy}} illustrates how to produce color
+density images over such irregular triangular meshes.
+@code{Asymptote} uses a robust version of Paul Bourke's Delaunay triangulation
+algorithm based on the public-domain exact arithmetic predicates written by
+Jonathan Shewchuk.
+
+@node contour3, smoothcontour3, contour, Base modules
+@section @code{contour3}
+@cindex @code{contour3}
+This module draws surfaces described as the null space of real-valued
+functions of @math{(x,y,z)} or @code{real[][][]} matrices.
+Its usage is illustrated in the example file @code{@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/magnetic.html,,magnetic}@uref{https://asymptote.sourceforge.io/gallery/3Dgraphs/magnetic.asy,,.asy}}.
+
+@node smoothcontour3, slopefield, contour3, Base modules
+@section @code{smoothcontour3}
+@cindex @code{smoothcontour3}
+This module, written by Charles Staats, draws implicitly defined surfaces
+with smooth appearance.
+The purpose of this module is similar to that of @code{contour3}: given
+a real-valued function @math{f(x,y,z)}, construct the surface described by
+the equation @math{f(x,y,z) = 0}. The @code{smoothcontour3} module generally produces
+nicer results than @code{contour3}, but takes longer to compile. Additionally, the
+algorithm assumes that the function and the surface are both smooth; if they are not,
+then @code{contour3} may be a better choice.
+
+To construct the null surface of a function @code{f(triple)} or @code{ff(real,real,real)}
+over @code{box(a,b)}, use the routine
+@cindex @code{implicitsurface}
+@verbatim
+surface implicitsurface(real f(triple)=null,
+ real ff(real,real,real)=null,
+ triple a,
+ triple b,
+ int n=nmesh,
+ bool keyword overlapedges=false,
+ int keyword nx=n,
+ int keyword ny=n,
+ int keyword nz=n,
+ int keyword maxdepth=8,
+ bool usetriangles=true);
+@end verbatim
+@noindent
+The optional parameter @code{overlapedges} attempts to compensate for
+an artifact that can cause the renderer to ``see through'' the
+boundary between patches. Although
+it defaults to @code{false}, it should usually be set to @code{true}.
+The example @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/genustwo.html,,genustwo}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/genustwo.asy,,.asy}} illustrates the use of this function.
+Additional examples, together with a more in-depth explanation of
+the module's usage and pitfalls, are available at
+@url{https://github.com/charlesstaats/smoothcontour3}.
+
+@node slopefield, ode, smoothcontour3, Base modules
+@section @code{slopefield}
+@cindex @code{slopefield}
+To draw a slope field for the differential equation @math{dy/dx=f(x,y)} (or
+@math{dy/dx=f(x)}), use:
+@verbatim
+picture slopefield(real f(real,real), pair a, pair b,
+ int nx=nmesh, int ny=nx,
+ real tickfactor=0.5, pen p=currentpen,
+ arrowbar arrow=None);
+@end verbatim
+@noindent
+Here, the points @code{a} and @code{b} are the lower left and upper
+right corners of the rectangle in which the slope field is to be drawn,
+@code{nx} and @code{ny} are the respective number of ticks in the
+@math{x} and @math{y} directions, @code{tickfactor} is the fraction of
+the minimum cell dimension to use for drawing ticks, and @code{p} is
+the pen to use for drawing the slope fields.
+The return value is a picture that can be added to
+@code{currentpicture} via the @code{add(picture)} command.
+
+The function
+@cindex @code{curve}
+@verbatim
+path curve(pair c, real f(real,real), pair a, pair b);
+@end verbatim
+@noindent
+takes a point (@code{c}) and a slope field-defining function @code{f}
+and returns, as a path, the curve passing through that point. The points
+@code{a} and @code{b} represent the rectangular boundaries over which
+the curve is interpolated.
+
+Both @code{slopefield} and @code{curve} alternatively accept a function
+@code{real f(real)} that depends on @math{x} only, as seen in this example:
+
+@verbatiminclude slopefield1.asy
+@sp 1
+@center @image{./slopefield1}
+
+@node ode, , slopefield, Base modules
+@section @code{ode}
+@cindex @code{ode}
+The @code{ode} module, illustrated in the example @code{@uref{https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/examples/odetest.asy,,odetest.asy}},
+implements a number of explicit numerical integration schemes for
+ordinary differential equations.
+
+@node Options, Interactive mode, Base modules, Top
+@chapter Command-line options
+@cindex options
+@cindex command-line options
+Type @code{asy -h} to see the full list of command-line options
+supported by @code{Asymptote}:
+@verbatiminclude options
+
+All boolean options can be negated by prepending @code{no} to the option name.
+
+If no arguments are given, @code{Asymptote} runs in interactive mode
+(@pxref{Interactive mode}). In this case, the default output file
+is @code{out.eps}.
+
+If @code{-} is given as the file argument, @code{Asymptote} reads from
+standard input.
+
+If multiple files are specified, they are treated as separate
+@code{Asymptote} runs.
+
+@cindex @code{autoimport}
+If the string @code{autoimport} is nonempty, a module with this name is
+automatically imported for each run as the final step in loading module
+@code{plain}.
+
+@anchor{configuration file}
+@cindex configuration file
+@cindex @code{ASYMPTOTE_CONFIG}
+@cindex @code{config}
+@cindex @code{settings}
+@anchor{settings}
+Default option values may be entered as @code{Asymptote} code in a
+configuration file named @code{config.asy} (or the file specified by
+the environment variable @code{ASYMPTOTE_CONFIG} or @code{-config} option).
+@code{Asymptote} will look for this file in its usual search path
+(@pxref{Search paths}). Typically the configuration file is placed in the
+@code{.asy} directory in the user's home directory
+(@code{%USERPROFILE%\.asy} under @code{MSDOS}).
+Configuration variables are accessed using the long form of the option names:
+@verbatim
+import settings;
+outformat="pdf";
+batchView=false;
+interactiveView=true;
+batchMask=false;
+interactiveMask=true;
+@end verbatim
+Command-line options override these defaults. Most configuration
+variables may also be changed at runtime.
+@cindex @code{dvipsOptions}
+@cindex @code{hyperrefOptions}
+@cindex @code{convertOptions}
+@cindex @code{gsOptions}
+@cindex @code{htmlviewerOptions}
+@cindex @code{psviewerOptions}
+@cindex @code{pdfviewerOptions}
+@cindex @code{pdfreloadOptions}
+@cindex @code{glOptions}
+@cindex @code{dvisvgmOptions}
+The advanced configuration variables @code{dvipsOptions},
+@code{hyperrefOptions}, @code{convertOptions}, @code{gsOptions},
+@code{htmlviewerOptions}, @code{psviewerOptions},
+@code{pdfviewerOptions}, @code{pdfreloadOptions},
+@code{glOptions}, and @code{dvisvgmOptions} allow specialized options
+to be passed as a string to the respective applications or
+libraries. The default value of @code{hyperrefOptions} is
+@code{setpagesize=false,unicode,pdfborder=0 0 0}.
+
+If you insert
+@verbatim
+import plain;
+settings.autoplain=true;
+@end verbatim
+@noindent
+at the beginning of the configuration file, it can contain arbitrary
+@code{Asymptote} code.
+
+@cindex @code{convert}
+@cindex @code{output}
+@cindex @code{format}
+@cindex @code{ImageMagick}
+@cindex @code{render}
+@cindex @code{antialias}
+@cindex @code{size}
+@cindex @code{latex}
+@cindex @code{tex}
+@cindex @code{pdflatex}
+@cindex @code{xelatex}
+@cindex @code{context}
+@cindex @code{luatex}
+@cindex @code{lualatex}
+@cindex @code{EPS}
+@cindex @code{PDF}
+@anchor{texengines}
+@anchor{convert}
+The default output format is @acronym{EPS} for the (default)
+@code{latex} and @code{tex} tex engine and @acronym{PDF} for the
+@code{pdflatex}, @code{xelatex}, @code{context}, @code{luatex}, and
+@code{lualatex} tex engines. Alternative output formats may be
+produced using the @code{-f} option (or @code{outformat} setting).
+
+@cindex @code{SVG}
+@cindex @code{dvisvgm}
+@cindex @code{libgs}
+@cindex @code{graphic}
+To produce @acronym{SVG} output, you will need @code{dvisvgm} (version
+2.6.3 or later) from @url{https://dvisvgm.de}.
+You might need to adjust the configuration variable @code{libgs} to
+point to the location of your @code{Ghostscript} library
+@code{libgs.so} (or to an empty string, depending on how
+@code{dvisvgm} was configured). The 2.9.1 version of @code{dvisvgm} can
+display @acronym{SVG} output (used by the @code{xasy} editor) for embedded
+@acronym{EPS}, @acronym{PDF}, @acronym{PNG}, and @acronym{JPEG} images
+included with the @code{graphic()} function.
+
+@code{Asymptote} can also produce any output format supported
+by the @code{ImageMagick} @code{convert} program (version 6.3.5 or
+later recommended; an @code{Invalid Parameter} error message indicates
+that the @code{MSDOS} utility @code{convert} is being used instead of
+the one that comes with @code{ImageMagick}).
+The optional setting @code{-render n} requests
+an output resolution of @code{n} pixels per @code{bp}. Antialiasing is
+controlled by the parameter @code{antialias}, which by default
+specifies a sampling width of 2 pixels.
+To give other options to @code{convert}, use the
+@code{convertOptions} setting or call convert manually. This example
+emulates how @code{Asymptote} produces antialiased @code{tiff} output at
+one pixel per @code{bp}:
+@verbatim
+asy -o - venn | convert -alpha Off -density 144x144 -geometry 50%x eps:- venn.tiff
+@end verbatim
+
+@cindex @code{nosafe}
+@cindex @code{safe}
+@cindex @code{system}
+If the option @code{-nosafe} is given, @code{Asymptote} runs
+in unsafe mode. This enables the @code{int system(string s)} and
+@code{int system(string[] s)} calls, allowing one
+to execute arbitrary shell commands. The default mode, @code{-safe},
+disables this call.
+
+@cindex offset
+@cindex @code{aligndir}
+A @code{PostScript} offset may be specified as a pair (in @code{bp}
+units) with the @code{-O} option:
+@verbatim
+asy -O 0,0 file
+@end verbatim
+@noindent
+The default offset is zero. The pair @code{aligndir} specifies
+an optional direction on the boundary of the page (mapped to the
+rectangle [-1,1]@math{\times}[-1,1]) to which the picture should be aligned; the
+default value @code{(0,0)} species center alignment.
+
+@cindex @code{-c}
+The @code{-c} (@code{command}) option may be used to execute arbitrary
+@code{Asymptote} code on the command line as a string. It is not
+necessary to terminate the string with a semicolon. Multiple @code{-c}
+options are executed in the order they are given. For example
+@verbatim
+asy -c 2+2 -c "sin(1)" -c "size(100); draw(unitsquare)"
+@end verbatim
+@noindent
+produces the output
+@verbatim
+4
+0.841470984807897
+@end verbatim
+@noindent
+and draws a unitsquare of size @code{100}.
+
+@cindex @code{-u}
+The @code{-u} (@code{user}) option may be used to specify arbitrary
+@code{Asymptote} settings on the command line as a string. It is not
+necessary to terminate the string with a semicolon. Multiple @code{-u}
+options are executed in the order they are given. Command-line code like
+@code{-u x=sqrt(2)} can be executed within a module like this:
+@verbatim
+real x;
+usersetting();
+write(x);
+@end verbatim
+
+@cindex @code{-l}
+When the @code{-l} (@code{listvariables}) option is used with file
+arguments, only global functions and variables defined in the specified
+file(s) are listed.
+
+Additional debugging output is produced with each additional @code{-v} option:
+@table @code
+@item -v
+Display top-level module and final output file names.
+@item -vv
+Also display imported and included module names and final @code{LaTeX} and
+@code{dvips} processing information.
+@item -vvv
+Also output @code{LaTeX} bidirectional pipe diagnostics.
+@item -vvvv
+Also output knot guide solver diagnostics.
+@item -vvvvv
+Also output @code{Asymptote} traceback diagnostics.
+@end table
+
+@node Interactive mode, GUI, Options, Top
+@chapter Interactive mode
+@cindex interactive mode
+Interactive mode is entered by executing the command @code{asy} with
+no file arguments. When the @code{-multiline} option is disabled (the default),
+each line must be a complete @code{Asymptote} statement (unless
+explicitly continued by a final backslash character @code{\});
+it is not necessary to terminate input lines with a semicolon.
+If one assigns @code{settings.multiline=true}, interactive code can be
+entered over multiple lines; in this mode, the automatic termination of
+interactive input lines by a semicolon is inhibited. Multiline mode is useful
+for cutting and pasting @code{Asymptote} code directly into the
+interactive input buffer.
+
+@cindex @code{%}
+Interactive mode can be conveniently used as a calculator: expressions
+entered at the interactive prompt (for which a corresponding @code{write}
+function exists) are automatically evaluated and written to @code{stdout}.
+If the expression is non-writable, its type signature will be printed out
+instead. In either case, the expression can be referred to using the symbol
+@code{%} in the next line input at the prompt. For example:
+@verbatim
+> 2+3
+5
+> %*4
+20
+> 1/%
+0.05
+> sin(%)
+0.0499791692706783
+> currentpicture
+<picture currentpicture>
+> %.size(200,0)
+>
+@end verbatim
+
+@cindex @code{operator answer}
+The @code{%} symbol, when used as a variable, is shorthand for the identifier
+@code{operator answer}, which is set by the prompt after each written
+expression evaluation.
+
+
+The following special commands are supported only in interactive mode
+and must be entered immediately after the prompt:
+
+@table @code
+@cindex @code{help}
+@item help
+view the manual;
+@item erase
+erase @code{currentpicture};
+@cindex @code{input}
+@item reset
+reset the @code{Asymptote} environment to its initial state, except for
+changes to the settings module (@pxref{settings}), the current directory
+(@pxref{cd}), and breakpoints (@pxref{Debugger});
+@cindex @code{input}
+@item input FILE
+does an interactive reset, followed by the command
+@code{include FILE}. If the file name @code{FILE} contains
+nonalphanumeric characters, enclose it with quotation marks.
+A trailing semi-colon followed by optional @code{Asymptote} commands may
+be entered on the same line.
+@cindex @code{quit}
+@cindex @code{exit}
+@cindex @code{history}
+@anchor{history}
+@item quit
+exit interactive mode (@code{exit} is a synonym; the abbreviation
+@code{q} is also accepted unless there exists a top-level variable named
+@code{q}).
+@cindex @code{historylines}
+A history of the most recent 1000 (this number can be changed with the
+@code{historylines} configuration variable) previous commands will be retained
+in the file @code{.asy/history} in the user's home directory (unless
+the command-line option @code{-localhistory} was specified, in which case
+the history will be stored in the file @code{.asy_history} in the
+current directory).
+
+@end table
+
+Typing @code{ctrl-C} interrupts the execution of @code{Asymptote} code
+and returns control to the interactive prompt.
+
+Interactive mode is implemented with the @acronym{GNU} @code{readline} library,
+with command history and auto-completion. To customize the key bindings, see:
+@url{https://tiswww.case.edu/php/chet/readline/readline.html}
+
+@cindex @code{Python} usage
+The file @code{asymptote.py} in the @code{Asymptote} system directory
+provides an alternative way of entering @code{Asymptote} commands
+interactively, coupled with the full power of @code{Python}. Copy this
+file to your @code{Python path} and then execute from within
+@code{Python 3} the commands
+@verbatim
+from asymptote import *
+g=asy()
+g.size(200)
+g.draw("unitcircle")
+g.send("draw(unitsquare)")
+g.fill("unitsquare, blue")
+g.clip("unitcircle")
+g.label("\"$O$\", (0,0), SW")
+@end verbatim
+
+@node GUI, PostScript to Asymptote, Interactive mode, Top
+@chapter Graphical User Interface
+@cindex graphical user interface
+@cindex @acronym{GUI}
+@cindex mouse
+@cindex wheel mouse
+@cindex @code{Button-1}
+@cindex @code{Button-2}
+@cindex @code{xasy}
+
+@menu
+* GUI installation:: Installing @code{xasy}
+* GUI usage:: Using @code{xasy} to edit objects
+@end menu
+
+In the event that adjustments to the final figure are required, the
+preliminary Graphical User Interface (@acronym{GUI}) @code{xasy} included with
+@code{Asymptote} allows you to move graphical objects and draw new ones.
+The modified figure can then be saved as a normal @code{Asymptote} file.
+
+@node GUI installation, GUI usage, GUI, GUI
+@section GUI installation
+@cindex GUI installation
+
+As @code{xasy} is written in the interactive scripting language
+@code{Python/Qt}, it requires @code{Python} (@url{https://www.python.org}),
+along with the @code{Python} packages @code{pyqt5}, @code{cson}, and
+@code{numpy}:
+
+@verbatim
+pip3 install cson numpy pyqt5 PyQt5.sip
+@end verbatim
+
+Pictures are deconstructed into the @acronym{SVG} image format.
+Since @code{Qt5} does not support @code{SVG} clipping, you will need
+the @code{rsvg-convert} utility, which is part of the
+@code{librsvg2-tools} package on @code{UNIX} systems
+and the @code{librsvg} package on @code{MacOS X}; under
+@code{Microsoft Windows}, it is available as
+
+@url{https://sourceforge.net/projects/tumagcc/files/rsvg-convert-2.40.20.7z}
+
+@node GUI usage, , GUI installation, GUI
+@section GUI usage
+@cindex GUI usage
+@cindex arrow keys
+@cindex mouse wheel
+@cindex @code{deconstruct}
+The arrow keys (or mouse wheel) are convenient for temporarily
+raising and lowering objects within @code{xasy}, allowing an object to
+be selected. Pressing the arrow keys will pan while the shift key is held
+and zoom while the control key is held. The mouse wheel will pan while
+the alt or shift keys is held and zoom while the control key is held.
+In translate mode, an object can be dragged coarsely with the mouse
+or positioned finely with the arrow keys while holding down the mouse button.
+
+Deconstruction of compound objects (such as arrows) can be prevented
+by enclosing them within the commands
+@verbatim
+void begingroup(picture pic=currentpicture);
+void endgroup(picture pic=currentpicture);
+@end verbatim
+By default, the elements of a picture or frame will be grouped
+together on adding them to a picture. However, the elements of a frame
+added to another frame are not grouped together by default: their
+elements will be individually deconstructed (@pxref{add}).
+
+@node PostScript to Asymptote, Help, GUI, Top
+@chapter @code{PostScript} to @code{Asymptote}
+@cindex @code{pstoedit}
+The excellent @code{PostScript} editor @code{pstoedit} (version 3.50 or later;
+available from @url{https://sourceforge.net/projects/pstoedit/}) includes an
+@code{Asymptote} backend. Unlike virtually all other @code{pstoedit}
+backends, this driver includes native clipping, even-odd fill rule,
+@code{PostScript} subpath, and full image support. Here is an example:
+@noindent
+@code{asy -V @value{Datadir}/doc/asymptote/examples/venn.asy}
+@noindent
+@verbatim
+pstoedit -f asy venn.eps test.asy
+asy -V test
+@end verbatim
+
+@noindent
+If the line widths aren't quite correct, try giving @code{pstoedit} the
+@code{-dis} option.
+If the fonts aren't typeset correctly, try giving @code{pstoedit} the
+@code{-dt} option.
+
+@node Help, Debugger, PostScript to Asymptote, Top
+@chapter Help
+@cindex help
+@cindex forum
+
+A list of frequently asked questions (@acronym{FAQ}) is maintained at
+@quotation
+@url{https://asymptote.sourceforge.io/FAQ}
+@end quotation
+@noindent
+Questions on installing and using @code{Asymptote} that are not
+addressed in the @acronym{FAQ} should be sent to the
+@code{Asymptote} forum:
+@quotation
+@url{https://sourceforge.net/p/asymptote/discussion/409349}
+@end quotation
+@noindent
+Including an example that illustrates what you are trying to do will help
+you get useful feedback.
+@code{LaTeX} problems can often be diagnosed with the @code{-vv} or
+@code{-vvv} command-line options.
+Contributions in the form of patches or @code{Asymptote} modules can be
+posted here:
+@quotation
+@url{https://sourceforge.net/p/asymptote/patches}
+@end quotation
+@noindent
+To receive announcements of upcoming releases, please subscribe to
+@code{Asymptote} at
+@quotation
+@url{https://sourceforge.net/projects/asymptote/}
+@end quotation
+@cindex bug reports
+@noindent
+If you find a bug in @code{Asymptote}, please check (if possible)
+whether the bug is still present in the latest @code{git}
+developmental code (@pxref{Git}) before submitting a bug
+report. New bugs can be reported at
+@quotation
+@url{https://github.com/vectorgraphics/asymptote/issues}
+@end quotation
+@noindent
+To see if the bug has already been fixed,
+check bugs with Status @code{Closed} and recent lines in
+@quotation
+@url{https://asymptote.sourceforge.io/ChangeLog}
+@end quotation
+@noindent
+
+@cindex stack overflow
+@cindex segmentation fault
+@cindex @code{libsigsegv}
+@code{Asymptote} can be configured with the optional @acronym{GNU} library
+@code{libsigsegv}, available from
+@url{https://www.gnu.org/software/libsigsegv/}, which allows one to distinguish
+user-generated @code{Asymptote} stack overflows (@pxref{stack overflow})
+from true segmentation faults (due to internal C++ programming errors;
+please submit the @code{Asymptote} code that generates such segmentation
+faults along with your bug report).
+
+@node Debugger, Credits, Help, Top
+@chapter Debugger
+@cindex debugger
+Asymptote now includes a line-based (as opposed to code-based)
+debugger that can assist the user in following flow control. To set a
+break point in file @code{file} at line @code{line}, use the command
+
+@cindex @code{stop}
+@verbatim
+void stop(string file, int line, code s=quote{});
+@end verbatim
+@noindent
+The optional argument @code{s} may be used to conditionally set the variable
+@code{ignore} in @code{plain_debugger.asy} to @code{true}. For example, the
+first 10 instances of this breakpoint will be ignored (the
+variable @code{int count=0} is defined in @code{plain_debugger.asy}):
+@verbatim
+stop("test",2,quote{ignore=(++count <= 10);});
+@end verbatim
+
+To set a break point in file @code{file} at the first line containing
+the string @code{text}, use
+
+@verbatim
+void stop(string file, string text, code s=quote{});
+@end verbatim
+@noindent
+To list all breakpoints, use:
+@cindex @code{breakpoints}
+@verbatim
+void breakpoints();
+@end verbatim
+@noindent
+To clear a breakpoint, use:
+@cindex @code{clear}
+@verbatim
+void clear(string file, int line);
+@end verbatim
+@noindent
+To clear all breakpoints, use:
+@verbatim
+void clear();
+@end verbatim
+
+The following commands may be entered at the debugging prompt:
+
+@table @code
+@cindex @code{help}
+@item @code{h}
+help;
+@cindex @code{continue}
+@item @code{c}
+continue execution;
+
+@cindex @code{inst}
+@item @code{i}
+step to the next instruction;
+
+@cindex @code{step}
+@item @code{s}
+step to the next executable line;
+
+@cindex @code{next}
+@item @code{n}
+step to the next executable line in the current file;
+
+@cindex @code{file}
+@item @code{f}
+step to the next file;
+
+@cindex @code{return}
+@item @code{r}
+return to the file associated with the most recent breakpoint;
+
+@cindex @code{trace}
+@item @code{t}
+toggle tracing (@code{-vvvvv}) mode;
+
+@cindex @code{quit}
+@item @code{q}
+quit debugging and end execution;
+
+@cindex @code{exit}
+@item @code{x}
+exit the debugger and run to completion.
+
+@end table
+@noindent
+Arbitrary @code{Asymptote} code may also be entered at the debugging prompt;
+however, since the debugger is implemented with @code{eval}, currently
+only top-level (global) variables can be displayed or modified.
+
+The debugging prompt may be entered manually with the call
+@verbatim
+void breakpoint(code s=quote{});
+@end verbatim
+
+@node Credits, Index, Debugger, Top
+@chapter Acknowledgments
+@cindex acknowledgments
+
+Financial support for the development of @code{Asymptote} was generously
+provided by the Natural Sciences and Engineering Research Council of
+Canada, the Pacific Institute for Mathematical Sciences, and the
+University of Alberta Faculty of Science.
+
+We also would like to acknowledge the previous work of John D. Hobby,
+author of the program @code{MetaPost} that inspired the development of
+@code{Asymptote}, and Donald E. Knuth, author of @TeX{} and
+@code{MetaFont} (on which @code{MetaPost} is based).
+
+The authors of @code{Asymptote} are Andy Hammerlindl, John Bowman, and
+Tom Prince. Sean Healy designed the @code{Asymptote} logo. Other
+contributors include Orest Shardt, Jesse Frohlich, Michail Vidiassov,
+Charles Staats, Philippe Ivaldi, Olivier Guib@'e, Radoslav Marinov,
+Jeff Samuelson, Chris Savage, Jacques Pienaar, Mark Henning, Steve Melenchuk,
+Martin Wiebusch, Stefan Knorr, and Supakorn ``Jamie'' Rassameemasmuang.
+Pedram Emami developed the @code{Asymptote Web Application} at
+@url{http://asymptote.ualberta.ca}.
+
+
+@node Index, , Credits, Top
+@unnumbered Index
+
+@printindex cp
+
+@bye
+
+@c LocalWords: randMax Gaussrand asy cindex indices resized LaTeX TK latin au
+@c LocalWords: latexusage tex bbox PostScript subdirectory gcc emacs ASYDIR
+@c LocalWords: documentclass usepackage subpath shipout sqrt xN Mx bw AcroRd
+@c LocalWords: xscale xaxis yaxis BeginBar GIF postprocessing fpu de rpair xy
+@c LocalWords: ImageMagick cd asymptote Hy 0pt 1filll 's 3D 2D 'asy
+@c LocalWords: startup natively xasy tkinter VxN yingyang currentpicture toc
+@c LocalWords: MetaPost MetaFont Hammerlindl Healy texinfo autoload setq setf
+@c LocalWords: printindex setfilename settitle dircategory direntry titlepage
+@c LocalWords: vskip filll insertcopying ifnottex detailmenu alist augroup PQ
+@c LocalWords: bool behaviour facto zxf login Debian dev filetypedetect
+@c LocalWords: FFTW bp readline gv eps args Boehm gc evenoddoverlap png joe
+@c LocalWords: boolean initializer expi dir xpart ypart STL substring rfind
+@c LocalWords: pos substr strftime typedef pxref unitcircle yscale Bezier iff
+@c LocalWords: postcontrol precontrol atleast nullpath arclength arctime rgb
+@c LocalWords: dirtime currentpen colorspaces grayscale cmyk defaultpen x cx
+@c LocalWords: linetype longdashed dashdotted longdashdotted linewidth y XP
+@c LocalWords: fontsize defaultfilename keepAspect IgnoreAspect ise flushleft
+@c LocalWords: src dest XDR txt getc fout stdin stdout endl eof js prc ni
+@c LocalWords: Microsystem's eol exponentials postfix sayhi th Ubuntu
+@c LocalWords: sqr intop addby libm asin acos atan sinh tanh asinh acosh cbrt
+@c LocalWords: atanh fabs hypot fmod ceil srand dereferenced alice pete sqrtx
+@c LocalWords: eval fft csv runtime nonalphanumeric labely LeftTicks NoTicks
+@c LocalWords: RightTicks BottomTop LeftRight Ticksize UTF BufNewFile BufRead
+@c LocalWords: ticksize subintervals xlimits filetype plugin setlocal makeprg
+@c LocalWords: ylimits uncommented automin automax cp uninstall reals ecast
+@c LocalWords: scaleT RightSide yx yy NoAlign legendmargin opic CCW
+@c LocalWords: arrowbar LeftSide EndBar BeginArrow lly feynman isi showtarget
+@c LocalWords: EndArrow BeginArcArrow EndArcArrow ArcArrow ArcArrows NoFill
+@c LocalWords: filldraw fillpen drawpen errorformat bigsquare bezier darkblue
+@c LocalWords: quartercircle darkgreen lightblue urx ury texpreamble sgn texi
+@c LocalWords: lineargraph datagraph vertices parametricgraph uncomment ggv
+@c LocalWords: loggraph generalaxis texhash arrowsize arrowangle arrowlength
+@c LocalWords: SuppressQuiet MoveQuiet LIBREADLINE config MacOS prebuilt
+@c LocalWords: ghostview gsview SIGHUP PDF acroread xpdf cutbefore strptime
+@c LocalWords: libsigsegv intersectionpoint dotfactor vv firstcut pq logticks
+@c LocalWords: Unisys dvips vvv vvvv vvvvv traceback lastcut cutafter infodir
+@c LocalWords: zxvf xargs cond polargraph xmin xmax plabel YZero labelling ln
+@c LocalWords: ymin ymax XZero xequals tickmin tickmax unlabelled se pq pena
+@c LocalWords: yequals Nobre Barbarosie Schwaiger nearearth conicurv Wiebusch
+@c LocalWords: unfill posterSize ngraph interpolatetype ctrl dt pic getint Ai
+@c LocalWords: NNE jxf linecap linejoin unitsquare shadedtiling ei nomarker
+@c LocalWords: westnile minipage ra penb paletteticks drawline nV FillDraw uv
+@c LocalWords: susceptibleM flushright secondaryX secondaryY secondaryaxis tt
+@c LocalWords: titlelabel columnlabel rb xtick ytick labelx XEquals YEquals
+@c LocalWords: treetest eetomumu fermi backend pstoedit drawtree xFF MSDOS gz
+@c LocalWords: vimrc CFLAGS verbatiminclude online noindent bezier superpath
+@c LocalWords: evenodd squarecap roundcap extendcap miterjoin roundjoin NFSS
+@c LocalWords: beveljoin fillrule zerowinding insideness lineskip cmr pcrr Hx
+@c LocalWords: AvantGarde Bookman Helvetica NewCenturySchoolBook minbound pdf
+@c LocalWords: Palatino TimesRoman ZapfChancery ZapfDingbats german basealign
+@c LocalWords: nondeconstructed backends usr venn labelsquare nobasealign dp
+@c LocalWords: NoMargin BeginMargin EndMargin BeginPenMargin EndPenMargin dm
+@c LocalWords: PenMargin PenMargins TrueMargin labelmargin errorbars errorbar
+@c LocalWords: dpx dpy dmx dmy barsize arrowsize BeginDotMargin DotMargin acc
+@c LocalWords: EndDotMargin DotMargins NColors BWRainbow colorspace labelled
+@c LocalWords: PaletteTicks defaultformat leastsquares bjam fprintf endgroup
+@c LocalWords: begingroup xmargin ymargin pbox box ellipse wget exe Gouraud
+@c LocalWords: multithreaded newframe init emph nums concat xline yline zpart
+@c LocalWords: colatitude zscale cosh nullpen MetaFontbook cyclicflag FreeBSD
+@c LocalWords: nodeps Ghostgum beginlabel endlabel pTick ptick loggrid SAS dy
+@c LocalWords: currentprojection latticeshading subpictures colinear unitcube
+@c LocalWords: Autoscaling solveQuadratic MidArrow MidArcArrow Prebuilt url
+@c LocalWords: pdftex comment getstring getstringprefix getreal defaultS hsv
+@c LocalWords: ticklocate autoscaleT autoscaling vectorfield autolimits dvi
+@c LocalWords: zlimits inline dvipdf hyperdvi autoconf gui zerowindingoverlap
+@c LocalWords: prepended intMax quadraticroots cubicroots filltype prepend dx
+@c LocalWords: ticklabel popup UnFill markroutine marknodes markuniform erf
+@c LocalWords: intersectpoint cyrillic mathtext russian brokenaxis Datadir ds
+@c LocalWords: resetdefaultpen latticeshade axialshade radialshade erfc det
+@c LocalWords: gouraudshade unescaped nmesh surfacepen getpair MikTeX dw YZ
+@c LocalWords: meshpen localhistory axisT roundedpath unitsize aSin accel pre
+@c LocalWords: fontcommand makepen aCos aTan Knorr roundpath BeginPoint nView
+@c LocalWords: MidPoint EndPoint nmask antialiasing autoplain batchMask libgc
+@c LocalWords: batchView clearGUI ignoreGUI interactiveMask interactiveView
+@c LocalWords: listvariables outformat parseonly prepending psviewer nCircle
+@c LocalWords: pdfviewer papertype tabcompletion noautoplain plugins Teixeira
+@c LocalWords: embeddedmovie historylines RadialShade penc penr CJK tgz GPL
+@c LocalWords: legendlinelength legendskip USERPROFILE LDFLAGS currentlight
+@c LocalWords: subsampled sinc kai AtBeginDocument GBK clearpage lasy texpath
+@c LocalWords: AtEndDocument zaxis maxbound truepoint paperwidth paperheight
+@c LocalWords: GSL deriv texcolors fixedscaling UpsideDown texreset slidedemo
+@c LocalWords: subitem newslide realMin realMax realEpsilon realDigits gsl dh
+@c LocalWords: obliqueX asycolors monthaxis xautoscale yautoscale zautoscale
+@c LocalWords: obliqueZ obliqueY cylinderskeleton block llcorner dr py nx CPU
+@c LocalWords: loc topleft topright bottomleft bottomright flowrectangle UTC
+@c LocalWords: chartblock flowdiamond flowcircle xlabel BezierSurface el xyz
+@c LocalWords: flowroundrectangle flowbevel flowpath drawflow blocks ny cpu
+@c LocalWords: multipleView usersetting mediumgray flowchartdemo ylabel nv xf
+@c LocalWords: zlabel slopefields cputime roundrectangle slopefield libgccpp
+@c LocalWords: tickfactor USERNAME writeable imagecontour logimage Dumoulin's
+@c LocalWords: NoCrop parametricsurface realmult SoftLight HardLight interp
+@c LocalWords: ColorDodge ColorBurn Ivaldi buildcycle autorotate mexicanhat
+@c LocalWords: Gouraudcontour pdflatex preconfigured perline linelength hskip
+@c LocalWords: penimage filloutside legendhskip legendvskip maxwidth CDlabel
+@c LocalWords: tensorshade MPEG framepoint nonfunction Radoslav Marinov Mepis
+@c LocalWords: Pienaar Melenchuk finalout Linspire Dpkg sudo dpkg dtx Tcount
+@c LocalWords: windingnumber clickable pdfmovie dfn du animationdelay fprime
+@c LocalWords: slidemovies ifdraft embeddedu externalmovie headerpen bodypen
+@c LocalWords: GaussianSurface multiline binarytree tridiagonal portably AIX
+@c LocalWords: binarytreetest Henning subsample breakpoint locator wireframe
+@c LocalWords: labelpath intersectionpoints PSTricks pstextpath curvedlabel
+@c LocalWords: LeftJustified RightJustified tickmodifier gunzip gmake IRIX dv
+@c LocalWords: texcommand RET SITEDIR filegraph pathmarkers POSIX binput AOB
+@c LocalWords: nonportable markinterval stickframe circlebarframe tix
+@c LocalWords: crossframe tildeframe markangle StickIntervalMarker gswin expm
+@c LocalWords: CrossIntervalMarker CircleBarIntervalMarker Ghostscript syzygy
+@c LocalWords: TildeIntervalMarker autoimport calculateTransform bitwise tk
+@c LocalWords: headersize bodysize minheaderwidth minheaderheight minwidth ZX
+@c LocalWords: minbodywidth minbodyheight minheight mindiameter reltime PNG
+@c LocalWords: relpoint Syzygy syzygies seekeof splinetype notaknot slopea ZY
+@c LocalWords: slopeb nonperiodic circlescale MarkFill ScaleX ScaleY xformat
+@c LocalWords: onecontour multicontour irregularcontour dvipsOptions saveline
+@c LocalWords: dirSpecifier controlSpecifier tensionSpecifier atleastflag bsp
+@c LocalWords: curlSpecifier cputimeformat initializers arbitary redeclaring
+@c LocalWords: firstname lastname multdiagonal Raphson OmitTick OmitFormat sp
+@c LocalWords: NoZero NoZeroFormat abbrevation gsOptions namespace redeclared
+@c LocalWords: atLeast intMin globalwrite quarticroots deconsruct substrings
+@c LocalWords: usleep currentpatterns trailingzero Orest Shardt DefaultHead
+@c LocalWords: SimpleHead HookHead TeXHead multipage NURBS inlinemovie dxmax
+@c LocalWords: simpson NoBox truesize autoscale shadestroke recurses mintimes
+@c LocalWords: nonoverlapping texengine maxtimes maxheight pdb TEXMFCONFIG Jn
+@c LocalWords: piecewisestraight unitrand graphmarkers antialias nolight newl
+@c LocalWords: Delaunay Shewchuk convertOptions APPDATA pdfreload tempFile Yn
+@c LocalWords: pdfreloadOptions deferred OpenGL renderer unitbox 's
+@c LocalWords: bezulate Shardt's rasterized viewport unitdisk unitplane devel
+@c LocalWords: unitcylinder unitcone solidcone unitfrustum unitsphere nslices
+@c LocalWords: DPostScript YZZero externalprc nonrendered nosafe KDE
+@c LocalWords: unithemisphere versa XYplane xypart unitsolidcone YZEquals xml
+@c LocalWords: XZEquals XYEquals XZZero XYZero InTicks OutTicks InOutTicks
+@c LocalWords: fitscreen planeproject strokepath meshlight nullpens arrowdir
+@c LocalWords: diffusepen emissivepen specularpen arrowbarb keyval
+@c LocalWords: hstretch vstretch roundbox nonconvex miterlimit basealign cmd
+@c LocalWords: maxviewport maxtile antialiased sphericalharmonic attachfile
+@c LocalWords: vertexshading smoothelevation glOptions iconified iconify kate
+@c LocalWords: psviewerOptions pdfviewerOptions viewportmargin asyattach SVG
+@c LocalWords: multisampling autogen multisample coloredpath relstep flowdir
+@c LocalWords: colortype coloredSegments coloredNodes trefoilknot scaledgraph
+@c LocalWords: minblockwidth minblockheight mincirclediameter nonassociative
+@c LocalWords: nonintegral gettriple enablerepo hexadecimal XeLaTeX xelatex
+@c LocalWords: dvipdfmx autoadjust viewportsize viewportwidth viewportheight
+@c LocalWords: subregions nonsimply functionshade shader floatingdisk TopView
+@c LocalWords: functionshading maxlength LeftView odetest RadialShadeDraw CLZ
+@c LocalWords: vectorfieldsphere RightView FrontView BackView BottomView CTZ
+@c LocalWords: addViews outprefix addAllViews xsplinetype ysplinetype rotateX
+@c LocalWords: usplinetype vsplinetype leftbutton middlebutton rightbutton
+@c LocalWords: rotateY rotateZ wheelup zoomin wheeldown zoomout TeXLive pnorm
+@c LocalWords: viewportshift signedint signedness psview multiplatform nowarn
+@c LocalWords: singlereal singleint writeoverloaded dvisvg reddash lexorder
+@c LocalWords: bigdiagonal autobillboard dvisvgm maxtiles hyperrefOptions xdr
+@c LocalWords: setpagesize pdfborder controlsystem OmitTickInterval SixViews
+@c LocalWords: OmitTickIntervals tickmodifiers autorotated SixViewsUS latexmk
+@c LocalWords: ThreeViewsUS ThreeViewsFR SixViewsFR ThreeViews partialsum
+@c LocalWords: defaultrender Vidiassov latexmkrc mktemp DOSendl DOSnewl perl
+@c LocalWords: filename asyinclude latemk penfunctionimage Affine decrement
+@c LocalWords: affine Redisplay redisplay isnan radians defaultseparator Jens
+@c LocalWords: ascii piecewise arcpoint spacings tilings sncndn resizing
+@c LocalWords: differentiable vectorization vectorized asydir normals quartic
+@c LocalWords: wavepacket kerned parametrized specular hyperboloid Bourke's
+@c LocalWords: Michail 0pt 1filll 's 3D labelpath3 2D graph3 0pt 3D
+@c LocalWords: grid3 contour3 x86_64 psv a4 gsview32 freeglut 'load '
+@c LocalWords: 'asy 'lasy 'auto 5bp 1cm sqrtx01 4g extenda extendb
+@c LocalWords: bb llx 2S 100pt 3t bezier2 bool3 x0 angle1 angle2 z1
+@c LocalWords: z2 before' struct X11 x11colors type1cm 12pt OT1 5mm
+@c LocalWords: cmr12 x' y' xsize ysize 25cm s1 s2 neighbourhood u''
+@c LocalWords: s'' 3x 5x 3y 602e 2x 2y 3sin 10cm 204e addby7 10x
+@c LocalWords: only'' pow10 log10 expm1 log1p atan2 0pt 1filll 's '
+@c LocalWords: x1 x2 graph2d attachfile2 n0 P0 n1 P1 markers1 3D 2D
+@c LocalWords: interpolate1 markers2 inlinemovie3 media9 U3D T2A 5E
+@c LocalWords: embeddedu3d curvedlabel3 value2 tickvalue inner'' 2N
+@c LocalWords: lineargraph0 scalings log2 log2graph 5cm BWRainbow2
+@c LocalWords: guide3 path3 unitcircle3 2E 2n noV 100d PostScript3D
+@c LocalWords: size3 fit3 theta1 phi1 theta2 phi2 v1 v2 unitsquare3
+@c LocalWords: t1 t2 5z 5y transform3 identity4 xscale3 yscale3 0pt
+@c LocalWords: zscale3 scale3 join3 BeginBar3 EndBar3 Bar3 Bars3 's
+@c LocalWords: BeginArrow3 MidArrow3 EndArrow3 Arrow3 Arrows3 axes3
+@c LocalWords: BeginArcArrow3 MidArcArrow3 EndArcArrow3 ArcArrow3 '
+@c LocalWords: ArcArrows3 DefaultHead3 HookHead3 TeXHead3 HookHead2
+@c LocalWords: DefaultHead2 TeXHead2 arrows3 NoMargin3 BeginMargin3
+@c LocalWords: EndMargin3 Margin3 Margins3 BeginPenMargin2 xaxis3 '
+@c LocalWords: EndPenMargin2 PenMargin2 PenMargins2 BeginPenMargin3
+@c LocalWords: EndPenMargin3 PenMargin3 PenMargins3 BeginDotMargin3
+@c LocalWords: EndDotMargin3 DotMargin3 DotMargins3 TrueMargin3 3D
+@c LocalWords: yaxis3 zaxis3 ticks3 NoTicks3 arrowbar3 type2 axis3
+@c LocalWords: generalaxis3 vectorfield3 margin3 grid3xyz 5unit 2D
+@c LocalWords: slopefield1 144x144 1filll 'load 'asy 'lasy 'auto 4g
+@c LocalWords: libgs 'load 'asy 'lasy 'auto 5bp 1cm 2S 100pt 3t 5mm
+@c LocalWords: bracedefaultratio incircle 12pt 25cm 3x 5x 3y 602e '
+@c LocalWords: 2x 2y 3sin 10cm 204e 10x 5E offaxis 'load 'lasy '
+@c LocalWords: 5cm 2N 2E 2n 100d 5z 5y 5unit dvisvgmOptions 144x144
+@c LocalWords: 4g texengines coplanar 0pt 1filll 's 3D 2D 'load 5bp
+@c LocalWords: insphere cospherical 5unit luatex lualatex 'asy 1cm
+@c LocalWords: 'lasy 'auto 4g 2S 100pt 3t 12pt 5mm 25cm 3x 5x 3y 2x
+@c LocalWords: 602e 2y 3sin 10cm 204e 10x
+@c LocalWords: unnormalized 5E 5cm 2N 2E 2n 100d 5z 5y 0pt 1filll
+@c LocalWords: 5unit 144x144 aligndir smoothcontour3 's 3D 2D cmake
+@c LocalWords: 'load 'asy 'lasy 'auto 5bp 1cm 4g 2S 100pt 3t nan 3x
+@c LocalWords: 12pt 5mm 25cm 5x 3y 602e 2x 2y 3sin 10cm 204e 10x
+@c LocalWords: 5E 5cm 2N 2E 2n 100d 5z 5y nz
+@c LocalWords: 5unit Staats implicitsurface overlapedges maxdepth '
+@c LocalWords: through'' genustwo 144x144 0pt 1filll 's 3D 2D 'load
+@c LocalWords: 'asy 'lasy 'auto 5bp 1cm 4g 2S 100pt 3t 12pt 5mm 3x
+@c LocalWords: 25cm 5x 3y 602e 2x 2y 3sin 10cm 204e 10x
+@c LocalWords: 5E 5cm 2N 2E 2n 100d 5z 5y 5unit 144x144
+@c LocalWords: Frohlich codequoteundirected center 0pt 1filll 's 3D
+@c LocalWords: acknowledgments Colors 2D Color WebGL uref x86 dnf
+@c LocalWords: htmlviewer asygl CPPFLAGS 'load 'asy 'lasy 'auto 5bp
+@c LocalWords: 1cm labeling dotfilltype 4g color colors centered 2S
+@c LocalWords: 100pt 3t forcemath gray colorless miter 12pt 5mm 3x
+@c LocalWords: zeroTransform 25cm Python3 popcount bitreverse 5x 3y
+@c LocalWords: 602e 2x 2y 3sin 10cm 204e 10x
+@c LocalWords: findall ax 5a centers 5E 5cm 2N 2E 2n HTML5 html
+@c LocalWords: logo3 remeshed css 42kB 100d 5z 5y 5unit colored Qt5
+@c LocalWords: behavior beveled usetriangles htmlviewerOptions cson
+@c LocalWords: 144x144 pyqt5 numpy pip3 PyQt5 rsvg librsvg2 1filll
+@c LocalWords: librsvg Supakorn Jamie'' Rassameemasmuang 2D Docdir
+@c LocalWords: microsoft configuation 'load 'asy 'lasy 'auto dep 4g
+@c LocalWords: 5bp 1cm BezierPatch 2S 100pt 3t abs2 12pt cp1251 5mm
+@c LocalWords: anttor fontenc inputenc 25cm noglobalread 3x
+@c LocalWords: 5x 3y 602e 2x 2y 3sin 10cm 204e 10x
+@c LocalWords: mapArray 5a parameterized mapTemplate 5E 2N
+@c LocalWords: 5cm freshnel0 fresnel0 PBR prethree specularfactor
+@c LocalWords: renderers 2E ESC AsyGL 48kB 2n 100d 5z 5y 5unit
+@c LocalWords: unicode 144x144 Pedram Emami
diff --git a/Build/source/utils/asymptote/doc/axis3.asy b/Build/source/utils/asymptote/doc/axis3.asy
new file mode 100644
index 00000000000..90cbdc6ad09
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/axis3.asy
@@ -0,0 +1,12 @@
+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));
diff --git a/Build/source/utils/asymptote/doc/bezier.asy b/Build/source/utils/asymptote/doc/bezier.asy
new file mode 100644
index 00000000000..1c168042c05
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/bezier.asy
@@ -0,0 +1 @@
+label("$(1-t)^3z_0+3t(1-t)^2c_0+3t^2(1-t)c_1+t^3z_1\qquad 0\le t\le 1$.",(0,0));
diff --git a/Build/source/utils/asymptote/doc/bezier2.asy b/Build/source/utils/asymptote/doc/bezier2.asy
new file mode 100644
index 00000000000..745fb649dd1
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/bezier2.asy
@@ -0,0 +1,21 @@
+import beziercurve;
+
+pair midpoint(pair a, pair b) {return interp(a,b,0.5);}
+
+pair m0=midpoint(z0,c0);
+pair m1=midpoint(c0,c1);
+pair m2=midpoint(c1,z1);
+
+draw(m0--m1--m2,dashed);
+dot("$m_0$",m0,NW,red);
+dot("$m_1$",m1,N,red);
+dot("$m_2$",m2,red);
+
+pair m3=midpoint(m0,m1);
+pair m4=midpoint(m1,m2);
+pair m5=midpoint(m3,m4);
+
+draw(m3--m4,dashed);
+dot("$m_3$",m3,NW,red);
+dot("$m_4$",m4,NE,red);
+dot("$m_5$",m5,N,red);
diff --git a/Build/source/utils/asymptote/doc/beziercurve.asy b/Build/source/utils/asymptote/doc/beziercurve.asy
new file mode 100644
index 00000000000..338109bbd6e
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/beziercurve.asy
@@ -0,0 +1,12 @@
+size(400);
+pair z0=(0,0);
+pair c0=(1,1);
+pair c1=(2,1);
+pair z1=(3,0);
+draw(z0..controls c0 and c1 .. z1,blue);
+
+draw(z0--c0--c1--z1,dashed);
+dot("$z_0$",z0,W,red);
+dot("$c_0$",c0,NW,red);
+dot("$c_1$",c1,NE,red);
+dot("$z_1$",z1,red);
diff --git a/Build/source/utils/asymptote/doc/bigdiagonal.asy b/Build/source/utils/asymptote/doc/bigdiagonal.asy
new file mode 100644
index 00000000000..7242b7ae845
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/bigdiagonal.asy
@@ -0,0 +1,2 @@
+size(0,100.5);
+draw((0,0)--(2,1),Arrow);
diff --git a/Build/source/utils/asymptote/doc/binarytreetest.asy b/Build/source/utils/asymptote/doc/binarytreetest.asy
new file mode 100644
index 00000000000..af55292e4a3
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/binarytreetest.asy
@@ -0,0 +1,13 @@
+import binarytree;
+
+picture pic,pic2;
+
+binarytree bt=binarytree(1,2,4,nil,5,nil,nil,0,nil,nil,3,6,nil,nil,7);
+draw(pic,bt,condensed=false);
+
+binarytree st=searchtree(10,5,2,1,3,4,7,6,8,9,15,13,12,11,14,17,16,18,19);
+draw(pic2,st,blue,condensed=true);
+
+add(pic.fit(),(0,0),10N);
+add(pic2.fit(),(0,0),10S);
+
diff --git a/Build/source/utils/asymptote/doc/brokenaxis.asy b/Build/source/utils/asymptote/doc/brokenaxis.asy
new file mode 100644
index 00000000000..9de9fa414d3
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/brokenaxis.asy
@@ -0,0 +1,25 @@
+import graph;
+
+size(200,150,IgnoreAspect);
+
+// Break the x axis at 3; restart at 8:
+real a=3, b=8;
+
+// Break the y axis at 100; restart at 1000:
+real c=100, d=1000;
+
+scale(Broken(a,b),BrokenLog(c,d));
+
+real[] x={1,2,4,6,10};
+real[] y=x^4;
+
+draw(graph(x,y),red,MarkFill[0]);
+
+xaxis("$x$",BottomTop,LeftTicks(Break(a,b)));
+yaxis("$y$",LeftRight,RightTicks(Break(c,d)));
+
+label(rotate(90)*Break,(a,point(S).y));
+label(rotate(90)*Break,(a,point(N).y));
+label(Break,(point(W).x,ScaleY(c)));
+label(Break,(point(E).x,ScaleY(c)));
+
diff --git a/Build/source/utils/asymptote/doc/colo-asy.tex b/Build/source/utils/asymptote/doc/colo-asy.tex
new file mode 100644
index 00000000000..a9f2a9b636c
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/colo-asy.tex
@@ -0,0 +1,84 @@
+%D \module
+%D [ file=colo-asy,
+%D version=2009.05.20,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=\asymptote\ Colors,
+%D author=\asymptote\ developers,
+%D date=\currentdate,
+%D copyright={put something here}]
+%C
+%C any copyright notice may go here
+
+% call with \setupcolor[asy]
+
+\definecolor [cyan] [c=1.00,m=0.00,y=0.00,k=0.00]
+\definecolor [magenta] [c=0.00,m=1.00,y=0.00,k=0.00]
+\definecolor [yellow] [c=0.00,m=0.00,y=1.00,k=0.00]
+\definecolor [black] [c=0.00,m=0.00,y=0.00,k=1.00]
+
+\definecolor [white] [c=0.00,m=0.00,y=0.00,k=0.00]
+\definecolor [gray] [c=0.00,m=0.00,y=0.00,k=0.50]
+
+\definecolor [red] [c=0.00,m=1.00,y=1.00,k=0.00]
+\definecolor [green] [c=1.00,m=0.00,y=1.00,k=0.00]
+\definecolor [blue] [c=1.00,m=1.00,y=0.00,k=0.00]
+
+\definecolor [palered] [c=0.00,m=0.25,y=0.25,k=0.00]
+\definecolor [palegreen] [c=0.25,m=0.00,y=0.25,k=0.00]
+\definecolor [paleblue] [c=0.25,m=0.25,y=0.00,k=0.00]
+\definecolor [palecyan] [c=0.25,m=0.00,y=0.00,k=0.00]
+\definecolor [palemagenta] [c=0.00,m=0.25,y=0.00,k=0.00]
+\definecolor [paleyellow] [c=0.00,m=0.00,y=0.25,k=0.00]
+\definecolor [palegray] [c=0.00,m=0.00,y=0.00,k=0.05]
+\definecolor [lightred] [c=0.00,m=0.50,y=0.50,k=0.00]
+\definecolor [lightgreen] [c=0.50,m=0.00,y=0.50,k=0.00]
+\definecolor [lightblue] [c=0.50,m=0.50,y=0.00,k=0.00]
+\definecolor [lightcyan] [c=0.50,m=0.00,y=0.00,k=0.00]
+\definecolor [lightmagenta] [c=0.00,m=0.50,y=0.00,k=0.00]
+\definecolor [lightyellow] [c=0.00,m=0.00,y=0.50,k=0.00]
+\definecolor [lightgray] [c=0.00,m=0.00,y=0.00,k=0.10]
+\definecolor [mediumred] [c=0.00,m=0.75,y=0.75,k=0.00]
+\definecolor [mediumgreen] [c=0.75,m=0.00,y=0.75,k=0.00]
+\definecolor [mediumblue] [c=0.75,m=0.75,y=0.00,k=0.00]
+\definecolor [mediumcyan] [c=0.75,m=0.00,y=0.00,k=0.00]
+\definecolor [mediummagenta] [c=0.00,m=0.75,y=0.00,k=0.00]
+\definecolor [mediumyellow] [c=0.00,m=0.00,y=0.75,k=0.00]
+\definecolor [mediumgray] [c=0.00,m=0.00,y=0.00,k=0.25]
+\definecolor [heavyred] [c=0.00,m=1.00,y=1.00,k=0.25]
+\definecolor [heavygreen] [c=1.00,m=0.00,y=1.00,k=0.25]
+\definecolor [heavyblue] [c=1.00,m=1.00,y=0.00,k=0.25]
+\definecolor [heavycyan] [c=1.00,m=0.00,y=0.00,k=0.25]
+\definecolor [heavymagenta] [c=0.00,m=1.00,y=0.00,k=0.25]
+\definecolor [lightolive] [c=0.00,m=0.00,y=1.00,k=0.25]
+\definecolor [heavygray] [c=0.00,m=0.00,y=0.00,k=0.75]
+\definecolor [deepred] [c=0.00,m=1.00,y=1.00,k=0.50]
+\definecolor [deepgreen] [c=1.00,m=0.00,y=1.00,k=0.50]
+\definecolor [deepblue] [c=1.00,m=1.00,y=0.00,k=0.50]
+\definecolor [deepcyan] [c=1.00,m=0.00,y=0.00,k=0.50]
+\definecolor [deepmagenta] [c=0.00,m=1.00,y=0.00,k=0.50]
+\definecolor [olive] [c=0.00,m=0.00,y=1.00,k=0.50]
+\definecolor [deepgray] [c=0.00,m=0.00,y=0.00,k=0.90]
+\definecolor [darkred] [c=0.00,m=1.00,y=1.00,k=0.75]
+\definecolor [darkgreen] [c=1.00,m=0.00,y=1.00,k=0.75]
+\definecolor [darkblue] [c=1.00,m=1.00,y=0.00,k=0.75]
+\definecolor [darkcyan] [c=1.00,m=0.00,y=0.00,k=0.75]
+\definecolor [darkmagenta] [c=0.00,m=1.00,y=0.00,k=0.75]
+\definecolor [darkolive] [c=0.00,m=0.00,y=1.00,k=0.75]
+\definecolor [darkgray] [c=0.00,m=0.00,y=0.00,k=0.95]
+\definecolor [orange] [c=0.00,m=0.50,y=1.00,k=0.00]
+\definecolor [fuchsia] [c=0.00,m=1.00,y=0.50,k=0.00]
+\definecolor [chartreuse] [c=0.50,m=0.00,y=1.00,k=0.00]
+\definecolor [springgreen] [c=1.00,m=0.00,y=0.50,k=0.00]
+\definecolor [purple] [c=0.50,m=1.00,y=0.00,k=0.00]
+\definecolor [royalblue] [c=1.00,m=0.50,y=0.00,k=0.00]
+\definecolor [salmon] [c=0.00,m=0.50,y=0.50,k=0.00]
+\definecolor [brown] [c=0.00,m=1.00,y=1.00,k=0.50]
+\definecolor [darkbrown] [c=0.00,m=1.00,y=1.00,k=0.75]
+\definecolor [pink] [c=0.00,m=0.25,y=0.00,k=0.00]
+\definecolor [palegrey] [c=0.00,m=0.00,y=0.00,k=0.05]
+\definecolor [lightgrey] [c=0.00,m=0.00,y=0.00,k=0.10]
+\definecolor [mediumgrey] [c=0.00,m=0.00,y=0.00,k=0.25]
+\definecolor [grey] [c=0.00,m=0.00,y=0.00,k=0.50]
+\definecolor [heavygrey] [c=0.00,m=0.00,y=0.00,k=0.50]
+\definecolor [deepgrey] [c=0.00,m=0.00,y=0.00,k=0.90]
+\definecolor [darkgrey] [c=0.00,m=0.00,y=0.00,k=0.95]
diff --git a/Build/source/utils/asymptote/doc/colons.asy b/Build/source/utils/asymptote/doc/colons.asy
new file mode 100644
index 00000000000..3cdb6b42962
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/colons.asy
@@ -0,0 +1 @@
+draw((0,0){up}::(100,25){right}::(200,0){down});
diff --git a/Build/source/utils/asymptote/doc/colors.asy b/Build/source/utils/asymptote/doc/colors.asy
new file mode 100644
index 00000000000..2f2bf988d0c
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/colors.asy
@@ -0,0 +1,115 @@
+int i=0;
+int j=0;
+
+bool components=false;
+
+pen p;
+
+void col(... string[] s) {
+ for(int n=0; n < s.length; ++n) {
+ j -= 10;
+ string s=s[n];
+ eval("p="+s+";",true);
+ if(components) {
+ real[] a=colors(p);
+ for(int i=0; i < a.length; ++i)
+ s += " "+(string) a[i];
+ }
+ label(s,(i+10,j),E);
+ filldraw(box((i,j-5),(i+10,j+5)),p);
+ }
+}
+
+col("palered");
+col("lightred");
+col("mediumred");
+col("red");
+col("heavyred");
+col("brown");
+col("darkbrown");
+j -= 10;
+
+col("palegreen");
+col("lightgreen");
+col("mediumgreen");
+col("green");
+col("heavygreen");
+col("deepgreen");
+col("darkgreen");
+j -= 10;
+
+col("paleblue");
+col("lightblue");
+col("mediumblue");
+col("blue");
+col("heavyblue");
+col("deepblue");
+col("darkblue");
+j -= 10;
+
+i += 150;
+j=0;
+
+col("palecyan");
+col("lightcyan");
+col("mediumcyan");
+col("cyan");
+col("heavycyan");
+col("deepcyan");
+col("darkcyan");
+j -= 10;
+
+col("pink");
+col("lightmagenta");
+col("mediummagenta");
+col("magenta");
+col("heavymagenta");
+col("deepmagenta");
+col("darkmagenta");
+j -= 10;
+
+col("paleyellow");
+col("lightyellow");
+col("mediumyellow");
+col("yellow");
+col("lightolive");
+col("olive");
+col("darkolive");
+j -= 10;
+
+col("palegray");
+col("lightgray");
+col("mediumgray");
+col("gray");
+col("heavygray");
+col("deepgray");
+col("darkgray");
+j -= 10;
+
+i += 150;
+j=0;
+
+col("black");
+col("white");
+j -= 10;
+
+col("orange");
+col("fuchsia");
+j -= 10;
+col("chartreuse");
+col("springgreen");
+j -= 10;
+col("purple");
+col("royalblue");
+j -= 10;
+
+col("Cyan");
+col("Magenta");
+col("Yellow");
+col("Black");
+
+j -= 10;
+
+col("cmyk(red)");
+col("cmyk(blue)");
+col("cmyk(green)");
diff --git a/Build/source/utils/asymptote/doc/cube.asy b/Build/source/utils/asymptote/doc/cube.asy
new file mode 100644
index 00000000000..acfecfdd7d4
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/cube.asy
@@ -0,0 +1,15 @@
+import three;
+
+currentprojection=orthographic(5,4,2,center=true);
+
+size(5cm);
+size3(3cm,5cm,8cm);
+
+draw(unitbox);
+
+dot(unitbox,red);
+
+label("$O$",(0,0,0),NW);
+label("(1,0,0)",(1,0,0),S);
+label("(0,1,0)",(0,1,0),E);
+label("(0,0,1)",(0,0,1),Z);
diff --git a/Build/source/utils/asymptote/doc/cylinderskeleton.asy b/Build/source/utils/asymptote/doc/cylinderskeleton.asy
new file mode 100644
index 00000000000..7dcd1c81190
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/cylinderskeleton.asy
@@ -0,0 +1,6 @@
+import solids;
+
+size(0,100);
+
+revolution r=cylinder(O,1,1.5,Y+Z);
+draw(r,heavygreen);
diff --git a/Build/source/utils/asymptote/doc/datagraph.asy b/Build/source/utils/asymptote/doc/datagraph.asy
new file mode 100644
index 00000000000..62cca8ea896
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/datagraph.asy
@@ -0,0 +1,12 @@
+import graph;
+
+size(200,150,IgnoreAspect);
+
+real[] x={0,1,2,3};
+real[] y=x^2;
+
+draw(graph(x,y),red);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,
+ RightTicks(Label(fontsize(8pt)),new real[]{0,4,9}));
diff --git a/Build/source/utils/asymptote/doc/diagonal.asy b/Build/source/utils/asymptote/doc/diagonal.asy
new file mode 100644
index 00000000000..32f3fc04be0
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/diagonal.asy
@@ -0,0 +1 @@
+draw((0,0)--(100,100));
diff --git a/Build/source/utils/asymptote/doc/diatom.asy b/Build/source/utils/asymptote/doc/diatom.asy
new file mode 100644
index 00000000000..0d571e2c9c6
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/diatom.asy
@@ -0,0 +1,129 @@
+import graph;
+
+size(15cm,12cm,IgnoreAspect);
+
+real minpercent=20;
+real ignorebelow=0;
+string data="diatom.csv";
+string[] group;
+int[] begin,end;
+
+defaultpen(fontsize(8pt)+overwrite(MoveQuiet));
+
+file in=input(data).line().csv();
+
+string depthlabel=in;
+string yearlabel=in;
+string[] taxa=in;
+group=in;
+begin=in;
+real[] depth;
+int[] year;
+real[][] percentage;
+
+while(true) {
+ real d=in;
+ if(eof(in)) break;
+ depth.push(d);
+ year.push(in);
+ percentage.push(in);
+}
+
+percentage=transpose(percentage);
+real depthmin=-min(depth);
+real depthmax=-max(depth);
+
+int n=percentage.length;
+
+int final;
+for(int taxon=0; taxon < n; ++taxon) {
+ real[] P=percentage[taxon];
+ if(max(P) < ignorebelow) continue;
+ final=taxon;
+}
+
+real angle=45;
+real L=3cm;
+pair Ldir=L*dir(angle);
+real ymax=-infinity;
+real margin=labelmargin();
+
+real location=0;
+
+for(int i=0; i < begin.length-1; ++i) end[i]=begin[i+1]-1;
+end[begin.length-1]=n-1;
+
+typedef void drawfcn(frame f);
+drawfcn[] draw=new drawfcn[begin.length];
+
+pair z0;
+
+for(int taxon=0; taxon < n; ++taxon) {
+ real[] P=percentage[taxon];
+ real maxP=max(P);
+ if(maxP < ignorebelow) continue;
+ picture pic;
+ real x=1;
+ if(maxP < minpercent) x=minpercent/maxP;
+ if(maxP > 100) x=50/maxP;
+ scale(pic,Linear(true,x),Linear(-1));
+ filldraw(pic,(0,depthmin)--graph(pic,P,depth)--(0,depthmax)--cycle,
+ gray(0.9));
+ xaxis(pic,Bottom,LeftTicks("$%.3g$",beginlabel=false,0,2),above=true);
+ xaxis(pic,Top,above=true);
+
+ frame label;
+ label(label,rotate(angle)*TeXify(taxa[taxon]),(0,0),N);
+
+ pair z=point(pic,N);
+ pair v=max(label);
+ int taxon=taxon;
+ pic.add(new void(frame f, transform t) {
+ pair z1=t*z+v;
+ ymax=max(ymax,z1.y+margin);
+ });
+
+ for(int i=0; i < begin.length; ++i) {
+ pair z=point(pic,N);
+ pair v=max(label);
+ if(taxon == begin[i]) {
+ pic.add(new void(frame f, transform t) {
+ pair Z=t*z+v;
+ z0=Z;
+ pair w0=Z+Ldir;
+ });
+ } else if(taxon == end[i]) {
+ int i=i;
+ pair align=2N;
+ pic.add(new void(frame, transform t) {
+ pair z0=z0;
+ pair z1=t*z+v;
+ pair w1=z1+Ldir;
+ draw[i]=new void(frame f) {
+ path g=z0--(z0.x+(ymax-z0.y)/Tan(angle),ymax)--
+ (z1.x+(ymax-z1.y)/Tan(angle),ymax)--z1;
+ draw(f,g);
+ label(f,group[i],point(g,1.5),align);
+ };
+ });
+ }
+ }
+
+ add(pic,label,point(pic,N));
+
+ if(taxon == 0) yaxis(pic,depthlabel,Left,RightTicks(0,10),above=true);
+ if(taxon == final) yaxis(pic,Right,LeftTicks("%",0,10),above=true);
+
+ add(shift(location,0)*pic);
+ location += pic.userMax().x;
+}
+
+add(new void(frame f, transform) {
+ for(int i=0; i < draw.length; ++i)
+ draw[i](f);
+ });
+
+for(int i=0; i < year.length; ++i)
+ if(year[i] != 0) label((string) year[i],(location,-depth[i]),E);
+
+label("\%",(0.5*location,point(S).y),5*S);
diff --git a/Build/source/utils/asymptote/doc/diatom.csv b/Build/source/utils/asymptote/doc/diatom.csv
new file mode 100644
index 00000000000..d05c3f4bc9a
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/diatom.csv
@@ -0,0 +1,28 @@
+"sediment depth (cm)","year","Achnanthes minutissima Kuetzing","Anomoeoneis vitrea (Grunow) Ross","Asterionella formosa Hassall","Tabellaria flocculosa (Roth) Kuetzing","Fragilaria cf. tenera","Chaetoceros muelleri/elmorei cysts","Aulacoseira spp. ","Fragilaria capucina var. vaucheriae (Kuetzing)","Fragilaria crotonensis Kitton"
+"A","B","C"
+0,4,6
+0,2000,11.6959064327485,9.55165692007797,49.6101364522417,1.364522417154,0,0.974658869395711,0,2.14424951267057,4.09356725146199
+10,1998,20.2676864244742,11.2810707456979,34.7992351816444,2.39005736137667,0,0.191204588910134,0.573613766730402,0.382409177820268,7.55258126195029
+20,1996,21.1282051282051,33.6410256410256,24,2.35897435897436,0.615384615384615,0,0.205128205128205,0.615384615384615,2.56410256410256
+30,1994,25.7620452310718,21.0422812192724,31.3667649950836,2.16322517207473,0.393313667649951,0.393313667649951,0.196656833824975,1.76991150442478,3.73647984267453
+40,1992,21.0422812192724,16.5191740412979,42.9695181907571,0.589970501474926,0,0.983284169124877,0.589970501474926,0.393313667649951,1.96656833824975
+50,1990,23.1067961165049,24.0776699029126,29.126213592233,1.35922330097087,0,0.970873786407767,0.388349514563107,0.58252427184466,3.30097087378641
+60,1988,35.0738916256158,33.3004926108374,4.33497536945813,1.37931034482759,0.591133004926108,1.97044334975369,1.18226600985222,0.985221674876847,2.75862068965517
+70,1986,42.2090729783037,33.7278106508876,2.26824457593688,1.38067061143984,0.788954635108481,1.18343195266272,0.591715976331361,1.38067061143984,3.25443786982249
+90,1984,34.5098039215686,41.9607843137255,0.196078431372549,2.15686274509804,0.588235294117647,2.74509803921569,0.588235294117647,2.15686274509804,0
+95,1982,38.0487804878049,45.4634146341463,0.487804878048781,0.975609756097561,0.975609756097561,0,0.390243902439024,0.390243902439024,0
+110,1980,40.1860465116279,41.4883720930233,1.30232558139535,0.837209302325581,0,0.930232558139535,0.372093023255814,0.372093023255814,1.3953488372093
+130,1978,39.6501457725948,42.1768707482993,0.291545189504373,0.194363459669582,2.72108843537415,1.55490767735666,0,1.36054421768707,0.777453838678329
+150,1972,32.6298701298701,31.4935064935065,1.86688311688312,1.78571428571429,0.162337662337662,13.961038961039,0.162337662337662,1.94805194805195,1.86688311688312
+170,1970,30.7692307692308,47.534516765286,0.986193293885602,3.35305719921105,0.19723865877712,1.38067061143984,0,1.18343195266272,0.591715976331361
+190,1965,40.5268490374873,37.8926038500507,1.82370820668693,2.63424518743668,0,1.21580547112462,0.405268490374873,1.21580547112462,1.01317122593718
+260,1961,40.4494382022472,26.0299625468165,0.468164794007491,1.31086142322097,0.561797752808989,8.05243445692884,0,3.74531835205992,0.374531835205993
+280,1950,44.946025515211,11.9725220804711,0.294406280667321,0.785083415112856,16.48675171737,1.96270853778214,0.392541707556428,2.35525024533857,0
+290,1942,41.2818096135721,8.29406220546654,0.188501413760603,0.282752120640905,28.6522148916117,0.942507068803016,0.377002827521206,4.33553251649387,0
+300,1940,18.0995475113122,12.3076923076923,0,0.180995475113122,40.3619909502262,5.61085972850679,0,2.35294117647059,0
+310,1920,28.6844708209693,11.2759643916914,0.593471810089021,3.26409495548961,13.0563798219585,13.2542037586548,0.19782393669634,9.89119683481701,0.989119683481701
+320,1915,6.17977528089888,1.31086142322097,4.30711610486891,6.74157303370787,32.7715355805243,34.4569288389513,1.31086142322097,2.62172284644195,0
+330,1910,4.03846153846154,0.769230769230769,14.5192307692308,36.4423076923077,5,0.769230769230769,11.1538461538462,0,2.11538461538462
+340,1888,7.37148399612027,1.1639185257032,9.40834141610087,31.8137730358875,1.1639185257032,0.969932104752667,14.3549951503395,0.193986420950533,0.969932104752667
+400,1763,2.69749518304432,0.192678227360308,24.8554913294798,26.7822736030829,0.385356454720617,2.69749518304432,20.0385356454721,0,1.54142581888247
+450,1726,2.37859266600595,0.396432111000991,9.71258671952428,28.5431119920714,0.198216055500496,0.594648166501487,30.5252725470763,0,0.792864222001982
diff --git a/Build/source/utils/asymptote/doc/dots.asy b/Build/source/utils/asymptote/doc/dots.asy
new file mode 100644
index 00000000000..49acfce341f
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/dots.asy
@@ -0,0 +1 @@
+draw((0,0){up}..(100,25){right}..(200,0){down});
diff --git a/Build/source/utils/asymptote/doc/eetomumu.asy b/Build/source/utils/asymptote/doc/eetomumu.asy
new file mode 100644
index 00000000000..309547d1455
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/eetomumu.asy
@@ -0,0 +1,60 @@
+import feynman;
+
+
+// set default line width to 0.8bp
+currentpen = linewidth(0.8);
+
+// scale all other defaults of the feynman module appropriately
+fmdefaults();
+
+// define vertex and external points
+
+real L = 50;
+
+pair zl = (-0.75*L,0);
+pair zr = (+0.75*L,0);
+
+pair xu = zl + L*dir(+120);
+pair xl = zl + L*dir(-120);
+
+pair yu = zr + L*dir(+60);
+pair yl = zr + L*dir(-60);
+
+
+// draw propagators and vertices
+
+drawFermion(xu--zl);
+drawFermion(zl--xl);
+
+drawPhoton(zl--zr);
+
+drawFermion(yu--zr);
+drawFermion(zr--yl);
+
+drawVertex(zl);
+drawVertex(zr);
+
+
+// draw momentum arrows and momentum labels
+
+drawMomArrow(xl--zl, Relative(left));
+label(Label("$k'$",2RightSide), xl--zl);
+
+label(Label("$k$",2LeftSide), xu--zl);
+
+drawMomArrow(zl--zr, Relative(left));
+label(Label("$q$",2RightSide), zl--zr);
+
+drawMomArrow(zr--yu, Relative(right));
+label(Label("$p'$",2LeftSide), zr--yu);
+
+label(Label("$p$",2RightSide), zr--yl);
+
+
+// draw particle labels
+
+label("$e^-$", xu, left);
+label("$e^+$", xl, left);
+
+label("$\mu^+$", yu, right);
+label("$\mu^-$", yl, right);
diff --git a/Build/source/utils/asymptote/doc/elliptic.asy b/Build/source/utils/asymptote/doc/elliptic.asy
new file mode 100644
index 00000000000..71fb80db6d5
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/elliptic.asy
@@ -0,0 +1,115 @@
+struct curve {
+ real a=0;
+ real b=8;
+
+ real y2(real x) {
+ return x^3+a*x+b;
+ }
+
+ real disc() {
+ return -16*(4*a*a*a+27*b*b);
+ }
+
+ real lowx () {
+ return sqrt(-a/3);
+ }
+
+ int comps() {
+ if (a < 0) {
+ real x=sqrt(-a/3);
+ return y2(x) < 0 ? 2 : 1;
+ }
+ return 1;
+ }
+
+ void locus(picture pic=currentpicture, real m, real M, int n=100,
+ pen p=currentpen) {
+ path flip(path p, bool close) {
+ path pp=reverse(yscale(-1)*p)..p;
+ return close ? pp..cycle : pp;
+ }
+ path section(real m, real M, int n) {
+ guide g;
+ real width=(M-m)/n;
+ for(int i=0; i <= n; ++i) {
+ real x=m+width*i;
+ real yy=y2(x);
+ if (yy > 0)
+ g=g..(x,sqrt(yy));
+ }
+ return g;
+ }
+
+ if (comps() == 1) {
+ draw(pic,flip(section(m,M,n),false),p);
+ }
+ else {
+ real x=lowx(); // The minimum on x^3+ax+b
+ if (m < x)
+ draw(pic,flip(section(m,min(x,M),n),true),p);
+ if (x < M)
+ draw(pic,flip(section(max(x,m),M,n),false),p);
+ }
+ }
+
+ pair neg(pair P) {
+ return finite(P.y) ? yscale(-1)*P : P;
+ }
+
+ pair add(pair P, pair Q) {
+ if (P.x == Q.x && P.x != Q.x)
+ return (0,infinity);
+ else {
+ real lambda=P == Q ? (3*P.x^2+a)/(2*P.y) : (Q.y-P.y)/(Q.x-P.x);
+ real Rx=lambda^2-P.x-Q.x;
+ return (Rx,(P.x-Rx)*lambda-P.y);
+ }
+ }
+}
+
+import graph;
+import math;
+
+size(0,200);
+
+curve c; c.a=-1; c.b=4;
+
+pair oncurve(real x)
+{
+ return (x,sqrt(c.y2(x)));
+}
+
+picture output;
+
+axes();
+c.locus(-4,3,.3red+.7blue);
+
+pair P=oncurve(-1),Q=oncurve(1.2);
+pair PP=c.add(P,P),sum=c.add(P,Q);
+
+save();
+
+drawline(P,Q,dashed);
+drawline(c.neg(sum),sum,dashed);
+dot("$P$", P, NW);
+dot("$Q$", Q, SSE);
+dot(c.neg(sum));
+dot("$P+Q$", sum, 2SW);
+
+add(output,currentpicture.fit(),(-0.5cm,0),W);
+
+restore();
+
+save();
+
+drawline(P,c.neg(PP),dashed);
+drawline(c.neg(PP),PP,dashed);
+dot("$P$", P, NW);
+dot(c.neg(PP));
+dot("$2P$", PP, SW);
+
+add(output,currentpicture.fit(),(0.5cm,0),E);
+
+shipout(output);
+
+restore();
diff --git a/Build/source/utils/asymptote/doc/errorbars.asy b/Build/source/utils/asymptote/doc/errorbars.asy
new file mode 100644
index 00000000000..a8707b24972
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/errorbars.asy
@@ -0,0 +1,42 @@
+import graph;
+
+picture pic;
+real xsize=200, ysize=140;
+size(pic,xsize,ysize,IgnoreAspect);
+
+pair[] f={(5,5),(50,20),(90,90)};
+pair[] df={(0,0),(5,7),(0,5)};
+
+errorbars(pic,f,df,red);
+draw(pic,graph(pic,f),"legend",
+ marker(scale(0.8mm)*unitcircle,red,FillDraw(blue),above=false));
+
+scale(pic,true);
+
+xaxis(pic,"$x$",BottomTop,LeftTicks);
+yaxis(pic,"$y$",LeftRight,RightTicks);
+add(pic,legend(pic),point(pic,NW),20SE,UnFill);
+
+picture pic2;
+size(pic2,xsize,ysize,IgnoreAspect);
+
+frame mark;
+filldraw(mark,scale(0.8mm)*polygon(6),green,green);
+draw(mark,scale(0.8mm)*cross(6),blue);
+
+draw(pic2,graph(pic2,f),marker(mark,markuniform(5)));
+
+scale(pic2,true);
+
+xaxis(pic2,"$x$",BottomTop,LeftTicks);
+yaxis(pic2,"$y$",LeftRight,RightTicks);
+
+yequals(pic2,55.0,red+Dotted);
+xequals(pic2,70.0,red+Dotted);
+
+// Fit pic to W of origin:
+add(pic.fit(),(0,0),W);
+
+// Fit pic2 to E of (5mm,0):
+add(pic2.fit(),(5mm,0),E);
+
diff --git a/Build/source/utils/asymptote/doc/exp.asy b/Build/source/utils/asymptote/doc/exp.asy
new file mode 100644
index 00000000000..3558a2759bd
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/exp.asy
@@ -0,0 +1,14 @@
+import graph;
+size(150,0);
+
+real f(real x) {return exp(x);}
+pair F(real x) {return (x,f(x));}
+
+draw(graph(f,-4,2,operator ..),red);
+
+xaxis("$x$");
+yaxis("$y$",0);
+
+labely(1,E);
+label("$e^x$",F(1),SE);
+
diff --git a/Build/source/utils/asymptote/doc/external-proposal.html b/Build/source/utils/asymptote/doc/external-proposal.html
new file mode 100644
index 00000000000..3dcc97d95bd
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/external-proposal.html
@@ -0,0 +1,415 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1-strict.dtd">
+<html>
+ <head>
+ <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
+ <title>Asymptote Proposal - External Modules</title>
+ <style><!--
+ --></style>
+ </head>
+ <body>
+ <h1>Asymptote Proposal &mdash External Modules</h1>
+ <h2>Overview</h2>
+ <p>External modules allow users to extend Asymptote by calling functions
+ written in another programming language.</p>
+ <p>Users do this by writing a .asyc file, which contains a mix of
+ Asymptote code and code from another language, say C++. Then, a program
+ is run which produces a .asy file and a C++ source file. The C++ file is
+ compiled to produce a shared library file. Then, the .asy file can be
+ imported in Asymptote to use the externally defined features.</p>
+ <p>This spec is describes a proposed feature that has not yet been
+ implemented. It is incomplete, and does not address all of the issues
+ involved in implementing the feature.</p>
+ <h2>Example</h2>
+ <p>Let&#8217;s look at a simple example that shows off the main features.
+ Asymptote currently doesn&#8217;t offer a way to read the contents of a
+ directory. This would be useful if, say, we wanted to make a series of
+ graphs for every .csv file in a directory.</p>
+ <pre>
+/*****
+ * dir.asyc
+ * Andy Hammerlindl 2007/09/11
+ *
+ * An example for the proposed external module support in Asymptote. This reads
+ * the contents of a directory via the POSIX commands.
+ *
+ * Example usage in asymptote:
+ * access dir;
+ * dir.entry[] entries= dir.open('.');
+ * for (dir.entry e : entries)
+ * write(e.name);
+ *****/
+
+// Verbatim code will appear in the c++ or asy file (as specified) interleaved
+// in the same order as it appears here.
+verbatim c++ {
+ #include &lt;sys/types.h&gt;
+ #include &lt;dirent.h&gt;
+ #include &lt;errno.h&gt;
+
+ // asy.h is included by default (needed for hidden code, anyway).
+ // Asymptote-specific types, such as array below, are in the asy namespace.
+ using namespace asy;
+}
+
+// Define a new opaque type in asy which is internally represented by struct
+// dirent *. This is too messy to expose to users of the module, so define
+// everything as private.
+private asytype const struct dirent *entry_t;
+
+private int entry_d_ino(entry_t e) {
+ return (Int)e-&gt;d_ino;
+}
+
+private int entry_d_off(entry_t e) {
+ return (Int)e-&gt;d_off;
+}
+
+private int entry_d_reclen(entry_t e) {
+ return (Int)e-&gt;reclen;
+}
+
+private string entry_d_type(entry_t e) {
+ return string( /*length*/ 1, e-&gt;d_type);
+}
+
+private string entry_d_name(entry_t e) {
+ return string(e-&gt;d_name);
+}
+
+// Define an asy structure to expose the information. These steps are annoying,
+// but straightforward, and not too hard to plow through.
+verbatim asy {
+ struct entry {
+ restricted int ino;
+ restricted int off;
+ restricted int reclen;
+ restricted int type;
+ restricted string name;
+
+ void operator init(entry_t e) {
+ ino=entry_d_ino(e);
+ off=entry_d_off(e);
+ reclen=entry_d_reclen(e);
+ type=entry_d_type(e);
+ name=entry_d_name(e);
+ }
+ }
+}
+
+
+// Given the name of a directory, return an array of entries. Return 0
+// (a null array) on error.
+private entry_t[] base_read(string name)
+{
+ DIR *dir=opendir(name.c_str());
+
+ // TODO: Add standard style of error reporting.
+ if (dir == NULL)
+ return 0;
+
+ // Create the array structure.
+ // array is derived from gc, so will be automatically memory-managed.
+ array *a=new array();
+
+ struct dirent *entry;
+ while (entry=readdir(dir))
+ a-&gt;push&lt;struct dirent *&gt;(entry);
+
+ // The loop has exited, either by error, or after reading the entire
+ // directory. Check before closedir(), in case that call resets errno.
+ if (errno != 0) {
+ closedir(dir);
+ return 0;
+ }
+
+ closedir(dir);
+ return a;
+}
+
+verbatim asy {
+ private entry[] cleanEntries(entry_t[] raw_entries) {
+ if (raw_entries) {
+ entry[] entries;
+ for (entry_t e : raw_entries)
+ entries.push(entry(e));
+ return entries;
+ }
+ return null;
+ }
+
+ entry[] read(string name) {
+ return cleanEntries(base_read(name));
+ }
+}
+
+</pre>
+ <h2>Type Mappings</h2>
+ <p>Types in Asymptote do not directly relate to types in C++, but there
+ is a partial mapping between them. The header file
+ <code>asymptote.h</code> provides typedefs for the primitive asymptote
+ types. For instance <code>string</code> in Asymptote maps to the C++
+ class <code>asy::string</code> which is a variant of
+ <code>std::string</code> and <code>real</code> to <code>asy::real</code>
+ which is a basic floating point type (probably <code>double</code>).
+ Because <code>int</code> is a reserved word in C++, the Asymptote type
+ <code>int</code> is mapped to <code>asy::Int</code> which is one of the
+ basic signed numeric types in C++ (currently 64 bit).
+ <code>asy::pair</code> is a class that implements complex numbers. In
+ the first version of the external module implementation, these will be
+ the only primitive types with mappings, but eventually all of them will
+ be added.</p>
+
+ <p>All Asymptote arrays, regardless of the cell type, are mapped to
+ <code>asy::array *</code> where <code>asy::array</code> is a C++ class.
+ The cells of the array are of the type <code>asy::item</code> which can
+ hold any Asymptote data type. Items can be constructed from any C++
+ type. Once constructed, the value of an item can be retrieved by the
+ function <code>template&lt;typename T&gt; T get(const item&amp;)</code>.
+ Calling <code>get</code> on an item using the wrong type generates a
+ runtime error. </p>
+<pre>
+// Examples of using item.
+item x((asy::Int)2);
+item y(3.4);
+item z=new array;
+item w=(asy::real)3.4;
+
+cout &lt;&lt; get&lt;asy::Int&gt;(x);
+cout &lt;&lt; get&lt;double&gt;(y);
+
+x=y; // x now stores a double.
+cout &lt;&lt; get&lt;double&gt;(x);
+
+cout &lt;&lt; get&lt;asy::real&gt;(w);
+</pre>
+
+ <p>The <code>asy::array</code> class implements, at a minimum, the
+ methods:</p>
+ <ul>
+ <li><code>size_t size()</code>
+ which returns the number of elements,</li>
+ <li><code>template &lt;typename T&gt; T read(size_t i) const</code>
+ which returns the i-th element, interpreted as being of type t.</li>
+ <li><code>template &lt;typename T&gt; void push(item i)</code>
+ adds the item to the end of the array.</li>
+ </ul>
+ <p>It allows access to elements of the array as items by
+ <code>operator[]</code>. We may specify that <code>asy::array</code>
+ be a model of the Random Access Container in the C++ Standard Template
+ Library. It is currently implemented as a subclass of an STL
+ vector.</p>
+<pre>
+// Example of a C++ function that doubles the entries in an array of integers.
+using namespace asy;
+
+void doubler(array *a) {
+ assert(a);
+ size_t length=a-&gt;size();
+ for (size_t i=0; i&lt;length; ++i) {
+ Int x=a-&gt;read&lt;Int&gt;(i); // This is shorthand for get&lt;Int&gt;((*a)[i]).
+ a[i]=2*x; // The type of 2*x is also Int, so this will enter
+ // the item as the proper type.
+ }
+}
+</pre>
+ <p>Users can map new Asymptote types to their own custom C++ types using
+ Opaque Type Declarations, explained below.</p>
+
+ <h2>Syntactic Features</h2>
+ <p>A .asyc file is neither an asy file with some C++ in it, nor a C++
+ with some asy code in it. It can only contain a small number of
+ specific constructs:</p>
+ <ul>
+ <li>Comments</li>
+ <li>Function Definitions</li>
+ <li>Verbatim Code Block</li>
+ <li>Opaque Type Declaration</li>
+ </ul>
+ <!-- Move to after constructs -->
+ <p>Each component may produce code for either the .asy file, the .cc
+ file, or both. The pieces of code produced by each construct appears in
+ the output file in the same order as the constructs in the .asyc. For
+ example, if a function definition occurs before a verbatim Asymptote
+ code block, we can be sure that the function is defined and can be used
+ in that block. Similarly, if a verbatim C++ block occurs before a
+ function definition, then the body of the function can use features
+ declared in the verbatim section.</p>
+
+ <h3>Comments</h3>
+ <p>C++/Asymptote style comments using <code>/* */</code> or
+ <code>//</code> are allowed at the top level. These do not affect the
+ definition of the module, but the implementation may copy them into the
+ .asy and .cc to help explain the resulting code.</p>
+
+ <h3>Verbatim Code Blocks</h3>
+ <p>Verbatim code, ie. code to be copied directly into the either
+ the output .asy or .cc file can be specified in the .asyc file by
+ enclosing it in a verbatim code block. This starts with the special
+ identifier <code>verbatim</code> followed by either <code>c++</code>
+ or <code>asy</code> to specify into which file the code will be copied,
+ and then a block of code in braces. When the .asyc file is parsed,
+ the parser keeps track of matching open and close braces inside the
+ verbatim code block, so that the brace at the start of the block can
+ be matched with the one at the end. This matching process will ignore
+ braces occuring in comments and string and character literals.</p>
+ <h4>Open issue</h4>
+ <p>It may prove to be impractical to walk through the code, matching
+ braces. Also, this plan precludes having a verbatim block with an
+ unbalanced number of braces which might be useful, say to start a
+ namespace at the beginning of the C++ file, and end it at the end of the
+ file. As such, it may be useful to have another technique. A really
+ simple idea (with obvious drawbacks) would be to use the first closing
+ braces that occur at the same indentation level as the verbatim keyword
+ (assuming that the code block itself will be indented). Other
+ alternatives are to use more complicated tokens such as <code>%{</code>
+ and <code>%}</code>, or the shell style <code>&lt;&lt;EOF</code>.</p>
+
+ <h3>Function Definitions</h3>
+ <p>A function definition given at the top level of the file (and not
+ inside a verbatim block) looks much like a function definition in
+ Asymptote or C++, but is actually a mix of both. The header of the
+ function is given in Asymptote code, and defines how the function will
+ look in the resulting Asymptote module. The body, on the other hand, is
+ given in C++, and defines how the function is implemented in C++. As a
+ simple example, consider:
+ <pre>real sum(real x, real y=0.0) {
+ return x+y;
+}</pre>
+ <h4>Header</h4>
+ <p> The header of the definition gives
+ the name, permission, return type, and parameters of the function.
+ Because the function is defined for use in Asymptote, all of the types
+ are given as Asymptote types.</p>
+ <h5>Permissions</h5>
+ <p>As in pure Asymptote, the function can optionally be given a
+ <code>private</code>, <code>restricted</code> or <code>public</code>
+ permission. If not specified, the permission is <code>public</code> by
+ default. This is the permission that the function will have when it is
+ part of the Asymptote module. The example of <code>sum</code> above
+ specifies no permission, so it is public.</p>
+ <p>Just as public methods such as <code>plain.draw</code> can be
+ re-assigned by scripts that import the <code>plain</code> module, the
+ current plan is to allow Asymptote code to modify public members of any
+ module, including ones defined using native code. This is in contrast
+ to builtin functions bindings, which cannot be modified.</p>
+ <h5>Return Type</h5>
+ <p>This gives the Asymptote return type of the function. This cannot be
+ an arbitrary Asymptote type, but must one which maps to a C++ type as
+ explained in the type mapping section above. Our example of <code>sum</code> gives
+ <code>real</code> as a return type, which maps to the C++ type
+ <code>asy::real</code>.</p>
+ <h5>Function Name</h5>
+ <p>This gives the name of the function as it will appear in the
+ Asymptote module. In our example, the Asymptote name is
+ <code>sum</code>. The name can be any Asymptote identifier, including
+ operator names, such as <code>operator +</code>.</p>
+ <p>It is important to note that the Asymptote name has no relation to
+ the C++ name of the function, which may be something strange, such as
+ <code>_asy_func_modulename162</code>. Also, the actual signature and
+ return type of the C++ function may bear no relation to the Asymptote
+ signature. That said, the C++ name of the function may be defined by
+ giving the function name as <code>asyname:cname</code>. Then it can be
+ referred to by other C++ code. The function will be defined with C
+ calling convention, so that its name is not mangled.</p>
+ <h5>Formal Parameters</h5>
+ <p>The function header takes a list of formal parameters. Just as in
+ pure Asymptote code, these can include <code>explicit</code>
+ keywords, type declarations with array and functional types, and rest
+ parameters. Just as with the return type of the function, the type of
+ each of the parameters must map to a C++ type.</p>
+ <p>Parameters may be given an optional Asymptote name and an optional
+ C++ name. These may be declared in one of six ways as in the following
+ examples:</p>
+ <pre>void f(int)
+void f(int name)
+void f(int :)
+void f(int asyname:)
+void f(int :cname)
+void f(int asyname:cname)
+</pre>
+ <p>If the parameter just contains a type, with no identifier,
+ then it has no Asymptote name and no C++ name. If it contains a single
+ name (with no colon), then that name is both the Asymptote and the C++
+ name. If it contains a colon in the place of an identifier, with an
+ optional name in front of the colon and an optional name behind the
+ colon, than the name in front (if given) is the Asymptote name, and the
+ name behind (if given) is the C++ name.</p>
+ <p>The Asymptote name can be any Asymptote identifier, including
+ operator names, but the C++ name must be a valid C++ identifier. For
+ instance <code>void f(int operator +)</code> is not allowed, as the
+ parameter would not have a valid C++ name. The examples
+ <code>void f(int operator +:)</code> and
+ <code>void f(int operator +:addop)</code> are allowed.</p>
+ <p>When called by Asymptote code, named arguments are only matched to
+ the Asymptote names, so for example a function defined by
+ <code>void f(int :x, string x:y)</code> could be called by
+ <code>f(x="hi mom", 4)</code>, but one defined by
+ <code>void f(int x, string x:y)</code> could not.</p>
+ <p>Each formal parameter may take a piece of code as a default value.
+ Because the function is implemented in C++, this code must be given as
+ C++ code. More akin to Asymptote than C++, default arguments may occur
+ for any non-rest parameters, not just those at the end of the list, and
+ may refer to earlier parameters in the list. Earlier parameters are
+ refered to by their C++ names. Example:
+<pre>void drawbox(pair center, real width, real height=2*width, pen p)</pre>
+ Default arguments are parsed by finding the next comma that is not part
+ of a comment, string literal, or character constant, and is not nested
+ inside parentheses. The C++ code between the equals-sign and the comma
+ is taken as the expression for the default argument.</p>
+ <h4>Body</h4>
+ <p>The body of the function is written as C++ code. When the .asyc
+ file is processed, this C++ code is copied verbatim into an actual C++
+ function providing the implementation. However, the actual body of the
+ resultant C++ function may contain code other than the body provided by
+ the user. This auxillary code could include instruction to retrieve the
+ arguments of the function from their representation in the Asymptote
+ virtual machine and bind them to local variables with their C++ names.
+ It could also include initialization and finalization code for the
+ function.</p>
+ <p>In writing code for the function body, one can be assured that all
+ function arguments with C++ names have been bound and are therefore
+ usable in the code. Since all parameters must have Asymptote types that
+ map to C++ types, the types of the paramaters in the body have the type
+ resulting from that mapping.</p>
+ <p>The <code>return</code> keyword can be used to return the result of
+ the function (or without an expression, if the return type was declared
+ as void). The Asymptote return type must map to a C++ type, and the
+ expression given in the return statement will be implicitly cast to that
+ type.</p>
+ <p>Since the implementation will likely not use an actual return
+ statement to return the value of the function back to the Asymptote
+ virtual machine, the interpreter of the .asyc file may walk through the
+ code converting return expressions into a special format in the actual
+ implementation of the function.<p>
+
+ <h3>Opaque Type Declarations</h3>
+ <p>There are a number of mappings between Asymptote and C++ types
+ builtin to the facility. For instance <code>int</code> maps to
+ <code>asy::Int</code> and <code>real</code> to <code>asy::real</code>.
+ Users, however, may want to reference other C++ objects in Asymptote
+ code. This done though opaque type declarations.</p>
+
+ <p>An opaque type declaration is given by an optional permission
+ modifier, the keyword <code>asytype</code>, a C++ type, and an Asymptote
+ identifier; in that order.</p>
+<pre>
+// Examples
+asytype char char;
+public asytype const std::list&lt;asy::Int&gt; *intList;
+private asytype const struct dirert *entry_t;
+</pre>
+ <p>This declaration mapping the Asymptote identifier to the C++ type
+ within the module. The permission of the Asymptote type is given by the
+ permission modifier (or public if the modifier is omitted). The type is
+ opaque, in that none of its internal structure is revealed in the
+ Asymptote code. Like any other type, however, objects of this new type
+ can be returned from functions, given as an arguments to functions, and
+ stored in variables, structures and arrays.</p>
+ <p>In many cases, such as the directory listing example at the start, it
+ will be practical to declare the type as private, and use an Asymptote
+ structure as a wrapper hiding the C++ implementation.</p>
+ </body>
+</html>
+
+
diff --git a/Build/source/utils/asymptote/doc/externalprc.tex b/Build/source/utils/asymptote/doc/externalprc.tex
new file mode 100644
index 00000000000..04718b86a11
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/externalprc.tex
@@ -0,0 +1,13 @@
+% Generate inline PRC images for latex with
+% asy -inlineimage cube -render=4
+%
+% Generate inline PRC images for pdflatex with
+% asy -inlineimage cube -render=4 -tex pdflatex
+%
+\documentclass[12pt]{article}
+\input cube.pre
+\usepackage[bigfiles]{media9}
+\RequirePackage{asymptote,color,graphicx}
+\begin{document}
+\input cube.tex
+\end{document}
diff --git a/Build/source/utils/asymptote/doc/extra/intro.asy b/Build/source/utils/asymptote/doc/extra/intro.asy
new file mode 100644
index 00000000000..8fe021e0ec0
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/extra/intro.asy
@@ -0,0 +1,959 @@
+orientation=Landscape;
+
+settings.tex="pdflatex";
+
+import slide;
+import three;
+import animate;
+
+bool long=true;
+
+usepackage("mflogo");
+
+usersetting();
+
+viewportsize=pagewidth-2pagemargin;
+
+// To generate bibliographic references:
+// asy -k intro
+// bibtex intro_
+// asy -k intro
+bibliographystyle("alpha");
+
+itempen=fontsize(22pt);
+defaultpen(itempen);
+viewportmargin=(2,2);
+
+titlepage(long ? "Asymptote: The Vector Graphics Language" :
+ "Interactive TeX-Aware 3D Vector Graphics",
+ "John Bowman and Andy Hammerlindl",
+"Department of Mathematical and Statistical Sciences\\
+ University of Alberta\\
+%and Instituto Nacional de Matem\'atica Pura e Aplicada (IMPA)
+\medskip\Green{Collaborators: Orest Shardt, Michail Vidiassov}",
+"June 30, 2010",
+"https://asymptote.sourceforge.io/intro.pdf");
+
+title("History");
+item("1979: \TeX\ and \MF\ (Knuth)");
+item("1986: 2D B\'ezier control point selection (Hobby)");
+item("1989: MetaPost (Hobby)");
+item("2004: Asymptote");
+subitem("2004: initial public release (Hammerlindl, Bowman, \& Prince)");
+subitem("2005: 3D B\'ezier control point selection (Bowman)");
+subitem("2008: 3D interactive \TeX\ within PDF files (Shardt \& Bowman)");
+subitem("2009: 3D billboard labels that always face camera (Bowman)");
+subitem("2010: 3D PDF enhancements (Vidiassov \& Bowman)");
+
+title("Statistics (as of June, 2010)");
+item("Runs under Linux/UNIX, Mac OS X, Microsoft Windows.");
+item("4000 downloads/month from primary\hfill\\
+ {\tt asymptote.sourceforge.io} site alone.");
+item("80\ 000 lines of low-level C++ code.");
+item("36\ 000 lines of high-level Asymptote code.");
+
+if(long) {
+title("Vector Graphics");
+item("Raster graphics assign colors to a grid of pixels.");
+figure("pixel.pdf");
+item("Vector graphics are graphics which still maintain their look when
+ inspected at arbitrarily small scales.");
+asyfigure(asywrite("
+picture pic;
+
+path zoombox(real h) {
+ return box((-h,-h/2),(min(10,h),min(10,h)/2));
+}
+
+frame zoom(real h, real next=0) {
+ frame f;
+ draw(f, (0,-100){W}..{E}(0,0), Arrow);
+ clip(f, zoombox(h));
+ if(next > 0)
+ draw(f, zoombox(next));
+
+ return scale(100/h)*f;
+}
+
+add(zoom(100), (0,0));
+add(zoom(10), (200,0));
+add(zoom(1), (400,0));
+"));
+}
+
+title("Cartesian Coordinates");
+
+item("Asymptote's graphical capabilities are based on four primitive
+ commands: {\tt draw}, {\tt label}, {\tt fill}, {\tt clip} \cite{Bowman08}");
+
+asyfilecode("diagonal");
+item("units are {\tt PostScript} {\it big points\/} (1 {\tt bp} =
+1/72 {\tt inch})");
+item("{\tt --} means join the points with a linear segment to create
+a {\it path}");
+
+item("{\it cyclic\/} path:");
+
+asycode("
+draw((0,0)--(100,0)--(100,100)--(0,100)--cycle);
+");
+
+title("Scaling to a Given Size");
+
+item("{\tt PostScript} units are often inconvenient.");
+
+item("Instead, scale user coordinates to a specified final size:");
+
+asyfilecode("square");
+
+item("One can also specify the size in {\tt cm}:");
+
+asycode("
+size(3cm,3cm);
+draw(unitsquare);
+");
+
+title("Labels");
+
+item("Adding and aligning \LaTeX\ labels is easy:");
+
+asycode(preamble="defaultpen(fontsize("+string(fontsize(itempen))+"));",
+"size(6cm);
+draw(unitsquare);
+label(\"$A$\",(0,0),SW);
+label(\"$B$\",(1,0),SE);
+label(\"$C$\",(1,1),NE);
+label(\"$D$\",(0,1),NW);
+");
+
+title("2D B\'ezier Splines");
+
+item("Using {\tt ..} instead of {\tt --} specifies a {\it B\'ezier cubic
+spline}:");
+
+code("
+draw(z0 .. controls c0 and c1 .. z1,blue);
+");
+asyfigure(asywrite("defaultpen(fontsize("+string(fontsize(itempen))+"));
+size(0,7cm);
+pair z0=(0,0);
+pair c0=(1,1);
+pair c1=(2,1);
+pair z1=(3,0);
+draw(z0..controls c0 and c1 .. z1,blue);
+draw(z0--c0--c1--z1,dashed);
+dot(\"$z_0$\",z0,W,red);
+dot(\"$c_0$\",c0,NW,red);
+dot(\"$c_1$\",c1,NE,red);
+dot(\"$z_1$\",z1,red);
+"));
+
+equation("(1-t)^3 z_0+3t(1-t)^2 c_0+3t^2(1-t) c_1+t^3 z_1, \qquad t\in [0,1].");
+
+title("Smooth Paths");
+
+item("Asymptote can choose control points for you, using the algorithms of
+Hobby and Knuth \cite{Hobby86,Knuth86b}:");
+
+string bean="
+pair[] z={(0,0), (0,1), (2,1), (2,0), (1,0)};
+";
+
+asycode(preamble="size(130,0);",bean+"
+draw(z[0]..z[1]..z[2]..z[3]..z[4]..cycle,
+ grey+linewidth(5));
+dot(z,linewidth(7));
+");
+
+item("First, linear equations involving the curvature are solved to find the
+ direction through each knot. Then, control points along those directions
+ are chosen:");
+
+asyfigure(asywrite(preamble="size(130,0);",bean+"
+path p=z[0]..z[1]..z[2]..z[3]..z[4]..cycle;
+
+dot(z);
+draw(p,lightgrey+linewidth(5));
+dot(z);
+
+picture output;
+save();
+for(int i=0; i<length(p); ++i) {
+ pair z=point(p,i), dir=dir(p,i);
+ draw((z-0.3dir)--(z+0.3dir), Arrow);
+}
+add(output, currentpicture.fit(), (-0.5inch, 0), W);
+restore();
+
+save();
+guide g;
+for(int i=0; i<length(p); ++i) {
+ dot(precontrol(p,i));
+ dot(postcontrol(p,i));
+ g=g--precontrol(p,i)--point(p,i)--postcontrol(p,i);
+}
+draw(g--cycle,dashed);
+add(output, currentpicture.fit(), (+0.5inch, 0), E);
+restore();
+
+shipout(output);
+"));
+
+title("Filling");
+item("The {\tt fill} primitive to fill the inside of a path:");
+asycode(preamble="size(0,200);","
+path star;
+for(int i=0; i < 5; ++i)
+ star=star--dir(90+144i);
+star=star--cycle;
+
+fill(star,orange+zerowinding);
+draw(star,linewidth(3));
+
+fill(shift(2,0)*star,blue+evenodd);
+draw(shift(2,0)*star,linewidth(3));
+");
+
+title("Filling");
+item("Use a list of paths to fill a region with holes:");
+asycode(preamble="size(0,300);","
+path[] p={scale(2)*unitcircle, reverse(unitcircle)};
+fill(p,green+zerowinding);
+");
+
+title("Clipping");
+item("Pictures can be clipped to a path:");
+asycode(preamble="
+size(0,200);
+guide star;
+for(int i=0; i<5; ++i)
+ star=star--dir(90+144i);
+star=star--cycle;","
+fill(star,orange+zerowinding);
+clip(scale(0.7)*unitcircle);
+draw(scale(0.7)*unitcircle);
+");
+
+title("Affine Transforms");
+
+item("Affine transformations: shifts, rotations, reflections, and scalings
+ can be applied to pairs, paths, pens, strings, and even whole pictures:");
+
+code("
+fill(P,blue);
+fill(shift(2,0)*reflect((0,0),(0,1))*P, red);
+fill(shift(4,0)*rotate(30)*P, yellow);
+fill(shift(6,0)*yscale(0.7)*xscale(2)*P, green);
+");
+asyfigure(asywrite("
+size(500,0);
+real bw=0.15;
+real sw=0.2;
+real r=0.15;
+
+path outside=(0,0)--(0,1)--
+ (bw+sw,1)..(bw+sw+r+bw,1-(r+bw))..(bw+sw,1-2(r+bw))--
+ (bw,1-2(r+bw))--(bw,0)--cycle;
+path inside=(bw,1-bw-2r)--(bw,1-bw)--
+ (bw+sw,1-bw)..(bw+sw+r,1-bw-r)..(bw+sw,1-bw-2r)--cycle;
+//fill(new path[] {outside, reverse(inside)},yellow);
+
+path[] P={outside, reverse(inside)};
+
+fill(P,blue);
+fill(shift(2,0)*reflect((0,0),(0,1))*P, red);
+fill(shift(4,0)*rotate(30)*P, yellow);
+fill(shift(6,0)*yscale(0.7)*xscale(2)*P, green);
+"));
+
+if(long) {
+title("C++/Java-like Programming Syntax");
+
+code("// Declaration: Declare x to be real:
+real x;
+
+// Assignment: Assign x the value 1.
+x=1.0;
+
+// Conditional: Test if x equals 1 or not.
+if(x == 1.0) {
+ write(\"x equals 1.0\");
+} else {
+ write(\"x is not equal to 1.0\");
+}
+
+// Loop: iterate 10 times
+for(int i=0; i < 10; ++i) {
+ write(i);
+}");
+}
+
+title("Modules");
+
+item("There are modules for Feynman diagrams,");
+asyfigure("eetomumu","height=6cm");
+remark("data structures,");
+asyfigure(asywrite("
+import binarytree;
+
+binarytree bt=binarytree(1,2,4,nil,5,nil,nil,0,nil,nil,3,6,nil,nil,7);
+draw(bt);
+"),"height=6cm");
+newslide();
+remark("algebraic knot theory:");
+asyfigure("knots");
+equations("\Phi\Phi(x_1,x_2,x_3,x_4,x_5)
+ = &\rho_{4b}(x_1+x_4,x_2,x_3,x_5) + \rho_{4b}(x_1,x_2,x_3,x_4) \\
+ + &\rho_{4a}(x_1,x_2+x_3,x_4,x_5) - \rho_{4b}(x_1,x_2,x_3,x_4+x_5) \\
+ - &\rho_{4a}(x_1+x_2,x_3,x_4,x_5) - \rho_{4a}(x_1,x_2,x_4,x_5).");
+
+if(long) {
+title("Textbook Graph");
+asy(nativeformat(),"exp");
+filecode("exp.asy");
+label(graphic("exp."+nativeformat(),"height=10cm"),(0.5,0),
+ Fill(figureborder,figuremattpen));
+
+title("Scientific Graph");
+asyfilecode("lineargraph","height=13cm",newslide=true);
+
+title("Data Graph");
+asyfilecode("datagraph","height=13cm",newslide=true);
+
+title("Imported Data Graph");
+asyfilecode("filegraph","height=15cm",newslide=true);
+
+title("Logarithmic Graph");
+asyfilecode("loggraph","height=15cm",newslide=true);
+title("Secondary Axis");
+} else
+title("Scientific Graph");
+
+asyfigure("secondaryaxis","height=15cm");
+
+title("Images and Contours");
+asyfigure("imagecontour","height=17cm");
+
+title("Multiple Graphs");
+asyfigure("diatom","height=17cm");
+
+title("Hobby's 2D Direction Algorithm");
+item("A tridiagonal system of linear equations is solved to determine any unspecified directions $\phi_k$ and $\theta_k$ through each knot $z_k$:");
+
+equation("\frac{\theta_{k-1}-2\phi_k}{\ell_k}=
+\frac{\phi_{k+1}-2\theta_k}{\ell_{k+1}}.");
+
+asyfigure("Hobbydir","height=9cm");
+
+item("The resulting shape may be adjusted by modifying optional {\it tension\/} parameters and {\it curl\/} boundary conditions.");
+
+title("Hobby's 2D Control Point Algorithm");
+item("Having prescribed outgoing and incoming path directions $e^{i\theta}$
+at node~$z_0$ and $e^{i\phi}$ at node $z_1$ relative to the
+vector $z_1-z_0$, the control points are determined as:");
+
+equations("u&=&z_0+e^{i\theta}(z_1-z_0)f(\theta,-\phi),\nonumber\\
+v&=&z_1-e^{i\phi}(z_1-z_0)f(-\phi,\theta),");
+
+remark("where the relative distance function $f(\theta,\phi)$ is given by Hobby [1986].");
+
+asyfigure("Hobbycontrol","height=9cm");
+
+if(long) {
+title("B\'ezier Curves in 3D");
+
+item("Apply an affine transformation");
+
+equation("x'_i=A_{ij} x_j+C_i");
+
+remark("to a B\'ezier curve:");
+
+equation("\displaystyle x(t)=\sum_{k=0}^3 B_k(t) P_k, \qquad t\in [0,1].");
+
+item("The resulting curve is also a B\'ezier curve:");
+
+skip(-2);
+
+equations("x'_i(t)&=&\sum_{k=0}^3 B_k(t) A_{ij}(P_k)_j+C_i\nonumber\\
+&=&\sum_{k=0}^3 B_k(t) P'_k,");
+
+skip(-2);
+
+remark("where $P'_k$ is the transformed $k^{\rm th}$ control point, noting
+$\displaystyle\sum_{k=0}^3 B_k(t)=1.$");
+}
+
+title("3D Generalization of Direction Algorithm");
+
+item("Must reduce to 2D algorithm in planar case.");
+
+item("Determine directions by applying Hobby's algorithm in the plane containing $z_{k-1}$, $z_k$, $z_{k+1}$.");
+
+// Reformulate Hobby's equations in terms of the angle $\psi_k=$
+item("The only ambiguity that can arise is the overall sign of the angles, which relates to viewing each 2D plane from opposing normal directions.");
+
+item("A reference vector based on the mean unit normal of successive segments can be used to resolve such ambiguities \cite{Bowman07,Bowman09}");
+
+title("3D Control Point Algorithm");
+
+item("Express Hobby's algorithm in terms of the absolute directions $\omega_0$ and~$\omega_1$:");
+skip(-1);
+equation("u=z_0+\omega_0\left|z_1-z_0\right|f(\theta,-\phi),");
+equation("v=z_1-\omega_1\left|z_1-z_0\right|f(-\phi,\theta),");
+
+asyfigure("Hobbycontrol");
+
+remark("interpreting $\theta$ and $\phi$ as the angle between the corresponding path direction vector and $z_1-z_0$.");
+
+item("Here there is an unambiguous reference vector for determining the relative sign of the angles $\phi$ and $\theta$.");
+
+viewportmargin=(2,0.5cm);
+//defaultpen(1.0);
+title("Interactive 3D Saddle");
+item("A unit circle in the $X$--$Y$ plane may be constructed with:
+{\tt (1,0,0)..(0,1,0)..(-1,0,0)..(0,-1,0)..cycle}:");
+asyinclude("unitcircle3",8cm);
+remark("and then distorted into the saddle\\
+{\tt (1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle}:");
+asyinclude("saddle",8cm);
+//defaultpen(0.5);
+
+title("Lifting TeX to 3D");
+item("Glyphs are first split into simply connected regions and then decomposed into planar B\'ezier surface patches \cite{Bowman09,Shardt12}:");
+asyfigure("../examples/partitionExample");
+
+viewportmargin=(2,1cm);
+title("Label Manipulation");
+item("They can then be extruded and/or arbitrarily transformed:");
+asyinclude("../examples/label3solid");
+
+title("Billboard Labels");
+defaultpen(fontsize(36pt));
+asyinclude("../examples/billboard",15cm);
+defaultpen(itempen);
+
+title("Smooth 3D surfaces");
+asyinclude("../examples/sinc",25cm);
+
+title("Curved 3D Arrows");
+asyinclude("../examples/arrows3",20cm);
+
+title("Slide Presentations");
+item("Asymptote has a module for preparing slides.");
+item("It even supports embedded high-resolution PDF movies.");
+
+code('
+title("Slide Presentations");
+item("Asymptote has a module for preparing slides.");
+item("It even supports embedded high-resolution PDF movies.");
+');
+remark("\quad\ldots");
+
+import graph;
+
+pen p=linewidth(1);
+pen dotpen=linewidth(5);
+
+pair wheelpoint(real t) {return (t+cos(t),-sin(t));}
+
+guide wheel(guide g=nullpath, real a, real b, int n)
+{
+ real width=(b-a)/n;
+ for(int i=0; i <= n; ++i) {
+ real t=a+width*i;
+ g=g--wheelpoint(t);
+ }
+ return g;
+}
+
+real t1=0;
+real t2=t1+2*pi;
+
+picture base;
+draw(base,circle((0,0),1),p);
+draw(base,wheel(t1,t2,100),p+linetype("0 2"));
+yequals(base,Label("$y=-1$",1.0),-1,extend=true,p+linetype("4 4"));
+xaxis(base,Label("$x$",align=3SW),0,p);
+yaxis(base,"$y$",0,1.3,p);
+pair z1=wheelpoint(t1);
+pair z2=wheelpoint(t2);
+dot(base,z1,dotpen);
+dot(base,z2,dotpen);
+
+animation a;
+
+int n=25;
+real dt=(t2-t1)/n;
+for(int i=0; i <= n; ++i) {
+ picture pic;
+ size(pic,24cm);
+ real t=t1+dt*i;
+ add(pic,base);
+ draw(pic,circle((t,0),1),p+red);
+ dot(pic,wheelpoint(t),dotpen);
+ a.add(pic);
+}
+
+display(a.pdf(delay=150,"controls"));
+
+title("Automatic Sizing");
+item("Figures can be specified in user coordinates, then
+ automatically scaled to the desired final size.");
+asyfigure(asywrite("
+import graph;
+
+size(0,100);
+
+frame cardsize(real w=0, real h=0, bool keepAspect=Aspect) {
+ picture pic;
+ pic.size(w,h,keepAspect);
+
+ real f(real t) {return 1+cos(t);}
+
+ guide g=polargraph(f,0,2pi,operator ..)--cycle;
+ filldraw(pic,g,pink);
+
+ xaxis(pic,\"$x$\",above=true);
+ yaxis(pic,\"$y$\",above=true);
+
+ dot(pic,\"$(a,0)$\",(1,0),N);
+ dot(pic,\"$(2a,0)$\",(2,0),N+E);
+
+ frame f=pic.fit();
+ label(f,\"{\tt size(\"+string(w)+\",\"+string(h)+\");}\",point(f,S),align=S);
+ return f;
+}
+
+add(cardsize(0,50), (0,0));
+add(cardsize(0,100), (230,0));
+add(cardsize(0,200), (540,0));
+"));
+
+title("Deferred Drawing");
+item("We can't draw a graphical object until we know the scaling
+ factors for the user coordinates.");
+item("Instead, store a function that, given the scaling information, draws
+ the scaled object.");
+code("
+void draw(picture pic=currentpicture, path g, pen p=currentpen) {
+ pic.add(new void(frame f, transform t) {
+ draw(f,t*g,p);
+ });
+ pic.addPoint(min(g),min(p));
+ pic.addPoint(max(g),max(p));
+}
+");
+
+title("Coordinates");
+item("Store bounding box information as the sum of user and true-size
+ coordinates:");
+asyfigure(asywrite("
+size(0,150);
+
+path q=(0,0){dir(70)}..{dir(70)}(100,50);
+pen p=rotate(30)*yscale(0.7)*(lightblue+linewidth(20));
+draw(q,p);
+draw((90,10),p);
+
+currentpicture.add(new void(frame f, transform t) {
+ draw(f,box(min(t*q)+min(p),max(t*q)+max(p)), dashed);
+ });
+
+draw(box(min(q),max(q)));
+
+frame f;
+draw(f,box(min(p),max(p)));
+
+add(f,min(q));
+add(f,max(q));
+
+draw(q);
+"));
+
+code("pic.addPoint(min(g),min(p));
+pic.addPoint(max(g),max(p));");
+item("Filling ignores the pen width:");
+code("pic.addPoint(min(g),(0,0));
+pic.addPoint(max(g),(0,0));");
+item("Communicate with \LaTeX\ {\it via\/} a pipe to determine label sizes:");
+
+asyfigure(asywrite("
+size(0,100);
+
+pen p=fontsize(30pt);
+frame f;
+label(f, \"$E=mc^2$\", p);
+draw(f, box(min(f),max(f)));
+shipout(f);
+"));
+
+title("Sizing");
+
+item("When scaling the final figure to a given size $S$, we first need to
+ determine a scaling factor $a>0$ and a shift $b$ so that all of the
+ coordinates when transformed will lie in the interval $[0,S]$.");
+
+item("That is, if $u$ and $t$ are the user and truesize components:");
+equation("0\le au+t+b \le S.");
+
+item("Maximize the variable $a$ subject to a number of inequalities.");
+
+item("Use the simplex method to solve the resulting linear programming problem.");
+
+if(long) {
+title("Sizing");
+item("Every addition of a coordinate $(t,u)$ adds two restrictions");
+equation("au+t+b\ge 0,");
+equation("au+t+b\le S,");
+remark("and each drawing component adds two coordinates.");
+item("A figure could easily produce thousands of restrictions, making the
+ simplex method impractical.");
+
+item("Most of these restrictions are redundant, however. For instance, with
+ concentric circles, only the largest circle needs to be accounted for.");
+asyfigure(asywrite("
+import palette;
+size(160,0);
+pen[] p=Rainbow(NColors=11);
+for(int i=1; i<10; ++i) {
+ draw(scale(i)*unitcircle, p[i]+linewidth(2));
+}
+"));
+
+title("Redundant Restrictions");
+item("In general, if $u\le u'$ and $t\le t'$ then");
+equation("au+t+b\le au'+t'+b");
+remark("for all choices of $a>0$ and $b$, so");
+equation("0\le au+t+b\le au'+t'+b\le S.");
+item("This defines a partial ordering on coordinates. When sizing a picture,
+ the program first computes which coordinates are maximal (or minimal) and
+ only sends effective constraints to the simplex algorithm.");
+item("In practice, the linear programming problem will have less than a dozen
+ restraints.");
+item("All picture sizing is implemented in Asymptote code.");
+}
+
+title("Infinite Lines");
+item("Deferred drawing allows us to draw infinite lines.");
+code("drawline(P, Q);");
+
+asyfigure("elliptic","height=12cm");
+
+title("Helpful Math Notation");
+
+item("Integer division returns a {\tt real}. Use {\tt quotient} for an integer
+ result:");
+code("3/4 == 0.75 quotient(3,4) == 0");
+
+item("Caret for real and integer exponentiation:");
+code("2^3 2.7^3 2.7^3.2");
+
+item("Many expressions can be implicitly scaled by a numeric constant:");
+code("2pi 10cm 2x^2 3sin(x) 2(a+b)");
+
+item("Pairs are complex numbers:");
+code("(0,1)*(0,1) == (-1,0)");
+
+title("Function Calls");
+
+item("Functions can take default arguments in any position. Arguments are
+ matched to the first possible location:");
+string unitsize="unitsize(0.65cm);";
+string preamble="void drawEllipse(real xsize=1, real ysize=xsize, pen p=blue) {
+ draw(xscale(xsize)*yscale(ysize)*unitcircle, p);
+}
+";
+
+asycode(preamble=unitsize,preamble+"
+drawEllipse(2);
+drawEllipse(red);
+");
+
+item("Arguments can be given by name:");
+asycode(preamble=unitsize+preamble,"
+drawEllipse(xsize=2, ysize=1);
+drawEllipse(ysize=2, xsize=3, green);
+");
+
+if(long) {
+title("Rest Arguments");
+item("Rest arguments allow one to write a function that takes an arbitrary
+ number of arguments:");
+code("
+int sum(... int[] nums) {
+ int total=0;
+ for(int i=0; i < nums.length; ++i)
+ total += nums[i];
+ return total;
+}
+
+sum(1,2,3,4); // returns 10
+sum(); // returns 0
+sum(1,2,3 ... new int[] {4,5,6}); // returns 21
+
+int subtract(int start ... int[] subs) {
+ return start - sum(... subs);
+}
+");
+}
+
+title("High-Order Functions");
+
+item("Functions are first-class values. They can be passed to other
+ functions:");
+code("import graph;
+real f(real x) {
+ return x*sin(10x);
+}
+draw(graph(f,-3,3,300),red);");
+asyfigure(asywrite("
+import graph;
+size(300,0);
+real f(real x) {
+ return x*sin(10x);
+}
+draw(graph(f,-3,3,300),red);
+"));
+
+if(long) {
+title("Higher-Order Functions");
+item("Functions can return functions:");
+equation("f_n(x)=n\sin\left(\frac{x}{n}\right).");
+skip();
+string preamble="
+import graph;
+size(300,0);
+";
+string graphfunc2="
+typedef real func(real);
+func f(int n) {
+ real fn(real x) {
+ return n*sin(x/n);
+ }
+ return fn;
+}
+
+func f1=f(1);
+real y=f1(pi);
+
+for(int i=1; i<=5; ++i)
+ draw(graph(f(i),-10,10),red);
+";
+code(graphfunc2);
+string name=asywrite(graphfunc2,preamble=preamble);
+asy(nativeformat(),name+".asy");
+label(graphic(name+"."+nativeformat()),(0.5,0),
+ Fill(figureborder,figuremattpen));
+
+title("Anonymous Functions");
+
+item("Create new functions with {\tt new}:");
+code("
+path p=graph(new real (real x) { return x*sin(10x); },-3,3,red);
+
+func f(int n) {
+ return new real (real x) { return n*sin(x/n); };
+}");
+
+item("Function definitions are just syntactic sugar for assigning function
+objects to variables.");
+code("
+real square(real x) {
+ return x^2;
+}
+");
+
+remark("is equivalent to");
+code("
+real square(real x);
+square=new real (real x) {
+ return x^2;
+};
+");
+
+title("Structures");
+
+item("As in other languages, structures group together data.");
+code("
+struct Person {
+ string firstname, lastname;
+ int age;
+}
+Person bob=new Person;
+bob.firstname=\"Bob\";
+bob.lastname=\"Chesterton\";
+bob.age=24;
+");
+
+item("Any code in the structure body will be executed every time a new structure
+ is allocated...");
+code("
+struct Person {
+ write(\"Making a person.\");
+ string firstname, lastname;
+ int age=18;
+}
+Person eve=new Person; // Writes \"Making a person.\"
+write(eve.age); // Writes 18.
+");
+
+title("Modules");
+
+item("Function and structure definitions can be grouped into modules:");
+code("
+// powers.asy
+real square(real x) { return x^2; }
+real cube(real x) { return x^3; }
+");
+remark("and imported:");
+code("
+import powers;
+real eight=cube(2.0);
+draw(graph(powers.square, -1, 1));
+");
+}
+
+title("Object-Oriented Programming");
+item("Functions are defined for each instance of a structure.");
+code("
+struct Quadratic {
+ real a,b,c;
+ real discriminant() {
+ return b^2-4*a*c;
+ }
+ real eval(real x) {
+ return a*x^2 + b*x + c;
+ }
+}
+");
+
+item("This allows us to construct ``methods'' which are just normal functions
+ declared in the environment of a particular object:");
+code("
+Quadratic poly=new Quadratic;
+poly.a=-1; poly.b=1; poly.c=2;
+
+real f(real x)=poly.eval;
+real y=f(2);
+draw(graph(poly.eval, -5, 5));
+");
+
+title("Specialization");
+
+item("Can create specialized objects just by redefining methods:");
+code("
+struct Shape {
+ void draw();
+ real area();
+}
+
+Shape rectangle(real w, real h) {
+ Shape s=new Shape;
+ s.draw = new void () {
+ fill((0,0)--(w,0)--(w,h)--(0,h)--cycle); };
+ s.area = new real () { return w*h; };
+ return s;
+}
+
+Shape circle(real radius) {
+ Shape s=new Shape;
+ s.draw = new void () { fill(scale(radius)*unitcircle); };
+ s.area = new real () { return pi*radius^2; }
+ return s;
+}
+");
+
+title("Overloading");
+item("Consider the code:");
+code("
+int x1=2;
+int x2() {
+ return 7;
+}
+int x3(int y) {
+ return 2y;
+}
+
+write(x1+x2()); // Writes 9.
+write(x3(x1)+x2()); // Writes 11.
+");
+
+title("Overloading");
+item("{\tt x1}, {\tt x2}, and {\tt x3} are never used in the same context, so
+ they can all be renamed {\tt x} without ambiguity:");
+code("
+int x=2;
+int x() {
+ return 7;
+}
+int x(int y) {
+ return 2y;
+}
+
+write(x+x()); // Writes 9.
+write(x(x)+x()); // Writes 11.
+");
+
+item("Function definitions are just variable definitions, but variables are
+ distinguished by their signatures to allow overloading.");
+
+title("Operators");
+item("Operators are just syntactic sugar for functions, and can be addressed or
+ defined as functions with the {\tt operator} keyword.");
+code("
+int add(int x, int y)=operator +;
+write(add(2,3)); // Writes 5.
+
+// Don't try this at home.
+int operator +(int x, int y) {
+ return add(2x,y);
+}
+write(2+3); // Writes 7.
+");
+item("This allows operators to be defined for new types.");
+
+title("Operators");
+item("Operators for constructing paths are also functions:");
+code("a.. controls b and c .. d--e");
+remark("is equivalent to");
+code(
+ "operator --(operator ..(a, operator controls(b,c), d), e)");
+item("This allowed us to redefine all of the path operators for 3D paths.");
+
+title("Summary");
+
+item("Asymptote:");
+subitem("uses IEEE floating point numerics;");
+subitem("uses C++/Java-like syntax;");
+subitem("supports deferred drawing for automatic picture sizing;");
+subitem("supports Grayscale, RGB, CMYK, and HSV colour spaces;");
+subitem("supports PostScript shading, pattern fills, and function shading;");
+subitem("can fill nonsimply connected regions;");
+subitem("generalizes MetaPost path construction algorithms to 3D;");
+subitem("lifts \TeX\ to 3D;");
+subitem("supports 3D billboard labels and PDF grouping.");
+
+bibliography("../examples/refs");
+
+viewportmargin=(2,2);
+viewportsize=0;
+defaultpen(0.5);
+title("\mbox{Asymptote: 2D \& 3D Vector Graphics Language}");
+asyinclude("../examples/logo3");
+skip();
+center("\tt https://asymptote.sourceforge.io");
+center("(freely available under the LGPL license)");
+
+// LocalWords: pdflatex mflogo viewportsize pagewidth pagemargin goysr bibtex
+// LocalWords: itempen defaultrender medskip Orest Shardt Vidiassov MF ezier
+// LocalWords: Hammerlindl MetaPost PDF hfill LGPL pdf asywrite zoombox LaTeX
+// LocalWords: asyfilecode PostScript asycode unitsquare beziercurve grey bw
+// LocalWords: lightgrey zerowinding evenodd sw unitsize drawEllipse nums fn
+// LocalWords: frac graphfunc func nativeformat figureborder figuremattpen bt
+// LocalWords: firstname lastname eval eetomumu binarytree filecode datagraph
+// LocalWords: lineargraph filegraph loggraph secondaryaxis imagecontour ij
+// LocalWords: tridiagonal Hobbydir nonumber Hobbycontrol th viewportmargin
+// LocalWords: asyinclude dotpen wheelpoint yequals xaxis yaxis cardsize mc
+// LocalWords: polargraph filldraw addPoint lightblue truesize le au NColors
+// LocalWords: drawline unityroot mult oct intang IEEE numerics HSV colour
+// LocalWords: nonsimply
diff --git a/Build/source/utils/asymptote/doc/filegraph.asy b/Build/source/utils/asymptote/doc/filegraph.asy
new file mode 100644
index 00000000000..0add531a3e0
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/filegraph.asy
@@ -0,0 +1,15 @@
+import graph;
+
+size(200,150,IgnoreAspect);
+
+file in=input("filegraph.dat").line();
+real[][] a=in;
+a=transpose(a);
+
+real[] x=a[0];
+real[] y=a[1];
+
+draw(graph(x,y),red);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
diff --git a/Build/source/utils/asymptote/doc/filegraph.dat b/Build/source/utils/asymptote/doc/filegraph.dat
new file mode 100644
index 00000000000..f69ffe330de
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/filegraph.dat
@@ -0,0 +1,4 @@
+# x y
+ 50 0
+100 0.5
+125 2
diff --git a/Build/source/utils/asymptote/doc/flow.asy b/Build/source/utils/asymptote/doc/flow.asy
new file mode 100644
index 00000000000..aba6c5aa055
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/flow.asy
@@ -0,0 +1,31 @@
+import graph;
+defaultpen(1.0);
+
+size(0,150,IgnoreAspect);
+
+real arrowsize=4mm;
+real arrowlength=2arrowsize;
+
+typedef path vector(real);
+
+// Return a vector interpolated linearly between a and b.
+vector vector(pair a, pair b) {
+ return new path(real x) {
+ return (0,0)--arrowlength*interp(a,b,x);
+ };
+}
+
+real f(real x) {return 1/x;}
+
+real epsilon=0.5;
+path g=graph(f,epsilon,1/epsilon);
+
+int n=3;
+draw(g);
+xaxis("$x$");
+yaxis("$y$");
+
+add(vectorfield(vector(W,W),g,n,true));
+add(vectorfield(vector(NE,NW),(0,0)--(point(E).x,0),n,true));
+add(vectorfield(vector(NE,NE),(0,0)--(0,point(N).y),n,true));
+
diff --git a/Build/source/utils/asymptote/doc/flowchartdemo.asy b/Build/source/utils/asymptote/doc/flowchartdemo.asy
new file mode 100644
index 00000000000..77c78c0e2ce
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/flowchartdemo.asy
@@ -0,0 +1,27 @@
+size(0,300);
+
+import flowchart;
+
+block block1=rectangle(Label("Example",magenta),
+ pack(Label("Start:",heavygreen),"",Label("$A:=0$",blue),
+ "$B:=1$"),(-0.5,3),palegreen,paleblue,red);
+block block2=diamond(Label("Choice?",blue),(0,2),palegreen,red);
+block block3=roundrectangle("Do something",(-1,1));
+block block4=bevel("Don't do something",(1,1));
+block block5=circle("End",(0,0));
+
+draw(block1);
+draw(block2);
+draw(block3);
+draw(block4);
+draw(block5);
+
+add(new void(picture pic, transform t) {
+ blockconnector operator --=blockconnector(pic,t);
+ // draw(pic,block1.right(t)--block2.top(t));
+ block1--Right--Down--Arrow--block2;
+ block2--Label("Yes",0.5,NW)--Left--Down--Arrow--block3;
+ block2--Right--Label("No",0.5,NE)--Down--Arrow--block4;
+ block4--Down--Left--Arrow--block5;
+ block3--Down--Right--Arrow--block5;
+ });
diff --git a/Build/source/utils/asymptote/doc/generalaxis.asy b/Build/source/utils/asymptote/doc/generalaxis.asy
new file mode 100644
index 00000000000..dfe1000838e
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/generalaxis.asy
@@ -0,0 +1,11 @@
+import graph;
+size(0,100);
+
+path g=ellipse((0,0),1,2);
+
+scale(true);
+
+axis(Label("C",align=10W),g,LeftTicks(endlabel=false,8,end=false),
+ ticklocate(0,360,new real(real v) {
+ path h=(0,0)--max(abs(max(g)),abs(min(g)))*dir(v);
+ return intersect(g,h)[0];}));
diff --git a/Build/source/utils/asymptote/doc/generalaxis3.asy b/Build/source/utils/asymptote/doc/generalaxis3.asy
new file mode 100644
index 00000000000..68a01c8ce28
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/generalaxis3.asy
@@ -0,0 +1,13 @@
+import graph3;
+
+size(0,100);
+
+path3 g=yscale3(2)*unitcircle3;
+currentprojection=perspective(10,10,10);
+
+axis(Label("C",position=0,align=15X),g,InTicks(endlabel=false,8,end=false),
+ ticklocate(0,360,new real(real v) {
+ path3 h=O--max(abs(max(g)),abs(min(g)))*dir(90,v);
+ return intersect(g,h)[0];},
+ new triple(real t) {return cross(dir(g,t),Z);}));
+
diff --git a/Build/source/utils/asymptote/doc/graphmarkers.asy b/Build/source/utils/asymptote/doc/graphmarkers.asy
new file mode 100644
index 00000000000..f40f00d9ff6
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/graphmarkers.asy
@@ -0,0 +1,37 @@
+import graph;
+
+size(200,100,IgnoreAspect);
+
+markroutine marks() {
+ return new void(picture pic=currentpicture, frame f, path g) {
+ path p=scale(1mm)*unitcircle;
+ for(int i=0; i <= length(g); ++i) {
+ pair z=point(g,i);
+ frame f;
+ if(i % 4 == 0) {
+ fill(f,p);
+ add(pic,f,z);
+ } else {
+ if(z.y > 50) {
+ pic.add(new void(frame F, transform t) {
+ path q=shift(t*z)*p;
+ unfill(F,q);
+ draw(F,q);
+ });
+ } else {
+ draw(f,p);
+ add(pic,f,z);
+ }
+ }
+ }
+ };
+}
+
+pair[] f={(5,5),(40,20),(55,51),(90,30)};
+
+draw(graph(f),marker(marks()));
+
+scale(true);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
diff --git a/Build/source/utils/asymptote/doc/grid3xyz.asy b/Build/source/utils/asymptote/doc/grid3xyz.asy
new file mode 100644
index 00000000000..888b9202eee
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/grid3xyz.asy
@@ -0,0 +1,17 @@
+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));
+
diff --git a/Build/source/utils/asymptote/doc/hatch.asy b/Build/source/utils/asymptote/doc/hatch.asy
new file mode 100644
index 00000000000..126b5bec13a
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/hatch.asy
@@ -0,0 +1,11 @@
+size(0,100);
+import patterns;
+
+add("hatch",hatch());
+add("hatchback",hatch(NW));
+add("crosshatch",crosshatch(3mm));
+
+real s=1.25;
+filldraw(unitsquare,pattern("hatch"));
+filldraw(shift(s,0)*unitsquare,pattern("hatchback"));
+filldraw(shift(2s,0)*unitsquare,pattern("crosshatch"));
diff --git a/Build/source/utils/asymptote/doc/helix.asy b/Build/source/utils/asymptote/doc/helix.asy
new file mode 100644
index 00000000000..0925e0821b1
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/helix.asy
@@ -0,0 +1,20 @@
+import graph3;
+
+size(0,200);
+size3(200,IgnoreAspect);
+
+currentprojection=orthographic(4,6,3);
+
+real x(real t) {return cos(2pi*t);}
+real y(real t) {return sin(2pi*t);}
+real z(real t) {return t;}
+
+path3 p=graph(x,y,z,0,2.7,operator ..);
+
+draw(p,Arrow3);
+
+scale(true);
+
+xaxis3(XZ()*"$x$",Bounds,red,InTicks(Label,2,2));
+yaxis3(YZ()*"$y$",Bounds,red,InTicks(beginlabel=false,Label,2,2));
+zaxis3(XZ()*"$z$",Bounds,red,InTicks);
diff --git a/Build/source/utils/asymptote/doc/histogram.asy b/Build/source/utils/asymptote/doc/histogram.asy
new file mode 100644
index 00000000000..ec00d6638d1
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/histogram.asy
@@ -0,0 +1,19 @@
+import graph;
+import stats;
+
+size(400,200,IgnoreAspect);
+
+int n=10000;
+real[] a=new real[n];
+for(int i=0; i < n; ++i) a[i]=Gaussrand();
+
+draw(graph(Gaussian,min(a),max(a)),blue);
+
+// Optionally calculate "optimal" number of bins a la Shimazaki and Shinomoto.
+int N=bins(a);
+
+histogram(a,min(a),max(a),N,normalize=true,low=0,lightred,black,bars=false);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$dP/dx$",LeftRight,RightTicks(trailingzero));
+
diff --git a/Build/source/utils/asymptote/doc/icon.asy b/Build/source/utils/asymptote/doc/icon.asy
new file mode 100644
index 00000000000..0170f2605ce
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/icon.asy
@@ -0,0 +1,22 @@
+import graph;
+
+size(30,30,IgnoreAspect);
+
+real f(real t) {return t < 0 ? -1/t : -0.5/t;}
+
+picture logo(pair s=0, pen q)
+{
+ picture pic;
+ pen p=linewidth(3)+q;
+ real a=-0.5;
+ real b=1;
+ real eps=0.1;
+ draw(pic,shift((eps,-f(a)))*graph(f,a,-eps),p);
+ real c=0.5*a;
+ pair z=(0,f(c)-f(a));
+ draw(pic,z+c+eps--z,p);
+ yaxis(pic,p);
+ return shift(s)*pic;
+}
+
+add(logo(red));
diff --git a/Build/source/utils/asymptote/doc/image.asy b/Build/source/utils/asymptote/doc/image.asy
new file mode 100644
index 00000000000..37a2cf60172
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/image.asy
@@ -0,0 +1,21 @@
+size(12cm,12cm);
+
+import graph;
+import palette;
+
+int n=256;
+real ninv=2pi/n;
+real[][] v=new real[n][n];
+
+for(int i=0; i < n; ++i)
+ for(int j=0; j < n; ++j)
+ v[i][j]=sin(i*ninv)*cos(j*ninv);
+
+pen[] Palette=BWRainbow();
+
+picture bar;
+
+bounds range=image(v,(0,0),(1,1),Palette);
+palette(bar,"$A$",range,(0,0),(0.5cm,8cm),Right,Palette,
+ PaletteTicks("$%+#.1f$"));
+add(bar.fit(),point(E),30E);
diff --git a/Build/source/utils/asymptote/doc/imagecontour.asy b/Build/source/utils/asymptote/doc/imagecontour.asy
new file mode 100644
index 00000000000..d61b6148c53
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/imagecontour.asy
@@ -0,0 +1,38 @@
+import graph;
+import palette;
+import contour;
+
+size(10cm,10cm,IgnoreAspect);
+
+pair a=(0,0);
+pair b=(2pi,2pi);
+
+real f(real x, real y) {return cos(x)*sin(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();
+
+bounds range=image(f,Automatic,a,b,N,Palette);
+
+// Major contours
+
+real[] Cvals=uniform(range.min,range.max,Divs);
+draw(contour(f,a,b,Cvals,N,operator --),Tickpen);
+
+// Minor contours
+real[] cvals;
+for(int i=0; i < Cvals.length-1; ++i)
+ cvals.append(uniform(Cvals[i],Cvals[i+1],divs)[1:divs]);
+draw(contour(f,a,b,cvals,N,operator --),tickpen);
+
+xaxis("$x$",BottomTop,LeftTicks,above=true);
+yaxis("$y$",LeftRight,RightTicks,above=true);
+
+palette("$f(x,y)$",range,point(NW)+(0,0.5),point(NE)+(0,1),Top,Palette,
+ PaletteTicks(N=Divs,n=divs,Tickpen,tickpen));
diff --git a/Build/source/utils/asymptote/doc/install-sh b/Build/source/utils/asymptote/doc/install-sh
new file mode 100755
index 00000000000..6781b987bdb
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/install-sh
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/Build/source/utils/asymptote/doc/irregularcontour.asy b/Build/source/utils/asymptote/doc/irregularcontour.asy
new file mode 100644
index 00000000000..70b38ae15e7
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/irregularcontour.asy
@@ -0,0 +1,21 @@
+import contour;
+
+size(200);
+
+int n=100;
+
+real f(real a, real b) {return a^2+b^2;}
+
+srand(1);
+
+real r() {return 1.1*(rand()/randMax*2-1);}
+
+pair[] points=new pair[n];
+real[] values=new real[n];
+
+for(int i=0; i < n; ++i) {
+ points[i]=(r(),r());
+ values[i]=f(points[i].x,points[i].y);
+}
+
+draw(contour(points,values,new real[]{0.25,0.5,1},operator ..),blue);
diff --git a/Build/source/utils/asymptote/doc/join.asy b/Build/source/utils/asymptote/doc/join.asy
new file mode 100644
index 00000000000..75fa14f36ca
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/join.asy
@@ -0,0 +1,15 @@
+size(300,0);
+pair[] z=new pair[10];
+
+z[0]=(0,100); z[1]=(50,0); z[2]=(180,0);
+
+for(int n=3; n <= 9; ++n)
+ z[n]=z[n-3]+(200,0);
+
+path p=z[0]..z[1]---z[2]::{up}z[3]
+&z[3]..z[4]--z[5]::{up}z[6]
+&z[6]::z[7]---z[8]..{up}z[9];
+
+draw(p,grey+linewidth(4mm));
+
+dot(z);
diff --git a/Build/source/utils/asymptote/doc/join3.asy b/Build/source/utils/asymptote/doc/join3.asy
new file mode 100644
index 00000000000..9513d522b4d
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/join3.asy
@@ -0,0 +1,21 @@
+import graph3;
+
+size(200);
+
+currentprojection=orthographic(500,-500,500);
+
+triple[] z=new triple[10];
+
+z[0]=(0,100,0); z[1]=(50,0,0); z[2]=(180,0,0);
+
+for(int n=3; n <= 9; ++n)
+ z[n]=z[n-3]+(200,0,0);
+
+path3 p=z[0]..z[1]---z[2]::{Y}z[3]
+&z[3]..z[4]--z[5]::{Y}z[6]
+&z[6]::z[7]---z[8]..{Y}z[9];
+
+draw(p,grey+linewidth(4mm),currentlight);
+
+xaxis3(Label(XY()*"$x$",align=-3Y),red,above=true);
+yaxis3(Label(XY()*"$y$",align=-3X),red,above=true);
diff --git a/Build/source/utils/asymptote/doc/knots.asy b/Build/source/utils/asymptote/doc/knots.asy
new file mode 100644
index 00000000000..48881459d05
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/knots.asy
@@ -0,0 +1,27 @@
+import syzygy;
+
+Braid initial;
+initial.n = 4;
+initial.add(bp,1);
+initial.add(bp,0);
+initial.add(bp,2);
+initial.add(bp,1);
+initial.add(phi,2);
+initial.add(phi,0);
+
+Syzygy pp;
+pp.lsym="\Phi\Phi"; pp.codename="PhiAroundPhi";
+
+pp.number=true;
+pp.initial=initial;
+pp.apply(r4b,2,1);
+pp.apply(r4b,0,0);
+pp.apply(r4a,1,0);
+pp.swap(0,1);
+pp.apply(-r4b,1,0);
+pp.apply(-r4a,0,1);
+pp.apply(-r4a,2,0);
+pp.swap(4,5);
+
+pp.draw();
+
diff --git a/Build/source/utils/asymptote/doc/labelsquare.asy b/Build/source/utils/asymptote/doc/labelsquare.asy
new file mode 100644
index 00000000000..9531792b6a1
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/labelsquare.asy
@@ -0,0 +1,6 @@
+size(3cm);
+draw(unitsquare);
+label("$A$",(0,0),SW);
+label("$B$",(1,0),SE);
+label("$C$",(1,1),NE);
+label("$D$",(0,1),NW);
diff --git a/Build/source/utils/asymptote/doc/latexmkrc b/Build/source/utils/asymptote/doc/latexmkrc
new file mode 100644
index 00000000000..fbc52a98d2e
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/latexmkrc
@@ -0,0 +1,4 @@
+sub asy {return system("asy \"$_[0]\"");}
+add_cus_dep("asy","eps",0,"asy");
+add_cus_dep("asy","pdf",0,"asy");
+add_cus_dep("asy","tex",0,"asy");
diff --git a/Build/source/utils/asymptote/doc/latexmkrc_asydir b/Build/source/utils/asymptote/doc/latexmkrc_asydir
new file mode 100644
index 00000000000..043084e8e6d
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/latexmkrc_asydir
@@ -0,0 +1,4 @@
+sub asy {return system("asy -o asy/ '$_[0]'");}
+add_cus_dep("asy","eps",0,"asy");
+add_cus_dep("asy","pdf",0,"asy");
+add_cus_dep("asy","tex",0,"asy");
diff --git a/Build/source/utils/asymptote/doc/latexusage.tex b/Build/source/utils/asymptote/doc/latexusage.tex
new file mode 100644
index 00000000000..07b0e56a356
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/latexusage.tex
@@ -0,0 +1,119 @@
+\documentclass[12pt]{article}
+
+% Use this form to include EPS (latex) or PDF (pdflatex) files:
+%\usepackage{asymptote}
+
+% Use this form with latex or pdflatex to include inline LaTeX code by default:
+\usepackage[inline]{asymptote}
+
+% Use this form with latex or pdflatex to create PDF attachments by default:
+%\usepackage[attach]{asymptote}
+
+% Enable this line to support the attach option:
+%\usepackage[dvips]{attachfile2}
+
+\begin{document}
+
+% Optional subdirectory for latex files (no spaces):
+\def\asylatexdir{}
+% Optional subdirectory for asy files (no spaces):
+\def\asydir{}
+
+\begin{asydef}
+// Global Asymptote definitions can be put here.
+import three;
+usepackage("bm");
+texpreamble("\def\V#1{\bm{#1}}");
+// One can globally override the default toolbar settings here:
+// settings.toolbar=true;
+\end{asydef}
+
+Here is a venn diagram produced with Asymptote, drawn to width 4cm:
+
+\def\A{A}
+\def\B{\V{B}}
+
+%\begin{figure}
+\begin{center}
+\begin{asy}
+size(4cm,0);
+pen colour1=red;
+pen colour2=green;
+
+pair z0=(0,0);
+pair z1=(-1,0);
+pair z2=(1,0);
+real r=1.5;
+path c1=circle(z1,r);
+path c2=circle(z2,r);
+fill(c1,colour1);
+fill(c2,colour2);
+
+picture intersection=new picture;
+fill(intersection,c1,colour1+colour2);
+clip(intersection,c2);
+
+add(intersection);
+
+draw(c1);
+draw(c2);
+
+//draw("$\A$",box,z1); // Requires [inline] package option.
+//draw(Label("$\B$","$B$"),box,z2); // Requires [inline] package option.
+draw("$A$",box,z1);
+draw("$\V{B}$",box,z2);
+
+pair z=(0,-2);
+real m=3;
+margin BigMargin=Margin(0,m*dot(unit(z1-z),unit(z0-z)));
+
+draw(Label("$A\cap B$",0),conj(z)--z0,Arrow,BigMargin);
+draw(Label("$A\cup B$",0),z--z0,Arrow,BigMargin);
+draw(z--z1,Arrow,Margin(0,m));
+draw(z--z2,Arrow,Margin(0,m));
+
+shipout(bbox(0.25cm));
+\end{asy}
+%\caption{Venn diagram}\label{venn}
+\end{center}
+%\end{figure}
+
+Each graph is drawn in its own environment. One can specify the width
+and height to \LaTeX\ explicitly. This 3D example can be viewed
+interactively either with Adobe Reader or Asymptote's fast OpenGL-based
+renderer. To support {\tt latexmk}, 3D figures should specify
+\verb+inline=true+. It is sometimes desirable to embed 3D files as annotated
+attachments; this requires the \verb+attach=true+ option as well as the
+\verb+attachfile2+ \LaTeX\ package.
+\begin{center}
+\begin{asy}[height=4cm,inline=true,attach=false,viewportwidth=\linewidth]
+currentprojection=orthographic(5,4,2);
+draw(unitcube,blue);
+label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
+\end{asy}
+\end{center}
+
+One can also scale the figure to the full line width:
+\begin{center}
+\begin{asy}[width=\the\linewidth,inline=true]
+pair z0=(0,0);
+pair z1=(2,0);
+pair z2=(5,0);
+pair zf=z1+0.75*(z2-z1);
+
+draw(z1--z2);
+dot(z1,red+0.15cm);
+dot(z2,darkgreen+0.3cm);
+label("$m$",z1,1.2N,red);
+label("$M$",z2,1.5N,darkgreen);
+label("$\hat{\ }$",zf,0.2*S,fontsize(24pt)+blue);
+
+pair s=-0.2*I;
+draw("$x$",z0+s--z1+s,N,red,Arrows,Bars,PenMargins);
+s=-0.5*I;
+draw("$\bar{x}$",z0+s--zf+s,blue,Arrows,Bars,PenMargins);
+s=-0.95*I;
+draw("$X$",z0+s--z2+s,darkgreen,Arrows,Bars,PenMargins);
+\end{asy}
+\end{center}
+\end{document}
diff --git a/Build/source/utils/asymptote/doc/leastsquares.asy b/Build/source/utils/asymptote/doc/leastsquares.asy
new file mode 100644
index 00000000000..6362e8323ef
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/leastsquares.asy
@@ -0,0 +1,55 @@
+size(400,200,IgnoreAspect);
+
+import graph;
+import stats;
+
+file fin=input("leastsquares.dat").line();
+
+real[][] a=fin;
+a=transpose(a);
+
+real[] t=a[0], rho=a[1];
+
+// Read in parameters from the keyboard:
+//real first=getreal("first");
+//real step=getreal("step");
+//real last=getreal("last");
+
+real first=100;
+real step=50;
+real last=700;
+
+// Remove negative or zero values of rho:
+t=rho > 0 ? t : null;
+rho=rho > 0 ? rho : null;
+
+scale(Log(true),Linear(true));
+
+int n=step > 0 ? ceil((last-first)/step) : 0;
+
+real[] T,xi,dxi;
+
+for(int i=0; i <= n; ++i) {
+ real first=first+i*step;
+ real[] logrho=(t >= first & t <= last) ? log(rho) : null;
+ real[] logt=(t >= first & t <= last) ? -log(t) : null;
+
+ if(logt.length < 2) break;
+
+ // Fit to the line logt=L.m*logrho+L.b:
+ linefit L=leastsquares(logt,logrho);
+
+ T.push(first);
+ xi.push(L.m);
+ dxi.push(L.dm);
+}
+
+draw(graph(T,xi),blue);
+errorbars(T,xi,dxi,red);
+
+crop();
+
+ylimits(0);
+
+xaxis("$T$",BottomTop,LeftTicks);
+yaxis("$\xi$",LeftRight,RightTicks);
diff --git a/Build/source/utils/asymptote/doc/leastsquares.dat b/Build/source/utils/asymptote/doc/leastsquares.dat
new file mode 100644
index 00000000000..a4d63d6e100
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/leastsquares.dat
@@ -0,0 +1,882 @@
+1 3825
+2 4057
+3 4217
+4 4278
+5 4353
+6 4483
+7 4410
+8 4462
+9 4626
+10 4511
+11 4531
+12 4450
+13 4354
+14 4402
+15 4489
+16 4441
+17 4366
+18 4443
+19 4442
+20 4335
+21 4292
+22 4458
+23 4444
+24 4426
+25 4310
+26 4264
+27 4263
+28 4252
+29 4330
+30 4304
+31 4242
+32 4272
+33 4284
+34 4198
+35 4242
+36 4096
+37 4142
+38 4248
+39 4186
+40 4210
+41 4125
+42 4134
+43 4098
+44 4129
+45 3960
+46 4012
+47 4079
+48 4038
+49 4024
+50 3949
+51 3996
+52 3970
+53 4031
+54 3895
+55 3806
+56 3825
+57 3850
+58 3742
+59 3678
+60 3589
+61 3648
+62 3476
+63 3490
+64 3353
+65 3270
+66 3134
+67 3018
+68 2922
+69 2801
+70 2691
+71 2528
+72 2460
+73 2254
+74 2105
+75 2009
+76 1854
+77 1677
+78 1562
+79 1501
+80 1399
+81 1244
+82 1160
+83 1080
+84 963
+85 879
+86 797
+87 745
+88 701
+89 634
+90 554
+91 532
+92 549
+93 521
+94 466
+95 460
+96 435
+97 412
+98 376
+99 367
+100 350
+101 360
+102 321
+103 302
+104 291
+105 273
+106 261
+107 255
+108 231
+109 245
+110 252
+111 236
+112 227
+113 207
+114 196
+115 199
+116 211
+117 232
+118 220
+119 214
+120 229
+121 213
+122 208
+123 196
+124 218
+125 196
+126 192
+127 178
+128 177
+129 178
+130 179
+131 170
+132 173
+133 170
+134 150
+135 144
+136 149
+137 145
+138 145
+139 139
+140 147
+141 140
+142 128
+143 133
+144 156
+145 136
+146 164
+147 152
+148 140
+149 141
+150 112
+151 108
+152 110
+153 133
+154 118
+155 113
+156 113
+157 108
+158 88
+159 109
+160 97
+161 99
+162 94
+163 97
+164 104
+165 105
+166 118
+167 108
+168 130
+169 126
+170 114
+171 112
+172 107
+173 96
+174 96
+175 102
+176 85
+177 89
+178 93
+179 96
+180 101
+181 82
+182 97
+183 96
+184 94
+185 97
+186 85
+187 79
+188 72
+189 75
+190 63
+191 65
+192 62
+193 54
+194 53
+195 49
+196 55
+197 48
+198 53
+199 46
+200 50
+201 48
+202 50
+203 51
+204 50
+205 49
+206 46
+207 47
+208 44
+209 42
+210 47
+211 45
+212 44
+213 46
+214 43
+215 40
+216 42
+217 41
+218 40
+219 43
+220 41
+221 42
+222 43
+223 40
+224 42
+225 39
+226 41
+227 42
+228 44
+229 40
+230 40
+231 35
+232 38
+233 37
+234 36
+235 34
+236 34
+237 34
+238 36
+239 36
+240 36
+241 37
+242 37
+243 37
+244 36
+245 36
+246 45
+247 43
+248 43
+249 43
+250 49
+251 58
+252 48
+253 50
+254 56
+255 51
+256 50
+257 55
+258 64
+259 55
+260 49
+261 36
+262 36
+263 40
+264 49
+265 37
+266 35
+267 35
+268 33
+269 33
+270 39
+271 35
+272 34
+273 36
+274 32
+275 37
+276 31
+277 31
+278 32
+279 30
+280 32
+281 29
+282 31
+283 30
+284 30
+285 28
+286 27
+287 26
+288 24
+289 25
+290 28
+291 30
+292 29
+293 27
+294 27
+295 27
+296 26
+297 26
+298 28
+299 27
+300 24
+301 22
+302 27
+303 26
+304 25
+305 25
+306 25
+307 26
+308 28
+309 26
+310 25
+311 24
+312 26
+313 25
+314 23
+315 25
+316 24
+317 23
+318 23
+319 24
+320 23
+321 24
+322 22
+323 24
+324 24
+325 24
+326 23
+327 25
+328 24
+329 22
+330 22
+331 23
+332 23
+333 23
+334 21
+335 19
+336 20
+337 22
+338 26
+339 25
+340 24
+341 22
+342 22
+343 23
+344 23
+345 23
+346 20
+347 21
+348 20
+349 21
+350 25
+351 22
+352 22
+353 21
+354 24
+355 24
+356 22
+357 23
+358 26
+359 24
+360 23
+361 22
+362 26
+363 30
+364 27
+365 25
+366 26
+367 26
+368 25
+369 24
+370 24
+371 22
+372 21
+373 20
+374 20
+375 19
+376 20
+377 21
+378 20
+379 20
+380 19
+381 19
+382 19
+383 19
+384 20
+385 20
+386 19
+387 20
+388 20
+389 20
+390 17
+391 18
+392 16
+393 18
+394 32
+395 31
+396 47
+397 57
+398 64
+399 34
+400 42
+401 40
+402 41
+403 35
+404 26
+405 25
+406 25
+407 36
+408 42
+409 55
+410 75
+411 94
+412 87
+413 97
+414 95
+415 101
+416 70
+417 66
+418 66
+419 73
+420 77
+421 89
+422 79
+423 63
+424 66
+425 71
+426 70
+427 49
+428 46
+429 46
+430 43
+431 49
+432 48
+433 44
+434 36
+435 33
+436 28
+437 29
+438 32
+439 31
+440 29
+441 28
+442 29
+443 31
+444 31
+445 33
+446 33
+447 39
+448 44
+449 37
+450 58
+451 64
+452 38
+453 31
+454 36
+455 33
+456 29
+457 34
+458 28
+459 27
+460 23
+461 31
+462 26
+463 21
+464 23
+465 26
+466 21
+467 21
+468 24
+469 24
+470 24
+471 24
+472 26
+473 23
+474 26
+475 20
+476 21
+477 25
+478 21
+479 22
+480 22
+481 23
+482 22
+483 23
+484 22
+485 20
+486 22
+487 20
+488 22
+489 20
+490 24
+491 20
+492 22
+493 19
+494 19
+495 20
+496 19
+497 18
+498 18
+499 17
+500 16
+501 16
+502 17
+503 17
+504 16
+505 17
+506 16
+507 16
+508 16
+509 17
+510 18
+511 17
+512 16
+513 17
+514 16
+515 16
+516 16
+517 17
+518 16
+519 16
+520 16
+521 16
+522 16
+523 16
+524 16
+525 16
+526 16
+527 17
+528 17
+529 18
+530 17
+531 16
+532 15
+533 15
+534 15
+535 15
+536 16
+537 17
+538 16
+539 18
+540 17
+541 17
+542 15
+543 15
+544 15
+545 16
+546 15
+547 15
+548 15
+549 15
+550 15
+551 14
+552 14
+553 14
+554 14
+555 14
+556 14
+557 14
+558 15
+559 14
+560 16
+561 15
+562 16
+563 17
+564 15
+565 14
+566 17
+567 18
+568 17
+569 16
+570 17
+571 14
+572 15
+573 15
+574 15
+575 14
+576 15
+577 14
+578 14
+579 13
+580 13
+581 13
+582 13
+583 13
+584 12
+585 12
+586 13
+587 12
+588 12
+589 12
+590 13
+591 15
+592 16
+593 14
+594 13
+595 14
+596 13
+597 13
+598 13
+599 13
+600 14
+601 13
+602 13
+603 13
+604 14
+605 15
+606 15
+607 15
+608 15
+609 15
+610 15
+611 15
+612 15
+613 15
+614 15
+615 15
+616 14
+617 14
+618 14
+619 14
+620 14
+621 14
+622 14
+623 15
+624 15
+625 15
+626 14
+627 15
+628 14
+629 14
+630 14
+631 14
+632 14
+633 14
+634 13
+635 13
+636 13
+637 13
+638 13
+639 13
+640 13
+641 13
+642 13
+643 13
+644 13
+645 13
+646 13
+647 13
+648 13
+649 13
+650 13
+651 13
+652 13
+653 13
+654 13
+655 13
+656 13
+657 13
+658 13
+659 13
+660 13
+661 13
+662 13
+663 13
+664 13
+665 13
+666 13
+667 13
+668 13
+669 13
+670 13
+671 13
+672 13
+673 13
+674 13
+675 13
+676 13
+677 13
+678 13
+679 12
+680 12
+681 13
+682 13
+683 13
+684 13
+685 12
+686 12
+687 13
+688 13
+689 13
+690 13
+691 13
+692 13
+693 13
+694 13
+695 13
+696 13
+697 13
+698 13
+699 13
+700 13
+701 13
+702 13
+703 13
+704 13
+705 13
+706 13
+707 13
+708 13
+709 13
+710 13
+711 13
+712 13
+713 13
+714 13
+715 13
+716 13
+717 13
+718 13
+719 13
+720 13
+721 13
+722 13
+723 13
+724 13
+725 13
+726 13
+727 13
+728 13
+729 13
+730 13
+731 13
+732 13
+733 13
+734 13
+735 13
+736 13
+737 13
+738 13
+739 13
+740 13
+741 13
+742 13
+743 13
+744 13
+745 13
+746 13
+747 13
+748 13
+749 13
+750 13
+751 13
+752 13
+753 13
+754 13
+755 12
+756 12
+757 12
+758 12
+759 11
+760 12
+761 11
+762 12
+763 11
+764 12
+765 12
+766 12
+767 12
+768 14
+769 14
+770 14
+771 14
+772 12
+773 12
+774 12
+775 13
+776 13
+777 13
+778 12
+779 13
+780 13
+781 13
+782 13
+783 13
+784 13
+785 12
+786 11
+787 11
+788 11
+789 12
+790 13
+791 13
+792 13
+793 12
+794 13
+795 13
+796 13
+797 13
+798 13
+799 12
+800 12
+801 12
+802 12
+803 12
+804 12
+805 11
+806 11
+807 11
+808 12
+809 13
+810 13
+811 12
+812 12
+813 12
+814 12
+815 12
+816 12
+817 12
+818 12
+819 12
+820 13
+821 13
+822 13
+823 13
+824 12
+825 13
+826 12
+827 13
+828 13
+829 13
+830 13
+831 12
+832 12
+833 12
+834 13
+835 13
+836 12
+837 9
+838 9
+839 10
+840 10
+841 11
+842 11
+843 11
+844 12
+845 12
+846 11
+847 12
+848 12
+849 12
+850 12
+851 12
+852 12
+853 12
+854 12
+855 12
+856 11
+857 10
+858 11
+859 12
+860 11
+861 11
+862 11
+863 10
+864 10
+865 10
+866 11
+867 10
+868 10
+869 10
+870 11
+871 11
+872 12
+873 12
+874 12
+875 12
+876 12
+877 12
+878 12
+879 12
+880 12
+881 0
+882 0
diff --git a/Build/source/utils/asymptote/doc/legend.asy b/Build/source/utils/asymptote/doc/legend.asy
new file mode 100644
index 00000000000..b00cdd14e6b
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/legend.asy
@@ -0,0 +1,15 @@
+import graph;
+size(8cm,6cm,IgnoreAspect);
+
+typedef real realfcn(real);
+realfcn F(real p) {
+ return new real(real x) {return sin(p*x);};
+};
+
+for(int i=1; i < 5; ++i)
+ draw(graph(F(i*pi),0,1),Pen(i),
+ "$\sin("+(i == 1 ? "" : (string) i)+"\pi x)$");
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks(trailingzero));
+
+attach(legend(2),(point(S).x,truepoint(S).y),10S,UnFill);
diff --git a/Build/source/utils/asymptote/doc/lineargraph.asy b/Build/source/utils/asymptote/doc/lineargraph.asy
new file mode 100644
index 00000000000..c352311ee72
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/lineargraph.asy
@@ -0,0 +1,16 @@
+import graph;
+
+size(250,200,IgnoreAspect);
+
+real Sin(real t) {return sin(2pi*t);}
+real Cos(real t) {return cos(2pi*t);}
+
+draw(graph(Sin,0,1),red,"$\sin(2\pi x)$");
+draw(graph(Cos,0,1),blue,"$\cos(2\pi x)$");
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks(trailingzero));
+
+label("LABEL",point(0),UnFill(1mm));
+
+attach(legend(),truepoint(E),20E,UnFill);
diff --git a/Build/source/utils/asymptote/doc/lineargraph0.asy b/Build/source/utils/asymptote/doc/lineargraph0.asy
new file mode 100644
index 00000000000..fc344181d51
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/lineargraph0.asy
@@ -0,0 +1,16 @@
+import graph;
+
+size(400,200,IgnoreAspect);
+
+real Sin(real t) {return sin(2pi*t);}
+real Cos(real t) {return cos(2pi*t);}
+
+draw(graph(Sin,0,1),red,"$\sin(2\pi x)$");
+draw(graph(Cos,0,1),blue,"$\cos(2\pi x)$");
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks(trailingzero));
+
+label("LABEL",point(0),UnFill(1mm));
+
+add(legend(),point(E),20E,UnFill);
diff --git a/Build/source/utils/asymptote/doc/linetype.asy b/Build/source/utils/asymptote/doc/linetype.asy
new file mode 100644
index 00000000000..477ada1e14d
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/linetype.asy
@@ -0,0 +1,13 @@
+void testline(real y) {
+ draw((0,y)--(100,y),currentpen+solid);
+ draw((0,y-10)--(100,y-10),currentpen+dotted);
+ draw((0,y-20)--(100,y-20),currentpen+dashed);
+ draw((0,y-30)--(100,y-30),currentpen+longdashed);
+ draw((0,y-40)--(100,y-40),currentpen+dashdotted);
+ draw((0,y-50)--(100,y-50),currentpen+longdashdotted);
+ draw((0,y-60)--(100,y-60),currentpen+Dotted);
+}
+
+currentpen=linewidth(0.5);
+testline(100);
+
diff --git a/Build/source/utils/asymptote/doc/log2graph.asy b/Build/source/utils/asymptote/doc/log2graph.asy
new file mode 100644
index 00000000000..238f4126274
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/log2graph.asy
@@ -0,0 +1,17 @@
+import graph;
+size(200,IgnoreAspect);
+
+// Base-2 logarithmic scale on y-axis:
+
+real log2(real x) {static real log2=log(2); return log(x)/log2;}
+real pow2(real x) {return 2^x;}
+
+scaleT yscale=scaleT(log2,pow2,logarithmic=true);
+scale(Linear,yscale);
+
+real f(real x) {return 1+x^2;}
+
+draw(graph(f,-4,4));
+
+yaxis("$y$",ymin=1,ymax=f(5),RightTicks(Label(Fill(white))),EndArrow);
+xaxis("$x$",xmin=-5,xmax=5,LeftTicks,EndArrow);
diff --git a/Build/source/utils/asymptote/doc/loggraph.asy b/Build/source/utils/asymptote/doc/loggraph.asy
new file mode 100644
index 00000000000..d496fba1624
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/loggraph.asy
@@ -0,0 +1,17 @@
+import graph;
+
+size(200,200,IgnoreAspect);
+
+real f(real t) {return 1/t;}
+
+scale(Log,Log);
+
+draw(graph(f,0.1,10));
+
+//limits((1,0.1),(10,0.5),Crop);
+
+dot(Label("(3,5)",align=S),Scale((3,5)));
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks);
+
diff --git a/Build/source/utils/asymptote/doc/loggrid.asy b/Build/source/utils/asymptote/doc/loggrid.asy
new file mode 100644
index 00000000000..bb48a1e4ca8
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/loggrid.asy
@@ -0,0 +1,13 @@
+import graph;
+size(200,200,IgnoreAspect);
+
+real f(real t) {return 1/t;}
+
+scale(Log,Log);
+draw(graph(f,0.1,10),red);
+pen thin=linewidth(0.5*linewidth());
+xaxis("$x$",BottomTop,LeftTicks(begin=false,end=false,extend=true,
+ ptick=thin));
+yaxis("$y$",LeftRight,RightTicks(begin=false,end=false,extend=true,
+ ptick=thin));
+
diff --git a/Build/source/utils/asymptote/doc/logimage.asy b/Build/source/utils/asymptote/doc/logimage.asy
new file mode 100644
index 00000000000..65d6bb53111
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/logimage.asy
@@ -0,0 +1,22 @@
+import graph;
+import palette;
+
+size(10cm,10cm,IgnoreAspect);
+
+real f(real x, real y) {
+ return 0.9*pow10(2*sin(x/5+2*y^0.25)) + 0.1*(1+cos(10*log(y)));
+}
+
+scale(Linear,Log,Log);
+
+pen[] Palette=BWRainbow();
+
+bounds range=image(f,Automatic,(0,1),(100,100),nx=200,Palette);
+
+xaxis("$x$",BottomTop,LeftTicks,above=true);
+yaxis("$y$",LeftRight,RightTicks,above=true);
+
+palette("$f(x,y)$",range,(0,200),(100,250),Top,Palette,
+ PaletteTicks(ptick=linewidth(0.5*linewidth())));
+
+
diff --git a/Build/source/utils/asymptote/doc/logo.asy b/Build/source/utils/asymptote/doc/logo.asy
new file mode 100644
index 00000000000..3cd42079ede
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/logo.asy
@@ -0,0 +1,28 @@
+size(140,80,IgnoreAspect);
+
+picture logo(pair s=0, pen q)
+{
+ picture pic;
+ pen p=linewidth(2)+fontsize(24pt)+q;
+ real a=-0.4;
+ real b=0.95;
+ real y1=-5;
+ real y2=-3y1/2;
+ path A=(a,0){dir(10)}::{dir(89.5)}(0,y2);
+ draw(pic,A,p);
+ draw(pic,(0,y1){dir(88.3)}::{dir(20)}(b,0),p);
+ real c=0.5*a;
+ pair z=(0,2.5);
+ label(pic,"{\it symptote}",z,0.25*E+0.169S,p);
+ pair w=(0,1.7);
+ draw(pic,intersectionpoint(A,w-1--w)--w,p);
+ draw(pic,(0,y1)--(0,y2),p);
+ draw(pic,(a,0)--(b,0),p);
+ return shift(s)*pic;
+}
+
+pair z=(-0.015,0.08);
+for(int x=0; x < 10; ++x)
+ add(logo(0.1*x*z,gray(0.04*x)));
+
+add(logo(red));
diff --git a/Build/source/utils/asymptote/doc/logticks.asy b/Build/source/utils/asymptote/doc/logticks.asy
new file mode 100644
index 00000000000..bdd14411692
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/logticks.asy
@@ -0,0 +1,11 @@
+import graph;
+
+size(300,175,IgnoreAspect);
+scale(Log,Log);
+draw(graph(identity,5,20));
+xlimits(5,20);
+ylimits(1,100);
+xaxis("$M/M_\odot$",BottomTop,LeftTicks(DefaultFormat,
+ new real[] {6,10,12,14,16,18}));
+yaxis("$\nu_{\rm upp}$ [Hz]",LeftRight,RightTicks(DefaultFormat));
+
diff --git a/Build/source/utils/asymptote/doc/makepen.asy b/Build/source/utils/asymptote/doc/makepen.asy
new file mode 100644
index 00000000000..7c7868a0901
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/makepen.asy
@@ -0,0 +1,9 @@
+size(200);
+pen convex=makepen(scale(10)*polygon(8))+grey;
+draw((1,0.4),convex);
+draw((0,0)---(1,1)..(2,0)--cycle,convex);
+
+pen nonconvex=scale(10)*
+ makepen((0,0)--(0.25,-1)--(0.5,0.25)--(1,0)--(0.5,1.25)--cycle)+red;
+draw((0.5,-1.5),nonconvex);
+draw((0,-1.5)..(1,-0.5)..(2,-1.5),nonconvex);
diff --git a/Build/source/utils/asymptote/doc/markers1.asy b/Build/source/utils/asymptote/doc/markers1.asy
new file mode 100644
index 00000000000..7db56315f91
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/markers1.asy
@@ -0,0 +1,102 @@
+size(12cm,0);
+import markers;
+
+pair A=(0,0), B=(1,0), C=(2,0), D=(3,0);
+path p=A--B--C--D;
+transform T=shift(-4,-1);
+transform t=shift(4,0);
+
+//line 1 **********
+draw(p,marker(markinterval(3,dotframe,true)));
+label("$1$",point(p,0),3W);
+
+//line 2 **********
+p=t*p;
+draw(p,marker(stickframe,markuniform(4)));
+label("$2$",point(p,0),3W);
+
+//line 3 **********
+p=T*p;
+draw(p,marker(stickframe(red),markinterval(3,dotframe(blue),true)));
+label("$3$",point(p,0),3W);
+
+//line 4 **********
+p=t*p;
+draw(p,StickIntervalMarker(3,2,blue,dotframe(red)));
+label("$4$",point(p,0),3W);
+
+//line 5 **********
+p=T*p;
+pen pn=linewidth(4bp);
+draw(p,pn,StickIntervalMarker(3,3,angle=25,pn,dotframe(red+pn)));
+label("$5$",point(p,0),3W);
+
+//line 6 **********
+p=t*p;
+draw(p,StickIntervalMarker(3,5,angle=25,size=4mm,space=2mm,offset=I*2mm,
+ scale(2)*dotframe(red)));
+label("$6$",point(p,0),3W);
+
+//line 7 **********
+p=T*p;
+draw(p,StickIntervalMarker(n=3,angle=45,size=10mm,space=3mm,dotframe));
+label("$7$",point(p,0),3W);
+
+//line 8 **********
+p=t*p;
+draw(p,CircleBarIntervalMarker(n=2,dotframe));
+label("$8$",point(p,0),3W);
+
+//line 9 **********
+p=T*p;
+draw(p,CircleBarIntervalMarker(n=3,angle=30,barsize=8mm,radius=2mm,
+ FillDraw(.8red),
+ dotframe));
+label("$9$",point(p,0),3W);
+
+//line 10 **********
+p=t*p;
+draw(p,CircleBarIntervalMarker(n=3,angle=30,barsize=8mm,radius=2mm,
+ FillDraw(.8red),circleabove=true,dotframe));
+label("$10$",point(p,0),3W);
+
+//line 11 **********
+p=T*p;
+draw(p,CircleBarIntervalMarker(n=3,angle=30,barsize=8mm,radius=2mm,
+ FillDraw(.8red),circleabove=true,dotframe,
+ above=false));
+label("$11$",point(p,0),3W);
+
+//line 12 **********
+p=t*p;
+draw(p,TildeIntervalMarker(i=3,dotframe));
+label("$12$",point(p,0),3W);
+
+//line 13 **********
+p=T*p;
+draw(p,TildeIntervalMarker(i=3,n=2,angle=-20,dotframe));
+label("$13$",point(p,0),3W);
+
+//line 14 **********
+p=t*p;
+draw(p,CrossIntervalMarker(3,3,dotframe));
+label("$14$",point(p,0),3W);
+
+//line 15 **********
+p=shift(.25S)*T*p;
+path cle=shift(relpoint(p,.5))*scale(abs(A-D)/4)*unitcircle;
+draw(cle,StickIntervalMarker(5,3,dotframe(6bp+red)));
+label("$15$",point(p,0),3W);
+
+//line 16 **********
+cle=t*cle;
+p=t*p;
+frame a;
+label(a,"$a$",(0,-2labelmargin()));
+draw(cle,marker(dotframe(6bp+red),markinterval(5,a,true)));
+label("$16$",point(p,0),3W);
+
+// line 17 **********
+p=T*shift(relpoint(p,.5)+.65S)*scale(.5)*shift(-relpoint(p,.5))*rotate(45,relpoint(p,.5))*p;
+draw(p,TildeIntervalMarker(size=5mm,rotated=false,dotframe));
+label("$17$",point(p,0),3W);
diff --git a/Build/source/utils/asymptote/doc/markers2.asy b/Build/source/utils/asymptote/doc/markers2.asy
new file mode 100644
index 00000000000..b9c8ac21894
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/markers2.asy
@@ -0,0 +1,34 @@
+size(10cm,0);
+import markers;
+import geometry;
+import math;
+
+pair A=0, B=(1,0), C=(0.7,1), D=(-0.5,0), F=rotate(-90)*(C-B)/2+B;
+
+draw(A--B);
+draw(A--C);
+pen p=linewidth(1mm);
+draw(B--C,p);
+draw(A--D);
+draw(B--F,p);
+label("$A$",A,SW);
+label("$B$",B,S);
+label("$C$",C,N);
+dot(Label("$D$",D,S));
+dot(Label("$F$",F,N+NW));
+
+markangle(A,C,B);
+
+markangle(scale(1.5)*"$\theta$",radius=40,C,B,A,ArcArrow(2mm),1mm+red);
+markangle(scale(1.5)*"$-\theta$",radius=-70,A,B,C,ArcArrow,green);
+
+markangle(Label("$\gamma$",Relative(0.25)),n=2,radius=-30,A,C,B,p=0.7blue+2);
+
+markangle(n=3,B,A,C,marker(markinterval(stickframe(n=2),true)));
+
+pen RedPen=0.7red+1bp;
+markangle(C,A,D,RedPen,marker(markinterval(2,stickframe(3,4mm,RedPen),true)));
+drawline(A,A+dir(A--D,A--C),dotted);
+
+perpendicular(B,NE,F-B,size=10mm,1mm+red,
+ TrueMargin(linewidth(p)/2,linewidth(p)/2),Fill(yellow));
diff --git a/Build/source/utils/asymptote/doc/mexicanhat.asy b/Build/source/utils/asymptote/doc/mexicanhat.asy
new file mode 100644
index 00000000000..d55b127ae5c
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/mexicanhat.asy
@@ -0,0 +1,22 @@
+size(200);
+
+real mexican(real x) {return (1-8x^2)*exp(-(4x^2));}
+
+int n=30;
+real a=1.5;
+real width=2a/n;
+
+guide hat;
+path solved;
+
+for(int i=0; i < n; ++i) {
+ real t=-a+i*width;
+ pair z=(t,mexican(t));
+ hat=hat..z;
+ solved=solved..z;
+}
+
+draw(hat);
+dot(hat,red);
+draw(solved,dashed);
+
diff --git a/Build/source/utils/asymptote/doc/monthaxis.asy b/Build/source/utils/asymptote/doc/monthaxis.asy
new file mode 100644
index 00000000000..d2c8bf3298f
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/monthaxis.asy
@@ -0,0 +1,17 @@
+import graph;
+
+size(400,150,IgnoreAspect);
+
+real[] x=sequence(12);
+real[] y=sin(2pi*x/12);
+
+scale(false);
+
+string[] month={"Jan","Feb","Mar","Apr","May","Jun",
+ "Jul","Aug","Sep","Oct","Nov","Dec"};
+
+draw(graph(x,y),red,MarkFill[0]);
+
+xaxis(BottomTop,LeftTicks(new string(real x) {
+ return month[round(x % 12)];}));
+yaxis("$y$",LeftRight,RightTicks(4));
diff --git a/Build/source/utils/asymptote/doc/multicontour.asy b/Build/source/utils/asymptote/doc/multicontour.asy
new file mode 100644
index 00000000000..0e8476de922
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/multicontour.asy
@@ -0,0 +1,19 @@
+import contour;
+
+size(200);
+
+real f(real x, real y) {return x^2-y^2;}
+int n=10;
+real[] c=new real[n];
+for(int i=0; i < n; ++i) c[i]=(i-n/2)/n;
+
+pen[] p=sequence(new pen(int i) {
+ return (c[i] >= 0 ? solid : dashed)+fontsize(6pt);
+ },c.length);
+
+Label[] Labels=sequence(new Label(int i) {
+ return Label(c[i] != 0 ? (string) c[i] : "",Relative(unitrand()),(0,0),
+ UnFill(1bp));
+ },c.length);
+
+draw(Labels,contour(f,(-1,-1),(1,1),c),p);
diff --git a/Build/source/utils/asymptote/doc/ocg.sty b/Build/source/utils/asymptote/doc/ocg.sty
new file mode 100644
index 00000000000..87da828a8d2
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/ocg.sty
@@ -0,0 +1,130 @@
+%% Copyright (C) 2007 by Michael Ritzert <michael.ritz...@gmail.com>
+%% Spurious spaces removed by John Bowman [2009/06/01].
+%% Global macros to find the number of a PDF OCG object from its LaTeX
+%% reference contributed by Paul Gaborit [2012/09/13].
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ocg}[2012/09/13]
+
+\RequirePackage{ifpdf}
+\ifpdf
+\else
+ \PackageWarningNoLine{ocg}{%
+ Loading aborted, because pdfTeX is not running in PDF mode%
+ }%
+ \expandafter\endinput
+\fi
+
+\DeclareOption*{}\ProcessOptions*\relax %allow anything as option for the moment
+
+%testing for correct pdfTeX version
+%TODO: find out minimum required version!
+\ifnum\pdftexversion<120
+ \PackageError{ocg}{%
+ pdfeTeX, version >= 1.20, required%
+ }{%
+ Install a newer version!%
+ }%
+\fi
+
+% Next OCG id -- TODO: autogenerate. but keep possibility to reopen an OCG.
+\newcount\@ocg@num\@ocg@num=0
+
+\gdef\@ocg@layersnames{}
+
+% called from the aux file
+\def\@ocg@makeknown#1#2#3{% #1: OCG name, #2: OC id, #3: on/off
+ \@ifundefined{OCG#2}{%
+ \message{OCG#2}
+ \expandafter\gdef\csname OCG#2\endcsname{#1}%
+ \immediate\pdfobj{<< /Type /OCG /Name (#1) >>}% new ocg
+ \xdef\@ocg@curocg{\the\pdflastobj\space 0 R}% reference to id
+ \expandafter\xdef\csname OCGpdfobj#2\endcsname{\@ocg@curocg}
+ \xdef\@ocg@ocgs{\@ocg@ocgs\space\@ocg@curocg}% list of all OCGs in "first defined" order
+ \ifnum#3=1 %on
+ \xdef\@ocg@ocgson{\@ocg@ocgson\space\@ocg@curocg}% list of all default-on OCGs
+ \else%
+ \xdef\@ocg@ocgsoff{\@ocg@ocgsoff\space\@ocg@curocg}% list of all default-off OCGs
+ \fi%
+ \xdef\@ocg@layersnames{%
+ \@ocg@layersnames\space/OC#2\space\@ocg@curocg% name-to-id mapping
+ }%
+ }{%
+ \message{OCG#2 reopened}
+ % layer reopened
+ }
+}
+
+\AtBeginDocument{%
+ % the auxfile has been read if available. register the OCGs in the page resources.
+ \@ocg@addresource
+ \let\@ocg@makeknown\@gobble
+}
+
+% set page resources to include the layers defined in the aux file
+\def\@ocg@addresource{%
+ \immediate\pdfobj{<<\@ocg@layersnames\space>>}%
+ \xdef\@ocg@namesobj{\the\pdflastobj\space 0 R}%
+ % append to pageresources
+ \begingroup
+ \edef\x{\endgroup
+ \pdfpageresources{%
+ \the\pdfpageresources
+ /Properties \@ocg@namesobj%
+ }%
+ }%
+ \x
+}
+
+\newcount\@ocg@@ocgs
+\pdfobj reserveobjnum
+\@ocg@@ocgs=\pdflastobj
+
+\newcount\@ocg@@layersconfig
+\pdfobj reserveobjnum
+\@ocg@@layersconfig=\pdflastobj
+
+\pdfcatalog{%
+ /OCProperties <<
+ /OCGs \the\@ocg@@ocgs\space0 R\space
+ /D \the\@ocg@@layersconfig\space0 R\space
+ >>%
+}
+\def\@ocg@ocgs{}
+\def\@ocg@ocgson{}
+\def\@ocg@ocgsoff{}
+\AtEndDocument{%
+ \immediate\pdfobj useobjnum \@ocg@@ocgs {%
+ [\@ocg@ocgs\space]%
+ }%
+ \immediate\pdfobj useobjnum \@ocg@@layersconfig {%
+ <<
+ /Order [\@ocg@ocgs\space]
+ /ON [\@ocg@ocgson\space]
+ /OFF [\@ocg@ocgsoff\space]
+ >>%
+ }%
+}%
+
+% schedule a OCG for creation on the next pdflatex run (via the auxfile)
+\def\@ocg@newocg#1#2#3{% #1:name, #2:num, #3:on
+ \if@filesw%
+ \immediate\write\@auxout{%
+ \string\@ocg@makeknown{#1}{#2}{#3}%
+ }%
+ \fi%
+}
+
+% TODO: Are nested OCGs allowed?
+\newenvironment{ocg}[3]{%
+ \@ocg@newocg{#1}{#2}{#3}%
+ \gdef\@ocg@curnum{#2}%
+ \pdfliteral{/OC /OC\@ocg@curnum\space BDC}%
+ \message{/OC\@ocg@curnum}%
+ \ignorespaces
+}{%
+ \pdfliteral{EMC}%
+ %\unskip%
+ %\endgroup%
+ \ignorespacesafterend
+}
diff --git a/Build/source/utils/asymptote/doc/onecontour.asy b/Build/source/utils/asymptote/doc/onecontour.asy
new file mode 100644
index 00000000000..0d7f247fd39
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/onecontour.asy
@@ -0,0 +1,5 @@
+import contour;
+size(75);
+
+real f(real a, real b) {return a^2+b^2;}
+draw(contour(f,(-1,-1),(1,1),new real[] {1}));
diff --git a/Build/source/utils/asymptote/doc/parametricgraph.asy b/Build/source/utils/asymptote/doc/parametricgraph.asy
new file mode 100644
index 00000000000..61c219d8104
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/parametricgraph.asy
@@ -0,0 +1,15 @@
+import graph;
+
+size(0,200);
+
+real x(real t) {return cos(2pi*t);}
+real y(real t) {return sin(2pi*t);}
+
+draw(graph(x,y,0,1));
+
+//limits((0,-1),(1,0),Crop);
+
+xaxis("$x$",BottomTop,LeftTicks);
+yaxis("$y$",LeftRight,RightTicks(trailingzero));
+
+
diff --git a/Build/source/utils/asymptote/doc/penfunctionimage.asy b/Build/source/utils/asymptote/doc/penfunctionimage.asy
new file mode 100644
index 00000000000..38951e550d5
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/penfunctionimage.asy
@@ -0,0 +1,27 @@
+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 f(int u, int v) {
+ pair z=a+(u*dx,v*dy);
+ pair w=pws(z);
+ real phase=degrees(w,warn=false);
+ real modulus=w == 0 ? 0: fracpart(log(abs(w)));
+ return hsv(phase,1,sqrt(modulus));
+}
+
+image(f,N,N,(0,0),(300,300),antialias=true);
diff --git a/Build/source/utils/asymptote/doc/penimage.asy b/Build/source/utils/asymptote/doc/penimage.asy
new file mode 100644
index 00000000000..2aef9f9ebe2
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/penimage.asy
@@ -0,0 +1,14 @@
+size(200);
+
+import palette;
+
+int n=256;
+real ninv=2pi/n;
+pen[][] v=new pen[n][n];
+
+for(int i=0; i < n; ++i)
+ for(int j=0; j < n; ++j)
+ v[i][j]=rgb(0.5*(1+sin(i*ninv)),0.5*(1+cos(j*ninv)),0);
+
+image(v,(0,0),(1,1));
+
diff --git a/Build/source/utils/asymptote/doc/pixel.pdf b/Build/source/utils/asymptote/doc/pixel.pdf
new file mode 100644
index 00000000000..de3d0820da2
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/pixel.pdf
Binary files differ
diff --git a/Build/source/utils/asymptote/doc/planes.asy b/Build/source/utils/asymptote/doc/planes.asy
new file mode 100644
index 00000000000..a3aeb252e24
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/planes.asy
@@ -0,0 +1,18 @@
+size(6cm,0);
+import bsp;
+
+real u=2.5;
+real v=1;
+
+currentprojection=oblique;
+
+path3 y=plane((2u,0,0),(0,2v,0),(-u,-v,0));
+path3 l=rotate(90,Z)*rotate(90,Y)*y;
+path3 g=rotate(90,X)*rotate(90,Y)*y;
+
+face[] faces;
+filldraw(faces.push(y),project(y),yellow);
+filldraw(faces.push(l),project(l),lightgrey);
+filldraw(faces.push(g),project(g),green);
+
+add(faces);
diff --git a/Build/source/utils/asymptote/doc/png/Makefile.in b/Build/source/utils/asymptote/doc/png/Makefile.in
new file mode 100644
index 00000000000..fc36836b010
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/png/Makefile.in
@@ -0,0 +1,57 @@
+ASYFILES = $(notdir $(filter-out $(wildcard ../latexusage-*.asy),$(wildcard ../*.asy)))
+
+SOURCE = ../asymptote.texi ../version.texi ../options
+ASY = ../asy -dir ../base -config "" -render=0
+
+docdir = $(DESTDIR)@docdir@
+infodir = $(DESTDIR)@infodir@
+datarootdir = @datarootdir@
+INSTALL = @INSTALL@
+
+all: html info
+
+%.png: ../%.asy
+ cd .. && $(ASY) -f png -o png/ $(notdir $<)
+
+latexusage.png: ../latexusage.pdf
+ gs -q -dNOPAUSE -dBATCH -sDEVICE=pngalpha -dEPSCrop -dSAFER -r72x72 \
+ -sOutputFile=latexusage.png ../latexusage.pdf
+
+index.html: $(SOURCE) $(ASYFILES:.asy=.png) latexusage.png
+ makeinfo --html ../asymptote -o .
+
+asymptote.info: $(SOURCE)
+ makeinfo --no-warn --no-split ../asymptote
+
+info: $(SOURCE) $(ASYFILES:.asy=.png) latexusage.png
+ makeinfo --no-split ../asymptote
+
+../options:
+ cd .. && $(MAKE) options
+
+html: index.html
+
+clean: FORCE
+ -rm -f *.png *.html asymptote.info* texput.aux texput.log
+
+distclean: FORCE clean
+ -rm -f Makefile
+
+install: asymptote.info
+ ${INSTALL} -d -m 755 $(infodir)/asymptote
+ ${INSTALL} -p -m 644 asymptote.info $(infodir)/asymptote
+ -if test -z "$(DESTDIR)"; then \
+ install-info --infodir=$(infodir) asymptote.info; \
+ fi
+
+install-all: all install
+ ${INSTALL} -p -m 644 *.png $(infodir)/asymptote
+
+uninstall:
+ -install-info --remove --infodir=$(infodir) asymptote.info
+ -cd $(infodir)/asymptote && rm -f asymptote.info *.png
+ -rmdir $(infodir)/asymptote
+FORCE:
+
+Makefile: Makefile.in
+ cd ../..; config.status
diff --git a/Build/source/utils/asymptote/doc/png/asymptote.info b/Build/source/utils/asymptote/doc/png/asymptote.info
new file mode 100644
index 00000000000..042d9085414
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/png/asymptote.info
@@ -0,0 +1,10446 @@
+This is asymptote.info, produced by makeinfo version 6.6 from
+asymptote.texi.
+
+This file documents 'Asymptote', version 2.69.
+
+ <https://asymptote.sourceforge.io>
+
+ Copyright (C) 2004-20 Andy Hammerlindl, John Bowman, and Tom Prince.
+
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Lesser General Public License
+ (see the file LICENSE in the top-level source directory).
+
+INFO-DIR-SECTION Languages
+START-INFO-DIR-ENTRY
+* asymptote: (asymptote/asymptote). Vector graphics language.
+END-INFO-DIR-ENTRY
+
+
+File: asymptote.info, Node: Top, Next: Description, Prev: (dir), Up: (dir)
+
+Asymptote
+*********
+
+This file documents 'Asymptote', version 2.69.
+
+ <https://asymptote.sourceforge.io>
+
+ Copyright (C) 2004-20 Andy Hammerlindl, John Bowman, and Tom Prince.
+
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Lesser General Public License
+ (see the file LICENSE in the top-level source directory).
+
+* Menu:
+
+* Description:: What is 'Asymptote'?
+* Installation:: Downloading and installing
+* Tutorial:: Getting started
+* Drawing commands:: Four primitive graphics commands
+* Bezier curves:: Path connectors and direction specifiers
+* Programming:: The 'Asymptote' vector graphics language
+* LaTeX usage:: Embedding 'Asymptote' commands within 'LaTeX'
+* Base modules:: Base modules shipped with 'Asymptote'
+* Options:: Command-line options
+* Interactive mode:: Typing 'Asymptote' commands interactively
+* GUI:: Graphical user interface
+* PostScript to Asymptote:: 'Asymptote' backend to 'pstoedit'
+* Help:: Where to get help and submit bug reports
+* Debugger:: Squish those bugs!
+* Credits:: Contributions and acknowledgments
+* Index:: General index
+
+ -- The Detailed Node Listing --
+
+Installation
+
+* UNIX binary distributions:: Prebuilt 'UNIX' binaries
+* MacOS X binary distributions:: Prebuilt 'MacOS X' binaries
+* Microsoft Windows:: Prebuilt 'Microsoft Windows' binary
+* Configuring:: Configuring 'Asymptote' for your system
+* Search paths:: Where 'Asymptote' looks for your files
+* Compiling from UNIX source:: Building 'Asymptote' from scratch
+* Editing modes:: Convenient 'emacs' and 'vim' modes
+* Git:: Getting the latest development source
+* Uninstall:: Goodbye, 'Asymptote'!
+
+Tutorial
+
+* Drawing in batch mode:: Run 'Asymptote' on a text file
+* Drawing in interactive mode:: Running 'Asymptote' interactively
+* Figure size:: Specifying the figure size
+* Labels:: Adding 'LaTeX' labels
+* Paths:: Drawing lines and curves
+
+Drawing commands
+
+* draw:: Draw a path on a picture or frame
+* fill:: Fill a cyclic path on a picture or frame
+* clip:: Clip a picture or frame to a cyclic path
+* label:: Label a point on a picture
+
+Programming
+
+* Data types:: void, bool, int, real, pair, triple, string
+* Paths and guides:: Bezier curves
+* Pens:: Colors, line types, line widths, font sizes
+* Transforms:: Affine transforms
+* Frames and pictures:: Canvases for immediate and deferred drawing
+* Files:: Reading and writing your data
+* Variable initializers:: Initialize your variables
+* Structures:: Organize your data
+* Operators:: Arithmetic and logical operators
+* Implicit scaling:: Avoiding those ugly *s
+* Functions:: Traditional and high-order functions
+* Arrays:: Dynamic vectors
+* Casts:: Implicit and explicit casts
+* Import:: Importing external 'Asymptote' modules
+* Static:: Where to allocate your variable?
+
+Operators
+
+* Arithmetic & logical:: Basic mathematical operators
+* Self & prefix operators:: Increment and decrement
+* User-defined operators:: Overloading operators
+
+Functions
+
+* Default arguments:: Default values can appear anywhere
+* Named arguments:: Assigning function arguments by keyword
+* Rest arguments:: Functions with a variable number of arguments
+* Mathematical functions:: Standard libm functions
+
+Arrays
+
+* Slices:: Python-style array slices
+
+Base modules
+
+* plain:: Default 'Asymptote' base file
+* simplex:: Linear programming: simplex method
+* math:: Extend 'Asymptote''s math capabilities
+* interpolate:: Interpolation routines
+* geometry:: Geometry routines
+* trembling:: Wavy lines
+* stats:: Statistics routines and histograms
+* patterns:: Custom fill and draw patterns
+* markers:: Custom path marker routines
+* map:: Map keys to values
+* tree:: Dynamic binary search tree
+* binarytree:: Binary tree drawing module
+* drawtree:: Tree drawing module
+* syzygy:: Syzygy and braid drawing module
+* feynman:: Feynman diagrams
+* roundedpath:: Round the sharp corners of paths
+* animation:: Embedded PDF and MPEG movies
+* embed:: Embedding movies, sounds, and 3D objects
+* slide:: Making presentations with 'Asymptote'
+* MetaPost:: 'MetaPost' compatibility routines
+* babel:: Interface to 'LaTeX' 'babel' package
+* labelpath:: Drawing curved labels
+* labelpath3:: Drawing curved labels in 3D
+* annotate:: Annotate your PDF files
+* CAD:: 2D CAD pen and measurement functions (DIN 15)
+* graph:: 2D linear & logarithmic graphs
+* palette:: Color density images and palettes
+* three:: 3D vector graphics
+* obj:: 3D obj files
+* graph3:: 3D linear & logarithmic graphs
+* grid3:: 3D grids
+* solids:: 3D solid geometry
+* tube:: 3D rotation minimizing tubes
+* flowchart:: Flowchart drawing routines
+* contour:: Contour lines
+* contour3:: Contour surfaces
+* smoothcontour3:: Smooth implicit surfaces
+* slopefield:: Slope fields
+* ode:: Ordinary differential equations
+
+Graphical User Interface
+
+* GUI installation:: Installing 'xasy'
+* GUI usage:: Using 'xasy' to edit objects
+
+
+
+File: asymptote.info, Node: Description, Next: Installation, Prev: Top, Up: Top
+
+1 Description
+*************
+
+'Asymptote' is a powerful descriptive vector graphics language that
+provides a mathematical coordinate-based framework for technical
+drawing. Labels and equations are typeset with 'LaTeX', for overall
+document consistency, yielding the same high-quality level of
+typesetting that 'LaTeX' provides for scientific text. By default it
+produces 'PostScript' output, but it can also generate 'PDF', 'SVG',
+'WebGL', 'PRC', and any format that the 'ImageMagick' package can
+produce. You can even try it out in your Web browser without installing
+it, using the 'Asymptote Web Application':
+
+ <http://asymptote.ualberta.ca>
+
+ A major advantage of 'Asymptote' over other graphics packages is that
+it is a high-level programming language, as opposed to just a graphics
+program: it can therefore exploit the best features of the script
+(command-driven) and graphical-user-interface (GUI) methods for
+producing figures. The rudimentary GUI 'xasy' included with the package
+allows one to move script-generated objects around. To make 'Asymptote'
+accessible to the average user, this GUI is currently being developed
+into a full-fledged interface that can generate objects directly.
+However, the script portion of the language is now ready for general use
+by users who are willing to learn a few simple 'Asymptote' graphics
+commands (*note Drawing commands::).
+
+ 'Asymptote' is mathematically oriented (e.g. one can use complex
+multiplication to rotate a vector) and uses 'LaTeX' to do the
+typesetting of labels. This is an important feature for scientific
+applications. It was inspired by an earlier drawing program (with a
+weaker syntax and capabilities) called 'MetaPost'.
+
+ The 'Asymptote' vector graphics language provides:
+
+ * a standard for typesetting mathematical figures, just as
+ TeX/'LaTeX' is the de-facto standard for typesetting equations.
+
+ * 'LaTeX' typesetting of labels, for overall document consistency;
+
+ * the ability to generate and embed 3D vector WebGL graphics within
+ HTML files;
+
+ * the ability to generate and embed 3D vector PRC graphics within PDF
+ files;
+
+ * a natural coordinate-based framework for technical drawing,
+ inspired by 'MetaPost', with a much cleaner, powerful C++-like
+ programming syntax;
+
+ * compilation of figures into virtual machine code for speed, without
+ sacrificing portability;
+
+ * the power of a script-based language coupled to the convenience of
+ a GUI;
+
+ * customization using its own C++-like graphics programming language;
+
+ * sensible defaults for graphical features, with the ability to
+ override;
+
+ * a high-level mathematically oriented interface to the 'PostScript'
+ language for vector graphics, including affine transforms and
+ complex variables;
+
+ * functions that can create new (anonymous) functions;
+
+ * deferred drawing that uses the simplex method to solve overall size
+ constraint issues between fixed-sized objects (labels and
+ arrowheads) and objects that should scale with figure size;
+
+ Many of the features of 'Asymptote' are written in the 'Asymptote'
+language itself. While the stock version of 'Asymptote' is designed for
+mathematics typesetting needs, one can write 'Asymptote' modules that
+tailor it to specific applications; for example, a scientific graphing
+module is available (*note graph::). Examples of 'Asymptote' code and
+output, including animations, are available at
+ <https://asymptote.sourceforge.io/gallery/>
+Clicking on an example file name in this manual, like 'Pythagoras', will
+display the PDF output, whereas clicking on its '.asy' extension will
+show the corresponding 'Asymptote' code in a separate window.
+
+ Links to many external resources, including an excellent user-written
+'Asymptote' tutorial can be found at
+ <https://asymptote.sourceforge.io/links.html>
+ A quick reference card for 'Asymptote' is available at
+ <https://asymptote.sourceforge.io/asyRefCard.pdf>
+
+
+File: asymptote.info, Node: Installation, Next: Tutorial, Prev: Description, Up: Top
+
+2 Installation
+**************
+
+* Menu:
+
+* UNIX binary distributions:: Prebuilt 'UNIX' binaries
+* MacOS X binary distributions:: Prebuilt 'MacOS X' binaries
+* Microsoft Windows:: Prebuilt 'Microsoft Windows' binary
+* Configuring:: Configuring 'Asymptote' for your system
+* Search paths:: Where 'Asymptote' looks for your files
+* Compiling from UNIX source:: Building 'Asymptote' from scratch
+* Editing modes:: Convenient 'emacs' and 'vim' modes
+* Git:: Getting the latest development source
+* Uninstall:: Goodbye, 'Asymptote'!
+
+After following the instructions for your specific distribution, please
+see also *note Configuring::.
+
+We recommend subscribing to new release announcements at
+ <https://sourceforge.net/projects/asymptote>
+Users may also wish to monitor the 'Asymptote' forum:
+ <https://sourceforge.net/p/asymptote/discussion/409349>
+
+
+File: asymptote.info, Node: UNIX binary distributions, Next: MacOS X binary distributions, Prev: Installation, Up: Installation
+
+2.1 UNIX binary distributions
+=============================
+
+We release both 'tgz' and RPM binary distributions of 'Asymptote'. The
+root user can install the 'Linux x86_64' 'tgz' distribution of version
+'x.xx' of 'Asymptote' with the commands:
+tar -C / -zxf asymptote-x.xx.x86_64.tgz
+texhash
+The 'texhash' command, which installs LaTeX style files, is optional.
+The executable file will be '/usr/local/bin/asy') and example code will
+be installed by default in '/usr/local/share/doc/asymptote/examples'.
+
+Fedora users can easily install a recent version of 'Asymptote' with the
+command
+dnf --enablerepo=rawhide install asymptote
+
+To install the latest version of 'Asymptote' on a Debian-based
+distribution (e.g. Ubuntu, Mepis, Linspire) follow the instructions for
+compiling from 'UNIX' source (*note Compiling from UNIX source::).
+Alternatively, Debian users can install one of Hubert Chan's prebuilt
+'Asymptote' binaries from
+ <http://ftp.debian.org/debian/pool/main/a/asymptote>
+
+
+File: asymptote.info, Node: MacOS X binary distributions, Next: Microsoft Windows, Prev: UNIX binary distributions, Up: Installation
+
+2.2 MacOS X binary distributions
+================================
+
+'MacOS X' users can either compile the 'UNIX' source code (*note
+Compiling from UNIX source::) or install the 'Asymptote' binary
+available at
+
+ <https://www.macports.org/>
+
+Note that many 'MacOS X' (and FreeBSD) systems lack the GNU 'readline'
+library. For full interactive functionality, GNU 'readline' version 4.3
+or later must be installed.
+
+
+File: asymptote.info, Node: Microsoft Windows, Next: Configuring, Prev: MacOS X binary distributions, Up: Installation
+
+2.3 Microsoft Windows
+=====================
+
+Users of the 'Microsoft Windows' operating system can install the
+self-extracting 'Asymptote' executable 'asymptote-x.xx-setup.exe', where
+'x.xx' denotes the latest version.
+
+ A working TeX implementation (we recommend
+<https://www.tug.org/texlive> or <http://www.miktex.org>) will be
+required to typeset labels. You will also need to install 'GPL
+Ghostscript' version 9.52 or later from
+<http://downloads.ghostscript.com/public>.
+
+ To view 'PostScript' output, you can install the program 'gsview'
+available from <http://www.cs.wisc.edu/~ghost/gsview/>.
+
+ The 'ImageMagick' package from
+<https://www.imagemagick.org/script/binary-releases.php>
+
+is required to support output formats other than HTML, PDF, SVG, and PNG
+(*note convert::). The 'Python 3' interpreter from
+<https://www.python.org> is only required if you wish to try out the
+graphical user interface (*note GUI::).
+
+Example code will be installed by default in the 'examples' subdirectory
+of the installation directory (by default, 'C:\Program
+Files\Asymptote').
+
+
+File: asymptote.info, Node: Configuring, Next: Search paths, Prev: Microsoft Windows, Up: Installation
+
+2.4 Configuring
+===============
+
+In interactive mode, or when given the '-V' option (the default when
+running 'Asymptote' on a single file under 'MSDOS'), 'Asymptote' will
+automatically invoke the 'PostScript' viewer 'gv' (under 'UNIX') or
+'gsview' (under 'MSDOS' to display graphical output. The 'PostScript'
+viewer should be capable of automatically redrawing whenever the output
+file is updated. The default 'UNIX' 'PostScript' viewer 'gv' supports
+this (via a 'SIGHUP' signal). Version 'gv-3.6.3' or later (from
+<https://ftp.gnu.org/gnu/gv/>) is required for interactive mode to work
+properly. Users of 'ggv' will need to enable 'Watch file' under
+'Edit/PostScript Viewer Preferences'. Users of 'gsview' will need to
+enable 'Options/Auto Redisplay' (however, under 'MSDOS' it is still
+necessary to click on the 'gsview' window; under 'UNIX' one must
+manually redisplay by pressing the 'r' key).
+
+ Configuration variables are most easily set as 'Asymptote' variables
+in an optional configuration file 'config.asy' *note configuration
+file::). For example, the setting 'pdfviewer' specifies the location of
+the PDF viewer. Here are the default values of several important
+configuration variables under 'UNIX':
+
+import settings;
+pdfviewer="acroread";
+htmlviewer="google-chrome";
+psviewer="gv";
+display="display";
+animate="animate";
+gs="gs";
+libgs="";
+
+Under 'MSDOS', the viewer settings 'htmlviewer', 'pdfviewer',
+'psviewer', 'display', and 'animate' default to the string 'cmd',
+requesting the application normally associated with each file type. The
+(installation-dependent) default values of 'gs' and 'libgs' are
+determined automatically from the 'Microsoft Windows' registry. The
+'gs' setting specifies the location of the 'PostScript' processor
+'Ghostscript', available from <https://www.ghostscript.com/>.
+
+The configuration variable 'htmlviewer' specifies the browser to use to
+display 3D 'WebGL' output. The default setting is 'google-chrome' under
+'UNIX' and 'cmd' under 'Microsoft Windows'. Note that 'Internet
+Explorer' does not support 'WebGL'; 'Microsoft Windows' users should set
+their default html browser to 'chrome' or 'microsoft-edge'. By default,
+2D and 3D 'HTML' images expand to the enclosing canvas; this can be
+disabled by setting the configuation variable 'absolute' to 'true'.
+
+ On 'UNIX' systems, to support automatic document reloading of 'PDF'
+files in 'Adobe Reader', we recommend copying the file 'reload.js' from
+the 'Asymptote' system directory (by default,
+'/usr/local/share/asymptote' under 'UNIX' to
+'~/.adobe/Acrobat/x.x/JavaScripts/', where 'x.x' represents the
+appropriate 'Adobe Reader' version number. The automatic document
+reload feature must then be explicitly enabled by putting
+import settings;
+pdfreload=true;
+pdfreloadOptions="-tempFile";
+in the 'Asymptote' configuration file. This reload feature is not
+useful under 'MSDOS' since the document cannot be updated anyway on that
+operating system until it is first closed by 'Adobe Reader'.
+
+ The configuration variable 'dir' can be used to adjust the search
+path (*note Search paths::).
+
+ By default, 'Asymptote' attempts to center the figure on the page,
+assuming that the paper type is 'letter'. The default paper type may be
+changed to 'a4' with the configuration variable 'papertype'. Alignment
+to other paper sizes can be obtained by setting the configuration
+variables 'paperwidth' and 'paperheight'.
+
+ These additional configuration variables normally do not require
+adjustment:
+config
+texpath
+texcommand
+dvips
+dvisvgm
+convert
+asygl
+
+ Warnings (such as "unbounded" and "offaxis") may be enabled or
+disabled with the functions
+warn(string s);
+nowarn(string s);
+or by directly modifying the string array 'settings.suppress', which
+lists all disabled warnings.
+
+ Configuration variables may also be set or overwritten with a
+command-line option:
+asy -psviewer=gsview -V venn
+
+ Alternatively, system environment versions of the above configuration
+variables may be set in the conventional way. The corresponding
+environment variable name is obtained by converting the configuration
+variable name to upper case and prepending 'ASYMPTOTE_': for example, to
+set the environment variable
+ASYMPTOTE_PSVIEWER="C:\Program Files\Ghostgum\gsview\gsview32.exe";
+under 'Microsoft Windows XP':
+ 1. Click on the 'Start' button;
+ 2. Right-click on 'My Computer';
+ 3. Choose 'View system information';
+ 4. Click the 'Advanced' tab;
+ 5. Click the 'Environment Variables' button.
+
+
+File: asymptote.info, Node: Search paths, Next: Compiling from UNIX source, Prev: Configuring, Up: Installation
+
+2.5 Search paths
+================
+
+In looking for 'Asymptote' files, 'asy' will search the following paths,
+in the order listed:
+ 1. The current directory;
+ 2. A list of one or more directories specified by the configuration
+ variable 'dir' or environment variable 'ASYMPTOTE_DIR' (separated
+ by ':' under UNIX and ';' under 'MSDOS');
+ 3. The directory specified by the environment variable
+ 'ASYMPTOTE_HOME'; if this variable is not set, the directory '.asy'
+ in the user's home directory ('%USERPROFILE%\.asy' under 'MSDOS')
+ is used;
+ 4. The 'Asymptote' system directory (by default,
+ '/usr/local/share/asymptote' under 'UNIX' and 'C:\Program
+ Files\Asymptote' under 'MSDOS').
+ 5. The 'Asymptote' examples directory (by default,
+ '/usr/local/share/doc/asymptote/examples' under 'UNIX' and
+ 'C:\Program Files\Asymptote\examples' under 'MSDOS').
+
+
+File: asymptote.info, Node: Compiling from UNIX source, Next: Editing modes, Prev: Search paths, Up: Installation
+
+2.6 Compiling from UNIX source
+==============================
+
+To compile and install a 'UNIX' executable from the source release
+'asymptote-x.xx.src.tgz' in the subdirectory 'x.xx' under
+
+ <https://sourceforge.net/projects/asymptote/files/>
+
+ execute the commands:
+gunzip asymptote-x.xx.src.tgz
+tar -xf asymptote-x.xx.src.tar
+cd asymptote-x.xx
+ By default the system version of the Boehm garbage collector will be
+used; if it is old we recommend first putting
+<https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4.tar.gz>
+<https://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-7.6.10.tar.gz>
+in the 'Asymptote' source directory.
+
+ On 'UNIX' platforms (other than 'MacOS X'), we recommend using
+version '3.2.1' of the 'freeglut' library. To compile 'freeglut',
+download
+ <https://prdownloads.sourceforge.net/freeglut/freeglut-3.2.1.tar.gz>
+and type (as the root user):
+gunzip freeglut-3.2.1.tar.gz
+tar -xf freeglut-3.2.1.tar
+cd freeglut-3.2.1
+cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_FLAGS=-fcommon .
+make
+make install
+
+ Then compile 'Asymptote' with the commands
+./configure
+make all
+make install
+Be sure to use GNU 'make' (on non-GNU systems this command may be called
+'gmake'). To build the documentation, you may need to install the
+'texinfo-tex' package. If you get errors from a broken 'texinfo' or
+'pdftex' installation, simply put
+ <https://asymptote.sourceforge.io/asymptote.pdf>
+in the directory 'doc' and repeat the command 'make all'.
+
+For a (default) system-wide installation, the last command should be
+done as the root user. To install without root privileges, change the
+'./configure' command to
+./configure --prefix=$HOME/asymptote
+ One can disable use of the Boehm garbage collector by configuring
+with './configure --disable-gc'. For a list of other configuration
+options, say './configure --help'. For example, under 'MacOS X', one
+can tell configure to use the 'clang' compilers and look for header
+files and libraries in nonstandard locations:
+./configure CC=clang CXX=clang++ CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib
+
+ If you are compiling 'Asymptote' with 'gcc', you will need a
+relatively recent version (e.g. 3.4.4 or later). For full interactive
+functionality, you will need version 4.3 or later of the GNU 'readline'
+library. The file 'gcc3.3.2curses.patch' in the 'patches' directory can
+be used to patch the broken curses.h header file (or a local copy
+thereof in the current directory) on some 'AIX' and 'IRIX' systems.
+
+ The 'FFTW' library is only required if you want 'Asymptote' to be
+able to take Fourier transforms of data (say, to compute an audio power
+spectrum). The 'GSL' library is only required if you require the
+special functions that it supports.
+
+ If you don't want to install 'Asymptote' system wide, just make sure
+the compiled binary 'asy' and GUI script 'xasy' are in your path and set
+the configuration variable 'dir' to point to the directory 'base' (in
+the top level directory of the 'Asymptote' source code).
+
+
+File: asymptote.info, Node: Editing modes, Next: Git, Prev: Compiling from UNIX source, Up: Installation
+
+2.7 Editing modes
+=================
+
+Users of 'emacs' can edit 'Asymptote' code with the mode 'asy-mode',
+after enabling it by putting the following lines in their '.emacs'
+initialization file, replacing 'ASYDIR' with the location of the
+'Asymptote' system directory (by default, '/usr/local/share/asymptote'
+or 'C:\Program Files\Asymptote' under 'MSDOS'):
+(add-to-list 'load-path "ASYDIR")
+(autoload 'asy-mode "asy-mode.el" "Asymptote major mode." t)
+(autoload 'lasy-mode "asy-mode.el" "hybrid Asymptote/Latex major mode." t)
+(autoload 'asy-insinuate-latex "asy-mode.el" "Asymptote insinuate LaTeX." t)
+(add-to-list 'auto-mode-alist '("\\.asy$" . asy-mode))
+
+Particularly useful key bindings in this mode are 'C-c C-c', which
+compiles and displays the current buffer, and the key binding 'C-c ?',
+which shows the available function prototypes for the command at the
+cursor. For full functionality you should also install the Apache
+Software Foundation package 'two-mode-mode':
+ <https://www.dedasys.com/freesoftware/files/two-mode-mode.el>
+Once installed, you can use the hybrid mode 'lasy-mode' to edit a LaTeX
+file containing embedded 'Asymptote' code (*note LaTeX usage::). This
+mode can be enabled within 'latex-mode' with the key sequence 'M-x
+lasy-mode <RET>'. On 'UNIX' systems, additional keywords will be
+generated from all 'asy' files in the space-separated list of
+directories specified by the environment variable 'ASYMPTOTE_SITEDIR'.
+Further documentation of 'asy-mode' is available within 'emacs' by
+pressing the sequence keys 'C-h f asy-mode <RET>'.
+
+ Fans of 'vim' can customize 'vim' for 'Asymptote' with
+
+'cp /usr/local/share/asymptote/asy.vim ~/.vim/syntax/asy.vim'
+
+and add the following to their '~/.vimrc' file:
+augroup filetypedetect
+au BufNewFile,BufRead *.asy setf asy
+augroup END
+filetype plugin on
+
+ If any of these directories or files don't exist, just create them.
+To set 'vim' up to run the current asymptote script using ':make' just
+add to '~/.vim/ftplugin/asy.vim':
+setlocal makeprg=asy\ %
+setlocal errorformat=%f:\ %l.%c:\ %m
+
+ Syntax highlighting support for the KDE editor 'Kate' can be enabled
+by running 'asy-kate.sh' in the '/usr/local/share/asymptote' directory
+and putting the generated 'asymptote.xml' file in
+'~/.kde/share/apps/katepart/syntax/'.
+
+
+File: asymptote.info, Node: Git, Next: Uninstall, Prev: Editing modes, Up: Installation
+
+2.8 Git
+=======
+
+The following commands are needed to install the latest development
+version of 'Asymptote' using 'git':
+git clone https://github.com/vectorgraphics/asymptote
+
+cd asymptote
+./autogen.sh
+./configure
+make all
+make install
+
+To compile without optimization, use the command 'make CFLAGS=-g'. On
+'Ubuntu' systems, you may need to first install the required
+dependencies:
+apt-get build-dep asymptote
+
+
+File: asymptote.info, Node: Uninstall, Prev: Git, Up: Installation
+
+2.9 Uninstall
+=============
+
+To uninstall a 'Linux x86_64' binary distribution, use the commands
+tar -zxvf asymptote-x.xx.x86_64.tgz | xargs --replace=% rm /%
+texhash
+
+To uninstall all 'Asymptote' files installed from a source distribution,
+use the command
+make uninstall
+
+
+File: asymptote.info, Node: Tutorial, Next: Drawing commands, Prev: Installation, Up: Top
+
+3 Tutorial
+**********
+
+* Menu:
+
+* Drawing in batch mode:: Run 'Asymptote' on a text file
+* Drawing in interactive mode:: Running 'Asymptote' interactively
+* Figure size:: Specifying the figure size
+* Labels:: Adding 'LaTeX' labels
+* Paths:: Drawing lines and curves
+
+A concise introduction to 'Asymptote' is given here. For a more
+thorough introduction, see the excellent 'Asymptote' tutorial written by
+Charles Staats:
+
+ <https://asymptote.sourceforge.io/asymptote_tutorial.pdf>
+
+ Another 'Asymptote' tutorial is available as a wiki, with images
+rendered by an online Asymptote engine:
+
+ <https://www.artofproblemsolving.com/wiki/?title=Asymptote_(Vector_Graphics_Language)>
+
+
+File: asymptote.info, Node: Drawing in batch mode, Next: Drawing in interactive mode, Prev: Tutorial, Up: Tutorial
+
+3.1 Drawing in batch mode
+=========================
+
+To draw a line from coordinate (0,0) to coordinate (100,100), create a
+text file 'test.asy' containing
+draw((0,0)--(100,100));
+
+Then execute the command
+asy -V test
+Alternatively, 'MSDOS' users can drag and drop 'test.asy' onto the
+Desktop 'asy' icon (or make 'Asymptote' the default application for the
+extension 'asy').
+
+This method, known as _batch mode_, outputs a 'PostScript' file
+'test.eps'. If you prefer PDF output, use the command line
+asy -V -f pdf test
+ In either case, the '-V' option opens up a viewer window so you can
+immediately view the result:
+
+ [./diagonal]
+Here, the '--' connector joins the two points '(0,0)' and '(100,100)'
+with a line segment.
+
+
+File: asymptote.info, Node: Drawing in interactive mode, Next: Figure size, Prev: Drawing in batch mode, Up: Tutorial
+
+3.2 Drawing in interactive mode
+===============================
+
+Another method is _interactive mode_, where 'Asymptote' reads individual
+commands as they are entered by the user. To try this out, enter
+'Asymptote''s interactive mode by clicking on the 'Asymptote' icon or
+typing the command 'asy'. Then type
+draw((0,0)--(100,100));
+followed by 'Enter', to obtain the above image. At this point you can
+type further 'draw' commands, which will be added to the displayed
+figure, 'erase' to clear the canvas,
+input test;
+to execute all of the commands contained in the file 'test.asy', or
+'quit' to exit interactive mode. You can use the arrow keys in
+interactive mode to edit previous lines. The tab key will automatically
+complete unambiguous words; otherwise, hitting tab again will show the
+possible choices. Further commands specific to interactive mode are
+described in *note Interactive mode::.
+
+
+File: asymptote.info, Node: Figure size, Next: Labels, Prev: Drawing in interactive mode, Up: Tutorial
+
+3.3 Figure size
+===============
+
+In 'Asymptote', coordinates like '(0,0)' and '(100,100)', called
+_pairs_, are expressed in 'PostScript' "big points" (1 'bp' = 1/72
+'inch') and the default line width is '0.5bp'. However, it is often
+inconvenient to work directly in 'PostScript' coordinates. The next
+example produces identical output to the previous example, by scaling
+the line '(0,0)--(1,1)' to fit a rectangle of width '100.5 bp' and
+height '100.5 bp' (the extra '0.5bp' accounts for the line width):
+size(100.5,100.5);
+draw((0,0)--(1,1));
+
+ [./diagonal]
+
+ One can also specify the size in 'pt' (1 'pt' = 1/72.27 'inch'),
+'cm', 'mm', or 'inches'. Two nonzero size arguments (or a single size
+argument) restrict the size in both directions, preserving the aspect
+ratio. If 0 is given as a size argument, no restriction is made in that
+direction; the overall scaling will be determined by the other direction
+(*note size::):
+size(0,100.5);
+draw((0,0)--(2,1),Arrow);
+
+ [./bigdiagonal]
+
+ To connect several points and create a cyclic path, use the 'cycle'
+keyword:
+size(3cm);
+draw((0,0)--(1,0)--(1,1)--(0,1)--cycle);
+
+ [./square]
+For convenience, the path '(0,0)--(1,0)--(1,1)--(0,1)--cycle' may be
+replaced with the predefined variable 'unitsquare', or equivalently,
+'box((0,0),(1,1))'.
+
+ To make the user coordinates represent multiples of exactly '1cm':
+unitsize(1cm);
+draw(unitsquare);
+
+
+File: asymptote.info, Node: Labels, Next: Paths, Prev: Figure size, Up: Tutorial
+
+3.4 Labels
+==========
+
+Adding labels is easy in 'Asymptote'; one specifies the label as a
+double-quoted 'LaTeX' string, a coordinate, and an optional alignment
+direction:
+size(3cm);
+draw(unitsquare);
+label("$A$",(0,0),SW);
+label("$B$",(1,0),SE);
+label("$C$",(1,1),NE);
+label("$D$",(0,1),NW);
+
+ [./labelsquare]
+
+ 'Asymptote' uses the standard compass directions 'E=(1,0)',
+'N=(0,1)', 'NE=unit(N+E)', and 'ENE=unit(E+NE)', etc., which along with
+the directions 'up', 'down', 'right', and 'left' are defined as pairs in
+the 'Asymptote' base module 'plain' (a user who has a local variable
+named 'E' may access the compass direction 'E' by prefixing it with the
+name of the module where it is defined: 'plain.E').
+
+
+File: asymptote.info, Node: Paths, Prev: Labels, Up: Tutorial
+
+3.5 Paths
+=========
+
+This example draws a path that approximates a quarter circle, terminated
+with an arrowhead:
+size(100,0);
+draw((1,0){up}..{left}(0,1),Arrow);
+
+ [./quartercircle]
+Here the directions 'up' and 'left' in braces specify the outgoing and
+incoming directions at the points '(1,0)' and '(0,1)', respectively.
+
+ In general, a path is specified as a list of points (or other paths)
+interconnected with '--', which denotes a straight line segment, or
+'..', which denotes a cubic spline (*note Bezier curves::). Specifying
+a final '..cycle' creates a cyclic path that connects smoothly back to
+the initial node, as in this approximation (accurate to within 0.06%) of
+a unit circle:
+path unitcircle=E..N..W..S..cycle;
+
+An 'Asymptote' path, being connected, is equivalent to a 'PostScript
+subpath'. The '^^' binary operator, which requests that the pen be
+moved (without drawing or affecting endpoint curvatures) from the final
+point of the left-hand path to the initial point of the right-hand path,
+may be used to group several 'Asymptote' paths into a 'path[]' array
+(equivalent to a 'PostScript' path):
+size(0,100);
+path unitcircle=E..N..W..S..cycle;
+path g=scale(2)*unitcircle;
+filldraw(unitcircle^^g,evenodd+yellow,black);
+
+
+ [./superpath]
+
+The 'PostScript' even-odd fill rule here specifies that only the region
+bounded between the two unit circles is filled (*note fillrule::). In
+this example, the same effect can be achieved by using the default zero
+winding number fill rule, if one is careful to alternate the orientation
+of the paths:
+filldraw(unitcircle^^reverse(g),yellow,black);
+
+ The '^^' operator is used by the 'box(triple, triple)' function in
+the module 'three' to construct the edges of a cube 'unitbox' without
+retracing steps (*note three::):
+import three;
+
+currentprojection=orthographic(5,4,2,center=true);
+
+size(5cm);
+size3(3cm,5cm,8cm);
+
+draw(unitbox);
+
+dot(unitbox,red);
+
+label("$O$",(0,0,0),NW);
+label("(1,0,0)",(1,0,0),S);
+label("(0,1,0)",(0,1,0),E);
+label("(0,0,1)",(0,0,1),Z);
+
+ [./cube]
+
+ See section *note graph:: (or the online 'Asymptote' gallery and
+external links posted at <https://asymptote.sourceforge.io>) for further
+examples, including two-dimensional and interactive three-dimensional
+scientific graphs. Additional examples have been posted by Philippe
+Ivaldi at <http://www.piprime.fr/asymptote>.
+
+
+File: asymptote.info, Node: Drawing commands, Next: Bezier curves, Prev: Tutorial, Up: Top
+
+4 Drawing commands
+******************
+
+All of 'Asymptote''s graphical capabilities are based on four primitive
+commands. The three 'PostScript' drawing commands 'draw', 'fill', and
+'clip' add objects to a picture in the order in which they are executed,
+with the most recently drawn object appearing on top. The labeling
+command 'label' can be used to add text labels and external EPS images,
+which will appear on top of the 'PostScript' objects (since this is
+normally what one wants), but again in the relative order in which they
+were executed. After drawing objects on a picture, the picture can be
+output with the 'shipout' function (*note shipout::).
+
+ If you wish to draw 'PostScript' objects on top of labels (or
+verbatim 'tex' commands; *note tex::), the 'layer' command may be used
+to start a new 'PostScript/LaTeX' layer:
+void layer(picture pic=currentpicture);
+
+ The 'layer' function gives one full control over the order in which
+objects are drawn. Layers are drawn sequentially, with the most recent
+layer appearing on top. Within each layer, labels, images, and verbatim
+'tex' commands are always drawn after the 'PostScript' objects in that
+layer.
+
+ A page break can be generated with the command
+void newpage(picture pic=currentpicture);
+
+ While some of these drawing commands take many options, they all have
+sensible default values (for example, the picture argument defaults to
+currentpicture).
+
+* Menu:
+
+* draw:: Draw a path on a picture or frame
+* fill:: Fill a cyclic path on a picture or frame
+* clip:: Clip a picture or frame to a cyclic path
+* label:: Label a point on a picture
+
+
+File: asymptote.info, Node: draw, Next: fill, Prev: Drawing commands, Up: Drawing commands
+
+4.1 draw
+========
+
+void draw(picture pic=currentpicture, Label L="", path g,
+ align align=NoAlign, pen p=currentpen,
+ arrowbar arrow=None, arrowbar bar=None, margin margin=NoMargin,
+ Label legend="", marker marker=nomarker);
+
+ Draw the path 'g' on the picture 'pic' using pen 'p' for drawing,
+with optional drawing attributes (Label 'L', explicit label alignment
+'align', arrows and bars 'arrow' and 'bar', margins 'margin', legend,
+and markers 'marker'). Only one parameter, the path, is required. For
+convenience, the arguments 'arrow' and 'bar' may be specified in either
+order. The argument 'legend' is a Label to use in constructing an
+optional legend entry.
+
+ Bars are useful for indicating dimensions. The possible values of
+'bar' are 'None', 'BeginBar', 'EndBar' (or equivalently 'Bar'), and
+'Bars' (which draws a bar at both ends of the path). Each of these bar
+specifiers (except for 'None') will accept an optional real argument
+that denotes the length of the bar in 'PostScript' coordinates. The
+default bar length is 'barsize(pen)'.
+
+ The possible values of 'arrow' are 'None', 'Blank' (which draws no
+arrows or path), 'BeginArrow', 'MidArrow', 'EndArrow' (or equivalently
+'Arrow'), and 'Arrows' (which draws an arrow at both ends of the path).
+All of the arrow specifiers except for 'None' and 'Blank' may be given
+the optional arguments arrowhead 'arrowhead' (one of the predefined
+arrowhead styles 'DefaultHead', 'SimpleHead', 'HookHead', 'TeXHead'),
+real 'size' (arrowhead size in 'PostScript' coordinates), real 'angle'
+(arrowhead angle in degrees), filltype 'filltype' (one of 'FillDraw',
+'Fill', 'NoFill', 'UnFill', 'Draw') and (except for 'MidArrow' and
+'Arrows') a real 'position' (in the sense of 'point(path p, real t)')
+along the path where the tip of the arrow should be placed. The default
+arrowhead size when drawn with a pen 'p' is 'arrowsize(p)'. There are
+also arrow versions with slightly modified default values of 'size' and
+'angle' suitable for curved arrows: 'BeginArcArrow', 'EndArcArrow' (or
+equivalently 'ArcArrow'), 'MidArcArrow', and 'ArcArrows'.
+
+ Margins can be used to shrink the visible portion of a path by
+'labelmargin(p)' to avoid overlap with other drawn objects. Typical
+values of 'margin' are 'NoMargin', 'BeginMargin', 'EndMargin' (or
+equivalently 'Margin'), and 'Margins' (which leaves a margin at both
+ends of the path). One may use 'Margin(real begin, real end=begin)' to
+specify the size of the beginning and ending margin, respectively, in
+multiples of the units 'labelmargin(p)' used for aligning labels.
+Alternatively, 'BeginPenMargin', 'EndPenMargin' (or equivalently
+'PenMargin'), 'PenMargins', 'PenMargin(real begin, real end=begin)'
+specify a margin in units of the pen line width, taking account of the
+pen line width when drawing the path or arrow. For example, use
+'DotMargin', an abbreviation for
+'PenMargin(-0.5*dotfactor,0.5*dotfactor)', to draw from the usual
+beginning point just up to the boundary of an end dot of width
+'dotfactor*linewidth(p)'. The qualifiers 'BeginDotMargin',
+'EndDotMargin', and 'DotMargins' work similarly. The qualifier
+'TrueMargin(real begin, real end=begin)' allows one to specify a margin
+directly in 'PostScript' units, independent of the pen line width.
+
+ The use of arrows, bars, and margins is illustrated by the examples
+'Pythagoras.asy' and 'sqrtx01.asy'.
+
+ The legend for a picture 'pic' can be fit and aligned to a frame with
+the routine:
+frame legend(picture pic=currentpicture, int perline=1,
+ real xmargin=legendmargin, real ymargin=xmargin,
+ real linelength=legendlinelength,
+ real hskip=legendhskip, real vskip=legendvskip,
+ real maxwidth=0, real maxheight=0,
+ bool hstretch=false, bool vstretch=false, pen p=currentpen);
+Here 'xmargin' and 'ymargin' specify the surrounding x and y margins,
+'perline' specifies the number of entries per line (default 1; 0 means
+choose this number automatically), 'linelength' specifies the length of
+the path lines, 'hskip' and 'vskip' specify the line skip (as a multiple
+of the legend entry size), 'maxwidth' and 'maxheight' specify optional
+upper limits on the width and height of the resulting legend (0 means
+unlimited), 'hstretch' and 'vstretch' allow the legend to stretch
+horizontally or vertically, and 'p' specifies the pen used to draw the
+bounding box. The legend frame can then be added and aligned about a
+point on a picture 'dest' using 'add' or 'attach' (*note add about::).
+
+ To draw a dot, simply draw a path containing a single point. The
+'dot' command defined in the module 'plain' draws a dot having a
+diameter equal to an explicit pen line width or the default line width
+magnified by 'dotfactor' (6 by default), using the specified filltype
+(*note filltype::) or 'dotfilltype' ('Fill' by default):
+void dot(frame f, pair z, pen p=currentpen, filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, pair z, pen p=currentpen,
+ filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, Label L, pair z, align align=NoAlign,
+ string format=defaultformat, pen p=currentpen, filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, Label[] L=new Label[], pair[] z,
+ align align=NoAlign, string format=defaultformat, pen p=currentpen,
+ filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, path[] g, pen p=currentpen,
+ filltype filltype=dotfilltype);
+void dot(picture pic=currentpicture, Label L, pen p=currentpen,
+ filltype filltype=dotfilltype);
+
+ If the variable 'Label' is given as the 'Label' argument to the third
+routine, the 'format' argument will be used to format a string based on
+the dot location (here 'defaultformat' is '"$%.4g$"'). The fourth
+routine draws a dot at every point of a pair array 'z'. One can also
+draw a dot at every node of a path:
+void dot(picture pic=currentpicture, Label[] L=new Label[],
+ explicit path g, align align=RightSide, string format=defaultformat,
+ pen p=currentpen, filltype filltype=dotfilltype);
+ See *note pathmarkers:: and *note markers:: for more general methods
+for marking path nodes.
+
+ To draw a fixed-sized object (in 'PostScript' coordinates) about the
+user coordinate 'origin', use the routine
+void draw(pair origin, picture pic=currentpicture, Label L="", path g,
+ align align=NoAlign, pen p=currentpen, arrowbar arrow=None,
+ arrowbar bar=None, margin margin=NoMargin, Label legend="",
+ marker marker=nomarker);
+
+
+File: asymptote.info, Node: fill, Next: clip, Prev: draw, Up: Drawing commands
+
+4.2 fill
+========
+
+void fill(picture pic=currentpicture, path g, pen p=currentpen);
+
+ Fill the interior region bounded by the cyclic path 'g' on the
+picture 'pic', using the pen 'p'.
+
+ There is also a convenient 'filldraw' command, which fills the path
+and then draws in the boundary. One can specify separate pens for each
+operation:
+void filldraw(picture pic=currentpicture, path g, pen fillpen=currentpen,
+ pen drawpen=currentpen);
+
+ This fixed-size version of 'fill' allows one to fill an object
+described in 'PostScript' coordinates about the user coordinate
+'origin':
+void fill(pair origin, picture pic=currentpicture, path g, pen p=currentpen);
+
+This is just a convenient abbreviation for the commands:
+picture opic;
+fill(opic,g,p);
+add(pic,opic,origin);
+
+ The routine
+void filloutside(picture pic=currentpicture, path g, pen p=currentpen);
+fills the region exterior to the path 'g', out to the current boundary
+of picture 'pic'.
+
+ Lattice gradient shading varying smoothly over a two-dimensional
+array of pens 'p', using fill rule 'fillrule', can be produced with
+void latticeshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen fillrule=currentpen, pen[][] p)
+ If 'stroke=true', the region filled is the same as the region that
+would be drawn by 'draw(pic,g,zerowinding)'; in this case the path 'g'
+need not be cyclic. The pens in 'p' must belong to the same color
+space. One can use the functions 'rgb(pen)' or 'cmyk(pen)' to promote
+pens to a higher color space, as illustrated in the example file
+'latticeshading.asy'.
+
+ Axial gradient shading varying smoothly from 'pena' to 'penb' in the
+direction of the line segment 'a--b' can be achieved with
+void axialshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen pena, pair a, bool extenda=true,
+ pen penb, pair b, bool extendb=true);
+The boolean parameters 'extenda' and 'extendb' indicate whether the
+shading should extend beyond the axis endpoints 'a' and 'b'. An example
+of axial shading is provided in the example file 'axialshade.asy'.
+
+ Radial gradient shading varying smoothly from 'pena' on the circle
+with center 'a' and radius 'ra' to 'penb' on the circle with center 'b'
+and radius 'rb' is similar:
+void radialshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen pena, pair a, real ra, bool extenda=true,
+ pen penb, pair b, real rb, bool extendb=true);
+The boolean parameters 'extenda' and 'extendb' indicate whether the
+shading should extend beyond the radii 'a' and 'b'. Illustrations of
+radial shading are provided in the example files 'shade.asy',
+'ring.asy', and 'shadestroke.asy'.
+
+ Gouraud shading using fill rule 'fillrule' and the vertex colors in
+the pen array 'p' on a triangular lattice defined by the vertices 'z'
+and edge flags 'edges' is implemented with
+void gouraudshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen fillrule=currentpen, pen[] p, pair[] z,
+ int[] edges);
+void gouraudshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen fillrule=currentpen, pen[] p, int[] edges);
+In the second form, the elements of 'z' are taken to be successive nodes
+of path 'g'. The pens in 'p' must belong to the same color space.
+Illustrations of Gouraud shading are provided in the example file
+'Gouraud.asy'. The edge flags used in Gouraud shading are documented
+here:
+ <https://www.adobe.com/content/dam/acom/en/devnet/postscript/pdfs/TN5600.SmoothShading.pdf>
+
+ Tensor product shading using clipping path 'g', fill rule 'fillrule'
+on patches bounded by the n cyclic paths of length 4 in path array 'b',
+using the vertex colors specified in the n \times 4 pen array 'p' and
+internal control points in the n \times 4 array 'z', is implemented with
+void tensorshade(picture pic=currentpicture, path[] g, bool stroke=false,
+ pen fillrule=currentpen, pen[][] p, path[] b=g,
+ pair[][] z=new pair[][]);
+If the array 'z' is empty, Coons shading, in which the color control
+points are calculated automatically, is used. The pens in 'p' must
+belong to the same color space. A simpler interface for the case of a
+single patch (n=1) is also available:
+void tensorshade(picture pic=currentpicture, path g, bool stroke=false,
+ pen fillrule=currentpen, pen[] p, path b=g,
+ pair[] z=new pair[]);
+ One can also smoothly shade the regions between consecutive paths of
+a sequence using a given array of pens:
+void draw(picture pic=currentpicture, pen fillrule=currentpen, path[] g,
+ pen[] p);
+Illustrations of tensor product and Coons shading are provided in the
+example files 'tensor.asy', 'Coons.asy', 'BezierPatch.asy', and
+'rainbow.asy'.
+
+ More general shading possibilities are available using TeX engines
+that produce PDF output (*note texengines::): the routine
+void functionshade(picture pic=currentpicture, path[] g, bool stroke=false,
+ pen fillrule=currentpen, string shader);
+shades on picture 'pic' the interior of path 'g' according to fill rule
+'fillrule' using the 'PostScript' calculator routine specified by the
+string 'shader'; this routine takes 2 arguments, each in [0,1], and
+returns 'colors(fillrule).length' color components. Function shading is
+illustrated in the example 'functionshading.asy'.
+
+ The following routine uses 'evenodd' clipping together with the '^^'
+operator to unfill a region:
+
+void unfill(picture pic=currentpicture, path g);
+
+
+File: asymptote.info, Node: clip, Next: label, Prev: fill, Up: Drawing commands
+
+4.3 clip
+========
+
+void clip(picture pic=currentpicture, path g, stroke=false,
+ pen fillrule=currentpen);
+
+ Clip the current contents of picture 'pic' to the region bounded by
+the path 'g', using fill rule 'fillrule' (*note fillrule::). If
+'stroke=true', the clipped portion is the same as the region that would
+be drawn with 'draw(pic,g,zerowinding)'; in this case the path 'g' need
+not be cyclic. While clipping has no notion of depth (it transcends
+layers and even pages), one can localize clipping to a temporary
+picture, which can then be added to 'pic'. For an illustration of
+picture clipping, see the first example in *note LaTeX usage::.
+
+
+File: asymptote.info, Node: label, Prev: clip, Up: Drawing commands
+
+4.4 label
+=========
+
+void label(picture pic=currentpicture, Label L, pair position,
+ align align=NoAlign, pen p=currentpen, filltype filltype=NoFill)
+
+ Draw Label 'L' on picture 'pic' using pen 'p'. If 'align' is
+'NoAlign', the label will be centered at user coordinate 'position';
+otherwise it will be aligned in the direction of 'align' and displaced
+from 'position' by the 'PostScript' offset 'align*labelmargin(p)'. The
+constant 'Align' can be used to align the bottom-left corner of the
+label at 'position'. The Label 'L' can either be a string or the
+structure obtained by calling one of the functions
+Label Label(string s="", pair position, align align=NoAlign,
+ pen p=nullpen, embed embed=Rotate, filltype filltype=NoFill);
+Label Label(string s="", align align=NoAlign,
+ pen p=nullpen, embed embed=Rotate, filltype filltype=NoFill);
+Label Label(Label L, pair position, align align=NoAlign,
+ pen p=nullpen, embed embed=L.embed, filltype filltype=NoFill);
+Label Label(Label L, align align=NoAlign,
+ pen p=nullpen, embed embed=L.embed, filltype filltype=NoFill);
+ The text of a Label can be scaled, slanted, rotated, or shifted by
+multiplying it on the left by an affine transform (*note Transforms::).
+For example, 'rotate(45)*xscale(2)*L' first scales 'L' in the x
+direction and then rotates it counterclockwise by 45 degrees. The final
+position of a Label can also be shifted by a 'PostScript' coordinate
+translation: 'shift(10,0)*L'. An explicit pen specified within the
+Label overrides other pen arguments. The 'embed' argument determines
+how the Label should transform with the embedding picture:
+'Shift'
+ only shift with embedding picture;
+
+'Rotate'
+ only shift and rotate with embedding picture (default);
+
+'Rotate(pair z)'
+ rotate with (picture-transformed) vector 'z'.
+
+'Slant'
+ only shift, rotate, slant, and reflect with embedding picture;
+
+'Scale'
+ shift, rotate, slant, reflect, and scale with embedding picture.
+
+ To add a label to a path, use
+void label(picture pic=currentpicture, Label L, path g, align align=NoAlign,
+ pen p=currentpen, filltype filltype=NoFill);
+ By default the label will be positioned at the midpoint of the path.
+An alternative label position (in the sense of 'point(path p, real t)')
+may be specified as a real value for 'position' in constructing the
+Label. The position 'Relative(real)' specifies a location relative to
+the total arclength of the path. These convenient abbreviations are
+predefined:
+position BeginPoint=Relative(0);
+position MidPoint=Relative(0.5);
+position EndPoint=Relative(1);
+
+ Path labels are aligned in the direction 'align', which may be
+specified as an absolute compass direction (pair) or a direction
+'Relative(pair)' measured relative to a north axis in the local
+direction of the path. For convenience 'LeftSide', 'Center', and
+'RightSide' are defined as 'Relative(W)', 'Relative((0,0))', and
+'Relative(E)', respectively. Multiplying 'LeftSide' and 'RightSide' on
+the left by a real scaling factor will move the label further away from
+or closer to the path.
+
+ A label with a fixed-size arrow of length 'arrowlength' pointing to
+'b' from direction 'dir' can be produced with the routine
+void arrow(picture pic=currentpicture, Label L="", pair b, pair dir,
+ real length=arrowlength, align align=NoAlign,
+ pen p=currentpen, arrowbar arrow=Arrow, margin margin=EndMargin);
+ If no alignment is specified (either in the Label or as an explicit
+argument), the optional Label will be aligned in the direction 'dir',
+using margin 'margin'.
+
+ The function 'string graphic(string name, string options="")' returns
+a string that can be used to include an encapsulated 'PostScript' (EPS)
+file. Here, 'name' is the name of the file to include and 'options' is
+a string containing a comma-separated list of optional bounding box
+('bb=llx lly urx ury'), width ('width=value'), height ('height=value'),
+rotation ('angle=value'), scaling ('scale=factor'), clipping
+('clip=bool'), and draft mode ('draft=bool') parameters. The 'layer()'
+function can be used to force future objects to be drawn on top of the
+included image:
+label(graphic("file.eps","width=1cm"),(0,0),NE);
+layer();
+
+ The 'string baseline(string s, string template="\strut")' function
+can be used to enlarge the bounding box of labels to match a given
+template, so that their baselines will be typeset on a horizontal line.
+See 'Pythagoras.asy' for an example.
+
+ One can prevent labels from overwriting one another with the
+'overwrite' pen attribute (*note overwrite::).
+
+ The structure 'object' defined in 'plain_Label.asy' allows Labels and
+frames to be treated in a uniform manner. A group of objects may be
+packed together into single frame with the routine
+frame pack(pair align=2S ... object inset[]);
+To draw or fill a box (or ellipse or other path) around a Label and
+return the bounding object, use one of the routines
+object draw(picture pic=currentpicture, Label L, envelope e,
+ real xmargin=0, real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+object draw(picture pic=currentpicture, Label L, envelope e, pair position,
+ real xmargin=0, real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+Here 'envelope' is a boundary-drawing routine such as 'box', 'roundbox',
+or 'ellipse' defined in 'plain_boxes.asy' (*note envelope::).
+
+ The function 'path[] texpath(Label L)' returns the path array that
+TeX would fill to draw the Label 'L'.
+
+ The 'string minipage(string s, width=100pt)' function can be used to
+format string 's' into a paragraph of width 'width'. This example uses
+'minipage', 'clip', and 'graphic' to produce a CD label:
+
+ [./CDlabel]
+size(11.7cm,11.7cm);
+
+asy(nativeformat(),"logo");
+
+fill(unitcircle^^(scale(2/11.7)*unitcircle),
+ evenodd+rgb(124/255,205/255,124/255));
+label(scale(1.1)*minipage(
+ "\centering\scriptsize \textbf{\LARGE {\tt Asymptote}\\
+\smallskip
+\small The Vector Graphics Language}\\
+\smallskip
+\textsc{Andy Hammerlindl, John Bowman, and Tom Prince}
+https://asymptote.sourceforge.io\\
+",8cm),(0,0.6));
+label(graphic("logo","height=7cm"),(0,-0.22));
+clip(unitcircle^^(scale(2/11.7)*unitcircle),evenodd);
+
+
+File: asymptote.info, Node: Bezier curves, Next: Programming, Prev: Drawing commands, Up: Top
+
+5 Bezier curves
+***************
+
+Each interior node of a cubic spline may be given a direction prefix or
+suffix '{dir}': the direction of the pair 'dir' specifies the direction
+of the incoming or outgoing tangent, respectively, to the curve at that
+node. Exterior nodes may be given direction specifiers only on their
+interior side.
+
+ A cubic spline between the node z_0, with postcontrol point c_0, and
+the node z_1, with precontrol point c_1, is computed as the Bezier curve
+
+ [(1-t)^3*z_0+3t(1-t)^2*c_0+3t^2(1-t)*c_1+t^3*z_1 for 0 <=t <= 1.]
+
+ As illustrated in the diagram below, the third-order midpoint (m_5)
+constructed from two endpoints z_0 and z_1 and two control points c_0
+and c_1, is the point corresponding to t=1/2 on the Bezier curve formed
+by the quadruple (z_0, c_0, c_1, z_1). This allows one to recursively
+construct the desired curve, by using the newly extracted third-order
+midpoint as an endpoint and the respective second- and first-order
+midpoints as control points:
+
+ [./bezier2]
+
+ Here m_0, m_1 and m_2 are the first-order midpoints, m_3 and m_4 are
+the second-order midpoints, and m_5 is the third-order midpoint. The
+curve is then constructed by recursively applying the algorithm to (z_0,
+m_0, m_3, m_5) and (m_5, m_4, m_2, z_1).
+
+ In fact, an analogous property holds for points located at any
+fraction t in [0,1] of each segment, not just for midpoints (t=1/2).
+
+ The Bezier curve constructed in this manner has the following
+properties:
+
+ * It is entirely contained in the convex hull of the given four
+ points.
+
+ * It starts heading from the first endpoint to the first control
+ point and finishes heading from the second control point to the
+ second endpoint.
+
+ The user can specify explicit control points between two nodes like
+this:
+draw((0,0)..controls (0,100) and (100,100)..(100,0));
+
+ However, it is usually more convenient to just use the '..' operator,
+which tells 'Asymptote' to choose its own control points using the
+algorithms described in Donald Knuth's monograph, The MetaFontbook,
+Chapter 14. The user can still customize the guide (or path) by
+specifying direction, tension, and curl values.
+
+ The higher the tension, the straighter the curve is, and the more it
+approximates a straight line. One can change the spline tension from
+its default value of 1 to any real value greater than or equal to 0.75
+(cf. John D. Hobby, Discrete and Computational Geometry 1, 1986):
+draw((100,0)..tension 2 ..(100,100)..(0,100));
+draw((100,0)..tension 3 and 2 ..(100,100)..(0,100));
+draw((100,0)..tension atleast 2 ..(100,100)..(0,100));
+
+ In these examples there is a space between '2' and '..'. This is
+needed as '2.' is interpreted as a numerical constant.
+
+ The curl parameter specifies the curvature at the endpoints of a path
+(0 means straight; the default value of 1 means approximately circular):
+draw((100,0){curl 0}..(100,100)..{curl 0}(0,100));
+
+ The 'MetaPost ...' path connector, which requests, when possible, an
+inflection-free curve confined to a triangle defined by the endpoints
+and directions, is implemented in 'Asymptote' as the convenient
+abbreviation '::' for '..tension atleast 1 ..' (the ellipsis '...' is
+used in 'Asymptote' to indicate a variable number of arguments; *note
+Rest arguments::). For example, compare
+draw((0,0){up}..(100,25){right}..(200,0){down});
+
+ [./dots]
+with
+draw((0,0){up}::(100,25){right}::(200,0){down});
+
+ [./colons]
+
+ The '---' connector is an abbreviation for '..tension atleast
+infinity..' and the '&' connector concatenates two paths, after first
+stripping off the last node of the first path (which normally should
+coincide with the first node of the second path).
+
+
+File: asymptote.info, Node: Programming, Next: LaTeX usage, Prev: Bezier curves, Up: Top
+
+6 Programming
+*************
+
+* Menu:
+
+* Data types:: void, bool, int, real, pair, triple, string
+* Paths and guides:: Bezier curves
+* Pens:: Colors, line types, line widths, font sizes
+* Transforms:: Affine transforms
+* Frames and pictures:: Canvases for immediate and deferred drawing
+* Files:: Reading and writing your data
+* Variable initializers:: Initialize your variables
+* Structures:: Organize your data
+* Operators:: Arithmetic and logical operators
+* Implicit scaling:: Avoiding those ugly *s
+* Functions:: Traditional and high-order functions
+* Arrays:: Dynamic vectors
+* Casts:: Implicit and explicit casts
+* Import:: Importing external 'Asymptote' modules
+* Static:: Where to allocate your variable?
+
+Here is a short introductory example to the 'Asymptote' programming
+language that highlights the similarity of its control structures with
+those of C, C++, and Java:
+// This is a comment.
+
+// Declaration: Declare x to be a real variable;
+real x;
+
+// Assignment: Assign the real variable x the value 1.
+x=1.0;
+
+// Conditional: Test if x equals 1 or not.
+if(x == 1.0) {
+ write("x equals 1.0");
+} else {
+ write("x is not equal to 1.0");
+}
+
+// Loop: iterate 10 times
+for(int i=0; i < 10; ++i) {
+ write(i);
+}
+
+
+ 'Asymptote' supports 'while', 'do', 'break', and 'continue'
+statements just as in C/C++. It also supports the Java-style shorthand
+for iterating over all elements of an array:
+
+// Iterate over an array
+int[] array={1,1,2,3,5};
+for(int k : array) {
+ write(k);
+}
+In addition, it supports many features beyond the ones found in those
+languages.
+
+
+File: asymptote.info, Node: Data types, Next: Paths and guides, Prev: Programming, Up: Programming
+
+6.1 Data types
+==============
+
+'Asymptote' supports the following data types (in addition to
+user-defined types):
+
+'void'
+ The void type is used only by functions that take or return no
+ arguments.
+
+'bool'
+ a boolean type that can only take on the values 'true' or 'false'.
+ For example:
+ bool b=true;
+
+ defines a boolean variable 'b' and initializes it to the value
+ 'true'. If no initializer is given:
+ bool b;
+
+ the value 'false' is assumed.
+
+'bool3'
+ an extended boolean type that can take on the values 'true',
+ 'default', or 'false'. A bool3 type can be cast to or from a bool.
+ The default initializer for bool3 is 'default'.
+
+'int'
+ an integer type; if no initializer is given, the implicit value '0'
+ is assumed. The minimum allowed value of an integer is 'intMin'
+ and the maximum value is 'intMax'.
+
+'real'
+ a real number; this should be set to the highest-precision native
+ floating-point type on the architecture. The implicit initializer
+ for reals is '0.0'. Real numbers have precision 'realEpsilon',
+ with 'realDigits' significant digits. The smallest positive real
+ number is 'realMin' and the largest positive real number is
+ 'realMax'. The variables 'inf' and 'nan', along with the function
+ 'bool isnan(real x)' are useful when floating-point exceptions are
+ masked with the '-mask' command-line option (the default in
+ interactive mode).
+
+'pair'
+ complex number, that is, an ordered pair of real components
+ '(x,y)'. The real and imaginary parts of a pair 'z' can read as
+ 'z.x' and 'z.y'. We say that 'x' and 'y' are virtual members of
+ the data element pair; they cannot be directly modified, however.
+ The implicit initializer for pairs is '(0.0,0.0)'.
+
+ There are a number of ways to take the complex conjugate of a pair:
+ pair z=(3,4);
+ z=(z.x,-z.y);
+ z=z.x-I*z.y;
+ z=conj(z);
+
+ Here 'I' is the pair '(0,1)'. A number of built-in functions are
+ defined for pairs:
+
+ 'pair conj(pair z)'
+ returns the conjugate of 'z';
+
+ 'real length(pair z)'
+ returns the complex modulus |'z'| of its argument 'z'. For
+ example,
+ pair z=(3,4);
+ length(z);
+ returns the result 5. A synonym for 'length(pair)' is
+ 'abs(pair)'. The function 'abs2(pair z)' returns |'z'|^2;
+
+ 'real angle(pair z, bool warn=true)'
+ returns the angle of 'z' in radians in the interval
+ [-'pi','pi'] or '0' if 'warn' is 'false' and 'z=(0,0)' (rather
+ than producing an error);
+
+ 'real degrees(pair z, bool warn=true)'
+ returns the angle of 'z' in degrees in the interval [0,360) or
+ '0' if 'warn' is 'false' and 'z=(0,0)' (rather than producing
+ an error);
+
+ 'pair unit(pair z)'
+ returns a unit vector in the direction of the pair 'z';
+
+ 'pair expi(real angle)'
+ returns a unit vector in the direction 'angle' measured in
+ radians;
+
+ 'pair dir(real degrees)'
+ returns a unit vector in the direction 'degrees' measured in
+ degrees;
+
+ 'real xpart(pair z)'
+ returns 'z.x';
+
+ 'real ypart(pair z)'
+ returns 'z.y';
+
+ 'pair realmult(pair z, pair w)'
+ returns the element-by-element product '(z.x*w.x,z.y*w.y)';
+
+ 'real dot(explicit pair z, explicit pair w)'
+ returns the dot product 'z.x*w.x+z.y*w.y';
+
+ 'real cross(explicit pair z, explicit pair w)'
+ returns the 2D scalar product 'z.x*w.y-z.y*w.x';
+
+ 'real orient(pair a, pair b, pair c);'
+ returns a positive (negative) value if 'a--b--c--cycle' is
+ oriented counterclockwise (clockwise) or zero if all three
+ points are colinear. Equivalently, a positive (negative)
+ value is returned if 'c' lies to the left (right) of the line
+ through 'a' and 'b' or zero if 'c' lies on this line. The
+ value returned can be expressed in terms of the 2D scalar
+ cross product as 'cross(a-c,b-c)', which is the determinant
+ |a.x a.y 1|
+ |b.x b.y 1|
+ |c.x c.y 1|
+
+ 'real incircle(pair a, pair b, pair c, pair d);'
+ returns a positive (negative) value if 'd' lies inside
+ (outside) the circle passing through the
+ counterclockwise-oriented points 'a,b,c' or zero if 'd' lies
+ on the this circle. The value returned is the determinant
+ |a.x a.y a.x^2+a.y^2 1|
+ |b.x b.y b.x^2+b.y^2 1|
+ |c.x c.y c.x^2+c.y^2 1|
+ |d.x d.y d.x^2+d.y^2 1|
+
+ 'pair minbound(pair z, pair w)'
+ returns '(min(z.x,w.x),min(z.y,w.y))';
+
+ 'pair maxbound(pair z, pair w)'
+ returns '(max(z.x,w.x),max(z.y,w.y))'.
+
+'triple'
+ an ordered triple of real components '(x,y,z)' used for
+ three-dimensional drawings. The respective components of a triple
+ 'v' can read as 'v.x', 'v.y', and 'v.z'. The implicit initializer
+ for triples is '(0.0,0.0,0.0)'.
+
+ Here are the built-in functions for triples:
+ 'real length(triple v)'
+ returns the length |'v'| of its argument 'v'. A synonym for
+ 'length(triple)' is 'abs(triple)'. The function 'abs2(triple
+ v)' returns |'v'|^2;
+
+ 'real polar(triple v, bool warn=true)'
+ returns the colatitude of 'v' measured from the z axis in
+ radians or '0' if 'warn' is 'false' and 'v=O' (rather than
+ producing an error);
+
+ 'real azimuth(triple v, bool warn=true)'
+ returns the longitude of 'v' measured from the x axis in
+ radians or '0' if 'warn' is 'false' and 'v.x=v.y=0' (rather
+ than producing an error);
+
+ 'real colatitude(triple v, bool warn=true)'
+ returns the colatitude of 'v' measured from the z axis in
+ degrees or '0' if 'warn' is 'false' and 'v=O' (rather than
+ producing an error);
+
+ 'real latitude(triple v, bool warn=true)'
+ returns the latitude of 'v' measured from the xy plane in
+ degrees or '0' if 'warn' is 'false' and 'v=O' (rather than
+ producing an error);
+
+ 'real longitude(triple v, bool warn=true)'
+ returns the longitude of 'v' measured from the x axis in
+ degrees or '0' if 'warn' is 'false' and 'v.x=v.y=0' (rather
+ than producing an error);
+
+ 'triple unit(triple v)'
+ returns a unit triple in the direction of the triple 'v';
+
+ 'triple expi(real polar, real azimuth)'
+ returns a unit triple in the direction '(polar,azimuth)'
+ measured in radians;
+
+ 'triple dir(real colatitude, real longitude)'
+ returns a unit triple in the direction
+ '(colatitude,longitude)' measured in degrees;
+
+ 'real xpart(triple v)'
+ returns 'v.x';
+
+ 'real ypart(triple v)'
+ returns 'v.y';
+
+ 'real zpart(triple v)'
+ returns 'v.z';
+
+ 'real dot(triple u, triple v)'
+ returns the dot product 'u.x*v.x+u.y*v.y+u.z*v.z';
+
+ 'triple cross(triple u, triple v)'
+ returns the cross product
+
+ '(u.y*v.z-u.z*v.y,u.z*v.x-u.x*v.z,u.x*v.y-v.x*u.y)';
+
+ 'triple minbound(triple u, triple v)'
+ returns '(min(u.x,v.x),min(u.y,v.y),min(u.z,v.z))';
+
+ 'triple maxbound(triple u, triple v)'
+ returns '(max(u.x,v.x),max(u.y,v.y),max(u.z,v.z)').
+
+'string'
+ a character string, implemented using the STL 'string' class.
+
+ Strings delimited by double quotes ('"') are subject to the
+ following mappings to allow the use of double quotes in TeX
+ (e.g. for using the 'babel' package, *note babel::):
+
+ * \" maps to "
+ * \\ maps to \\
+
+ Strings delimited by single quotes (''') have the same mappings as
+ character strings in ANSI 'C':
+
+ * \' maps to '
+ * \" maps to "
+ * \? maps to ?
+ * \\ maps to backslash
+ * \a maps to alert
+ * \b maps to backspace
+ * \f maps to form feed
+ * \n maps to newline
+ * \r maps to carriage return
+ * \t maps to tab
+ * \v maps to vertical tab
+ * \0-\377 map to corresponding octal byte
+ * \x0-\xFF map to corresponding hexadecimal byte
+
+ The implicit initializer for strings is the empty string '""'.
+ Strings may be concatenated with the '+' operator. In the
+ following string functions, position '0' denotes the start of the
+ string:
+
+ 'int length(string s)'
+ returns the length of the string 's';
+
+ 'int find(string s, string t, int pos=0)'
+ returns the position of the first occurrence of string 't' in
+ string 's' at or after position 'pos', or -1 if 't' is not a
+ substring of 's';
+
+ 'int rfind(string s, string t, int pos=-1)'
+ returns the position of the last occurrence of string 't' in
+ string 's' at or before position 'pos' (if 'pos'=-1, at the
+ end of the string 's'), or -1 if 't' is not a substring of
+ 's';
+
+ 'string insert(string s, int pos, string t)'
+ returns the string formed by inserting string 't' at position
+ 'pos' in 's';
+
+ 'string erase(string s, int pos, int n)'
+ returns the string formed by erasing the string of length 'n'
+ (if 'n'=-1, to the end of the string 's') at position 'pos' in
+ 's';
+
+ 'string substr(string s, int pos, int n=-1)'
+ returns the substring of 's' starting at position 'pos' and of
+ length 'n' (if 'n'=-1, until the end of the string 's');
+
+ 'string reverse(string s)'
+ returns the string formed by reversing string 's';
+
+ 'string replace(string s, string before, string after)'
+ returns a string with all occurrences of the string 'before'
+ in the string 's' changed to the string 'after';
+
+ 'string replace(string s, string[][] table)'
+ returns a string constructed by translating in string 's' all
+ occurrences of the string 'before' in an array 'table' of
+ string pairs {'before','after'} to the corresponding string
+ 'after';
+
+ 'string[] split(string s, string delimiter="")'
+ returns an array of strings obtained by splitting 's' into
+ substrings delimited by 'delimiter' (an empty delimiter
+ signifies a space, but with duplicate delimiters discarded);
+
+ 'string[] array(string s)'
+ returns an array of strings obtained by splitting 's' into
+ individual characters. The inverse operation is provided by
+ 'operator +(...string[] a)'.
+
+ 'string format(string s, int n, string locale="")'
+ returns a string containing 'n' formatted according to the
+ C-style format string 's' using locale 'locale' (or the
+ current locale if an empty string is specified), following the
+ behaviour of the C function 'fprintf'), except that only one
+ data field is allowed.
+
+ 'string format(string s=defaultformat, bool forcemath=false, string s=defaultseparator, real x, string locale="")'
+ returns a string containing 'x' formatted according to the
+ C-style format string 's' using locale 'locale' (or the
+ current locale if an empty string is specified), following the
+ behaviour of the C function 'fprintf'), except that only one
+ data field is allowed, trailing zeros are removed by default
+ (unless '#' is specified), and if 's' specifies math mode or
+ 'forcemath=true', TeX is used to typeset scientific notation
+ using the 'defaultseparator="\!\times\!";';
+
+ 'int hex(string s);'
+ casts a hexadecimal string 's' to an integer;
+
+ 'int ascii(string s);'
+ returns the ASCII code for the first character of string 's';
+
+ 'string string(real x, int digits=realDigits)'
+ casts 'x' to a string using precision 'digits' and the C
+ locale;
+
+ 'string locale(string s="")'
+ sets the locale to the given string, if nonempty, and returns
+ the current locale;
+
+ 'string time(string format="%a %b %d %T %Z %Y")'
+ returns the current time formatted by the ANSI C routine
+ 'strftime' according to the string 'format' using the current
+ locale. Thus
+ time();
+ time("%a %b %d %H:%M:%S %Z %Y");
+
+ are equivalent ways of returning the current time in the
+ default format used by the 'UNIX' 'date' command;
+
+ 'int seconds(string t="", string format="")'
+ returns the time measured in seconds after the Epoch (Thu Jan
+ 01 00:00:00 UTC 1970) as determined by the ANSI C routine
+ 'strptime' according to the string 'format' using the current
+ locale, or the current time if 't' is the empty string. Note
+ that the '"%Z"' extension to the POSIX 'strptime'
+ specification is ignored by the current GNU C Library. If an
+ error occurs, the value -1 is returned. Here are some
+ examples:
+ seconds("Mar 02 11:12:36 AM PST 2007","%b %d %r PST %Y");
+ seconds(time("%b %d %r %z %Y"),"%b %d %r %z %Y");
+ seconds(time("%b %d %r %Z %Y"),"%b %d %r "+time("%Z")+" %Y");
+ 1+(seconds()-seconds("Jan 1","%b %d"))/(24*60*60);
+ The last example returns today's ordinal date, measured from
+ the beginning of the year.
+
+ 'string time(int seconds, string format="%a %b %d %T %Z %Y")'
+ returns the time corresponding to 'seconds' seconds after the
+ Epoch (Thu Jan 01 00:00:00 UTC 1970) formatted by the ANSI C
+ routine 'strftime' according to the string 'format' using the
+ current locale. For example, to return the date corresponding
+ to 24 hours ago:
+ time(seconds()-24*60*60);
+
+ 'int system(string s)'
+ 'int system(string[] s)'
+ if the setting 'safe' is false, call the arbitrary system
+ command 's';
+
+ 'void asy(string format, bool overwrite=false ... string[] s)'
+ conditionally process each file name in array 's' in a new
+ environment, using format 'format', overwriting the output
+ file only if 'overwrite' is true;
+
+ 'void abort(string s="")'
+ aborts execution (with a non-zero return code in batch mode);
+ if string 's' is nonempty, a diagnostic message constructed
+ from the source file, line number, and 's' is printed;
+
+ 'void assert(bool b, string s="")'
+ aborts execution with an error message constructed from 's' if
+ 'b=false';
+
+ 'void exit()'
+ exits (with a zero error return code in batch mode);
+
+ 'void sleep(int seconds)'
+ pauses for the given number of seconds;
+
+ 'void usleep(int microseconds)'
+ pauses for the given number of microseconds;
+
+ 'void beep()'
+ produces a beep on the console;
+
+ As in C/C++, complicated types may be abbreviated with 'typedef' (see
+the example in *note Functions::).
+
+
+File: asymptote.info, Node: Paths and guides, Next: Pens, Prev: Data types, Up: Programming
+
+6.2 Paths and guides
+====================
+
+'path'
+ a cubic spline resolved into a fixed path. The implicit
+ initializer for paths is 'nullpath'.
+
+ For example, the routine 'circle(pair c, real r)', which returns a
+ Bezier curve approximating a circle of radius 'r' centered on 'c',
+ is based on 'unitcircle' (*note unitcircle::):
+ path circle(pair c, real r)
+ {
+ return shift(c)*scale(r)*unitcircle;
+ }
+ If high accuracy is needed, a true circle may be produced with the
+ routine 'Circle' defined in the module 'graph':
+ import graph;
+ path Circle(pair c, real r, int n=nCircle);
+
+ A circular arc consistent with 'circle' centered on 'c' with radius
+ 'r' from 'angle1' to 'angle2' degrees, drawing counterclockwise if
+ 'angle2 >= angle1', can be constructed with
+ path arc(pair c, real r, real angle1, real angle2);
+ One may also specify the direction explicitly:
+ path arc(pair c, real r, real angle1, real angle2, bool direction);
+ Here the direction can be specified as CCW (counter-clockwise) or
+ CW (clockwise). For convenience, an arc centered at 'c' from pair
+ 'z1' to 'z2' (assuming '|z2-c|=|z1-c|') in the may also be
+ constructed with
+ path arc(pair c, explicit pair z1, explicit pair z2,
+ bool direction=CCW)
+
+ If high accuracy is needed, true arcs may be produced with routines
+ in the module 'graph' that produce Bezier curves with 'n' control
+ points:
+ import graph;
+ path Arc(pair c, real r, real angle1, real angle2, bool direction,
+ int n=nCircle);
+ path Arc(pair c, real r, real angle1, real angle2, int n=nCircle);
+ path Arc(pair c, explicit pair z1, explicit pair z2,
+ bool direction=CCW, int n=nCircle);
+
+ An ellipse can be drawn with the routine
+ path ellipse(pair c, real a, real b)
+ {
+ return shift(c)*scale(a,b)*unitcircle;
+ }
+
+ A brace can be constructed between pairs 'a' and 'b' with
+ path brace(pair a, pair b, real amplitude=bracedefaultratio*length(b-a));
+
+ This example illustrates the use of all five guide connectors
+ discussed in *note Tutorial:: and *note Bezier curves:::
+ size(300,0);
+ pair[] z=new pair[10];
+
+ z[0]=(0,100); z[1]=(50,0); z[2]=(180,0);
+
+ for(int n=3; n <= 9; ++n)
+ z[n]=z[n-3]+(200,0);
+
+ path p=z[0]..z[1]---z[2]::{up}z[3]
+ &z[3]..z[4]--z[5]::{up}z[6]
+ &z[6]::z[7]---z[8]..{up}z[9];
+
+ draw(p,grey+linewidth(4mm));
+
+ dot(z);
+
+ [./join]
+
+ Here are some useful functions for paths:
+
+ 'int length(path p);'
+ This is the number of (linear or cubic) segments in path 'p'.
+ If 'p' is cyclic, this is the same as the number of nodes in
+ 'p'.
+
+ 'int size(path p);'
+ This is the number of nodes in the path 'p'. If 'p' is
+ cyclic, this is the same as 'length(p)'.
+
+ 'bool cyclic(path p);'
+ returns 'true' iff path 'p' is cyclic.
+
+ 'bool straight(path p, int i);'
+ returns 'true' iff the segment of path 'p' between node 'i'
+ and node 'i+1' is straight.
+
+ 'bool piecewisestraight(path p)'
+ returns 'true' iff the path 'p' is piecewise straight.
+
+ 'pair point(path p, int t);'
+ If 'p' is cyclic, return the coordinates of node 't' mod
+ 'length(p)'. Otherwise, return the coordinates of node 't',
+ unless 't' < 0 (in which case 'point(0)' is returned) or 't' >
+ 'length(p)' (in which case 'point(length(p))' is returned).
+
+ 'pair point(path p, real t);'
+ This returns the coordinates of the point between node
+ 'floor(t)' and 'floor(t)+1' corresponding to the cubic spline
+ parameter 't-floor(t)' (*note Bezier curves::). If 't' lies
+ outside the range [0,'length(p)'], it is first reduced modulo
+ 'length(p)' in the case where 'p' is cyclic or else converted
+ to the corresponding endpoint of 'p'.
+
+ 'pair dir(path p, int t, int sign=0, bool normalize=true);'
+ If 'sign < 0', return the direction (as a pair) of the
+ incoming tangent to path 'p' at node 't'; if 'sign > 0',
+ return the direction of the outgoing tangent. If 'sign=0',
+ the mean of these two directions is returned.
+
+ 'pair dir(path p, real t, bool normalize=true);'
+ returns the direction of the tangent to path 'p' at the point
+ between node 'floor(t)' and 'floor(t)+1' corresponding to the
+ cubic spline parameter 't-floor(t)' (*note Bezier curves::).
+
+ 'pair dir(path p)'
+ returns dir(p,length(p)).
+
+ 'pair dir(path p, path q)'
+ returns unit(dir(p)+dir(q)).
+
+ 'pair accel(path p, int t, int sign=0);'
+ If 'sign < 0', return the acceleration of the incoming path
+ 'p' at node 't'; if 'sign > 0', return the acceleration of the
+ outgoing path. If 'sign=0', the mean of these two
+ accelerations is returned.
+
+ 'pair accel(path p, real t);'
+ returns the acceleration of the path 'p' at the point 't'.
+
+ 'real radius(path p, real t);'
+ returns the radius of curvature of the path 'p' at the point
+ 't'.
+
+ 'pair precontrol(path p, int t);'
+ returns the precontrol point of 'p' at node 't'.
+
+ 'pair precontrol(path p, real t);'
+ returns the effective precontrol point of 'p' at parameter
+ 't'.
+
+ 'pair postcontrol(path p, int t);'
+ returns the postcontrol point of 'p' at node 't'.
+
+ 'pair postcontrol(path p, real t);'
+ returns the effective postcontrol point of 'p' at parameter
+ 't'.
+
+ 'real arclength(path p);'
+ returns the length (in user coordinates) of the piecewise
+ linear or cubic curve that path 'p' represents.
+
+ 'real arctime(path p, real L);'
+ returns the path "time", a real number between 0 and the
+ length of the path in the sense of 'point(path p, real t)', at
+ which the cumulative arclength (measured from the beginning of
+ the path) equals 'L'.
+
+ 'pair arcpoint(path p, real L);'
+ returns 'point(p,arctime(p,L))'.
+
+ 'real dirtime(path p, pair z);'
+ returns the first "time", a real number between 0 and the
+ length of the path in the sense of 'point(path, real)', at
+ which the tangent to the path has the direction of pair 'z',
+ or -1 if this never happens.
+
+ 'real reltime(path p, real l);'
+ returns the time on path 'p' at the relative fraction 'l' of
+ its arclength.
+
+ 'pair relpoint(path p, real l);'
+ returns the point on path 'p' at the relative fraction 'l' of
+ its arclength.
+
+ 'pair midpoint(path p);'
+ returns the point on path 'p' at half of its arclength.
+
+ 'path reverse(path p);'
+ returns a path running backwards along 'p'.
+
+ 'path subpath(path p, int a, int b);'
+ returns the subpath of 'p' running from node 'a' to node 'b'.
+ If 'a' < 'b', the direction of the subpath is reversed.
+
+ 'path subpath(path p, real a, real b);'
+ returns the subpath of 'p' running from path time 'a' to path
+ time 'b', in the sense of 'point(path, real)'. If 'a' < 'b',
+ the direction of the subpath is reversed.
+
+ 'real[] intersect(path p, path q, real fuzz=-1);'
+ If 'p' and 'q' have at least one intersection point, return a
+ real array of length 2 containing the times representing the
+ respective path times along 'p' and 'q', in the sense of
+ 'point(path, real)', for one such intersection point (as
+ chosen by the algorithm described on page 137 of 'The
+ MetaFontbook'). The computations are performed to the
+ absolute error specified by 'fuzz', or if 'fuzz < 0', to
+ machine precision. If the paths do not intersect, return a
+ real array of length 0.
+
+ 'real[][] intersections(path p, path q, real fuzz=-1);'
+ Return all (unless there are infinitely many) intersection
+ times of paths 'p' and 'q' as a sorted array of real arrays of
+ length 2 (*note sort::). The computations are performed to
+ the absolute error specified by 'fuzz', or if 'fuzz < 0', to
+ machine precision.
+
+ 'real[] intersections(path p, explicit pair a, explicit pair b, real fuzz=-1);'
+ Return all (unless there are infinitely many) intersection
+ times of path 'p' with the (infinite) line through points 'a'
+ and 'b' as a sorted array. The intersections returned are
+ guaranteed to be correct to within the absolute error
+ specified by 'fuzz', or if 'fuzz < 0', to machine precision.
+
+ 'real[] times(path p, real x)'
+ returns all intersection times of path 'p' with the vertical
+ line through '(x,0)'.
+
+ 'real[] times(path p, explicit pair z)'
+ returns all intersection times of path 'p' with the horizontal
+ line through '(0,z.y)'.
+
+ 'real[] mintimes(path p)'
+ returns an array of length 2 containing times at which path
+ 'p' reaches its minimal horizontal and vertical extents,
+ respectively.
+
+ 'real[] maxtimes(path p)'
+ returns an array of length 2 containing times at which path
+ 'p' reaches its maximal horizontal and vertical extents,
+ respectively.
+
+ 'pair intersectionpoint(path p, path q, real fuzz=-1);'
+ returns the intersection point
+ 'point(p,intersect(p,q,fuzz)[0])'.
+
+ 'pair[] intersectionpoints(path p, path q, real fuzz=-1);'
+ returns an array containing all intersection points of the
+ paths 'p' and 'q'.
+
+ 'pair extension(pair P, pair Q, pair p, pair q);'
+ returns the intersection point of the extensions of the line
+ segments 'P--Q' and 'p--q', or if the lines are parallel,
+ '(infinity,infinity)'.
+
+ 'slice cut(path p, path knife, int n);'
+ returns the portions of path 'p' before and after the 'n'th
+ intersection of 'p' with path 'knife' as a structure 'slice'
+ (if no intersection exist is found, the entire path is
+ considered to be 'before' the intersection):
+ struct slice {
+ path before,after;
+ }
+ The argument 'n' is treated as modulo the number of
+ intersections.
+
+ 'slice firstcut(path p, path knife);'
+ equivalent to 'cut(p,knife,0);' Note that 'firstcut.after'
+ plays the role of the 'MetaPost cutbefore' command.
+
+ 'slice lastcut(path p, path knife);'
+ equivalent to 'cut(p,knife,-1);' Note that 'lastcut.before'
+ plays the role of the 'MetaPost cutafter' command.
+
+ 'path buildcycle(... path[] p);'
+ This returns the path surrounding a region bounded by a list
+ of two or more consecutively intersecting paths, following the
+ behaviour of the 'MetaPost buildcycle' command.
+
+ 'pair min(path p);'
+ returns the pair (left,bottom) for the path bounding box of
+ path 'p'.
+
+ 'pair max(path p);'
+ returns the pair (right,top) for the path bounding box of path
+ 'p'.
+
+ 'int windingnumber(path p, pair z);'
+ returns the winding number of the cyclic path 'p' relative to
+ the point 'z'. The winding number is positive if the path
+ encircles 'z' in the counterclockwise direction. If 'z' lies
+ on 'p' the constant 'undefined' (defined to be the largest odd
+ integer) is returned.
+
+ 'bool interior(int windingnumber, pen fillrule)'
+ returns true if 'windingnumber' corresponds to an interior
+ point according to 'fillrule'.
+
+ 'bool inside(path p, pair z, pen fillrule=currentpen);'
+ returns 'true' iff the point 'z' lies inside or on the edge of
+ the region bounded by the cyclic path 'p' according to the
+ fill rule 'fillrule' (*note fillrule::).
+
+ 'int inside(path p, path q, pen fillrule=currentpen);'
+ returns '1' if the cyclic path 'p' strictly contains 'q'
+ according to the fill rule 'fillrule' (*note fillrule::), '-1'
+ if the cyclic path 'q' strictly contains 'p', and '0'
+ otherwise.
+
+ 'pair inside(path p, pen fillrule=currentpen);'
+ returns an arbitrary point strictly inside a cyclic path 'p'
+ according to the fill rule 'fillrule' (*note fillrule::).
+
+ 'path[] strokepath(path g, pen p=currentpen);'
+ returns the path array that 'PostScript' would fill in drawing
+ path 'g' with pen 'p'.
+
+'guide'
+ an unresolved cubic spline (list of cubic-spline nodes and control
+ points). The implicit initializer for a guide is 'nullpath'; this
+ is useful for building up a guide within a loop.
+
+ A guide is similar to a path except that the computation of the
+ cubic spline is deferred until drawing time (when it is resolved
+ into a path); this allows two guides with free endpoint conditions
+ to be joined together smoothly. The solid curve in the following
+ example is built up incrementally as a guide, but only resolved at
+ drawing time; the dashed curve is incrementally resolved at each
+ iteration, before the entire set of nodes (shown in red) is known:
+
+ size(200);
+
+ real mexican(real x) {return (1-8x^2)*exp(-(4x^2));}
+
+ int n=30;
+ real a=1.5;
+ real width=2a/n;
+
+ guide hat;
+ path solved;
+
+ for(int i=0; i < n; ++i) {
+ real t=-a+i*width;
+ pair z=(t,mexican(t));
+ hat=hat..z;
+ solved=solved..z;
+ }
+
+ draw(hat);
+ dot(hat,red);
+ draw(solved,dashed);
+
+
+ [./mexicanhat]
+
+ We point out an efficiency distinction in the use of guides and
+ paths:
+ guide g;
+ for(int i=0; i < 10; ++i)
+ g=g--(i,i);
+ path p=g;
+
+ runs in linear time, whereas
+ path p;
+ for(int i=0; i < 10; ++i)
+ p=p--(i,i);
+
+ runs in quadratic time, as the entire path up to that point is
+ copied at each step of the iteration.
+
+ The following routines can be used to examine the individual
+ elements of a guide without actually resolving the guide to a fixed
+ path (except for internal cycles, which are resolved):
+
+ 'int size(guide g);'
+ Analogous to 'size(path p)'.
+
+ 'int length(guide g);'
+ Analogous to 'length(path p)'.
+
+ 'bool cyclic(path p);'
+ Analogous to 'cyclic(path p)'.
+
+ 'pair point(guide g, int t);'
+ Analogous to 'point(path p, int t)'.
+
+ 'guide reverse(guide g);'
+ Analogous to 'reverse(path p)'. If 'g' is cyclic and also
+ contains a secondary cycle, it is first solved to a path, then
+ reversed. If 'g' is not cyclic but contains an internal
+ cycle, only the internal cycle is solved before reversal. If
+ there are no internal cycles, the guide is reversed but not
+ solved to a path.
+
+ 'pair[] dirSpecifier(guide g, int i);'
+ This returns a pair array of length 2 containing the outgoing
+ (in element 0) and incoming (in element 1) direction
+ specifiers (or '(0,0)' if none specified) for the segment of
+ guide 'g' between nodes 'i' and 'i+1'.
+
+ 'pair[] controlSpecifier(guide g, int i);'
+ If the segment of guide 'g' between nodes 'i' and 'i+1' has
+ explicit outgoing and incoming control points, they are
+ returned as elements 0 and 1, respectively, of a two-element
+ array. Otherwise, an empty array is returned.
+
+ 'tensionSpecifier tensionSpecifier(guide g, int i);'
+ This returns the tension specifier for the segment of guide
+ 'g' between nodes 'i' and 'i+1'. The individual components of
+ the 'tensionSpecifier' type can be accessed as the virtual
+ members 'in', 'out', and 'atLeast'.
+
+ 'real[] curlSpecifier(guide g);'
+ This returns an array containing the initial curl specifier
+ (in element 0) and final curl specifier (in element 1) for
+ guide 'g'.
+
+ As a technical detail we note that a direction specifier given to
+ 'nullpath' modifies the node on the other side: the guides
+ a..{up}nullpath..b;
+ c..nullpath{up}..d;
+ e..{up}nullpath{down}..f;
+ are respectively equivalent to
+ a..nullpath..{up}b;
+ c{up}..nullpath..d;
+ e{down}..nullpath..{up}f;
+
+
+File: asymptote.info, Node: Pens, Next: Transforms, Prev: Paths and guides, Up: Programming
+
+6.3 Pens
+========
+
+In 'Asymptote', pens provide a context for the four basic drawing
+commands (*note Drawing commands::). They are used to specify the
+following drawing attributes: color, line type, line width, line cap,
+line join, fill rule, text alignment, font, font size, pattern,
+overwrite mode, and calligraphic transforms on the pen nib. The default
+pen used by the drawing routines is called 'currentpen'. This provides
+the same functionality as the 'MetaPost' command 'pickup'. The implicit
+initializer for pens is 'defaultpen'.
+
+ Pens may be added together with the nonassociative binary operator
+'+'. This will add the colors of the two pens. All other non-default
+attributes of the rightmost pen will override those of the leftmost pen.
+Thus, one can obtain a yellow dashed pen by saying 'dashed+red+green' or
+'red+green+dashed' or 'red+dashed+green'. The binary operator '*' can
+be used to scale the color of a pen by a real number, until it saturates
+with one or more color components equal to 1.
+
+ * Colors are specified using one of the following colorspaces:
+ 'pen gray(real g);'
+ This produces a grayscale color, where the intensity 'g' lies
+ in the interval [0,1], with 0.0 denoting black and 1.0
+ denoting white.
+
+ 'pen rgb(real r, real g, real b);'
+ This produces an RGB color, where each of the red, green, and
+ blue intensities 'r', 'g', 'b', lies in the interval [0,1].
+
+ 'pen RGB(int r, int g, int b);'
+ This produces an RGB color, where each of the red, green, and
+ blue intensities 'r', 'g', 'b', lies in the interval [0,255].
+
+ 'pen cmyk(real c, real m, real y, real k);'
+ This produces a CMYK color, where each of the cyan, magenta,
+ yellow, and black intensities 'c', 'm', 'y', 'k', lies in the
+ interval [0,1].
+
+ 'pen invisible;'
+ This special pen writes in invisible ink, but adjusts the
+ bounding box as if something had been drawn (like the
+ '\phantom' command in TeX). The function 'bool
+ invisible(pen)' can be used to test whether a pen is
+ invisible.
+
+ The default color is 'black'; this may be changed with the routine
+ 'defaultpen(pen)'. The function 'colorspace(pen p)' returns the
+ colorspace of pen 'p' as a string ('"gray"', '"rgb"', '"cmyk"', or
+ '""').
+
+ The function 'real[] colors(pen)' returns the color components of a
+ pen. The functions 'pen gray(pen)', 'pen rgb(pen)', and 'pen
+ cmyk(pen)' return new pens obtained by converting their arguments
+ to the respective color spaces. The function
+ 'colorless(pen=currentpen)' returns a copy of its argument with the
+ color attributes stripped (to avoid color mixing).
+
+ A 6-character RGB hexadecimal string can be converted to a pen with
+ the routine
+ pen rgb(string s);
+ A pen can be converted to a hexadecimal string with
+ * string hex(pen p);
+
+ Various shades and mixtures of the grayscale primary colors 'black'
+ and 'white', RGB primary colors 'red', 'green', and 'blue', and RGB
+ secondary colors 'cyan', 'magenta', and 'yellow' are defined as
+ named colors, along with the CMYK primary colors 'Cyan', 'Magenta',
+ 'Yellow', and 'Black', in the module 'plain':
+
+ [./colors]
+
+ The standard 140 RGB 'X11' colors can be imported with the command
+ import x11colors;
+ and the standard 68 CMYK TeX colors can be imported with the
+ command
+ import texcolors;
+ Note that there is some overlap between these two standards and the
+ definitions of some colors (e.g. 'Green') actually disagree.
+
+ 'Asymptote' also comes with a 'asycolors.sty' 'LaTeX' package that
+ defines to 'LaTeX' CMYK versions of 'Asymptote''s predefined
+ colors, so that they can be used directly within 'LaTeX' strings.
+ Normally, such colors are passed to 'LaTeX' via a pen argument;
+ however, to change the color of only a portion of a string, say for
+ a slide presentation, (*note slide::) it may be desirable to
+ specify the color directly to 'LaTeX'. This file can be passed to
+ 'LaTeX' with the 'Asymptote' command
+ usepackage("asycolors");
+
+ The structure 'hsv' defined in 'plain_pens.asy' may be used to
+ convert between HSV and RGB spaces, where the hue 'h' is an angle
+ in [0,360) and the saturation 's' and value 'v' lie in '[0,1]':
+ pen p=hsv(180,0.5,0.75);
+ write(p); // ([default], red=0.375, green=0.75, blue=0.75)
+ hsv q=p;
+ write(q.h,q.s,q.v); // 180 0.5 0.75
+
+ * Line types are specified with the function 'pen linetype(real[] a,
+ real offset=0, bool scale=true, bool adjust=true)', where 'a' is an
+ array of real array numbers. The optional parameter 'offset'
+ specifies where in the pattern to begin. The first number
+ specifies how far (if 'scale' is 'true', in units of the pen line
+ width; otherwise in 'PostScript' units) to draw with the pen on,
+ the second number specifies how far to draw with the pen off, and
+ so on. If 'adjust' is 'true', these spacings are automatically
+ adjusted by 'Asymptote' to fit the arclength of the path. Here are
+ the predefined line types:
+ pen solid=linetype(new real[]);
+ pen dotted=linetype(new real[] {0,4});
+ pen dashed=linetype(new real[] {8,8});
+ pen longdashed=linetype(new real[] {24,8});
+ pen dashdotted=linetype(new real[] {8,8,0,8});
+ pen longdashdotted=linetype(new real[] {24,8,0,8});
+ pen Dotted(pen p=currentpen) {return linetype(new real[] {0,3})+2*linewidth(p);}
+ pen Dotted=Dotted();
+
+ [./linetype]
+
+ The default line type is 'solid'; this may be changed with
+ 'defaultpen(pen)'. The line type of a pen can be determined with
+ the functions 'real[] linetype(pen p=currentpen)', 'real offset(pen
+ p)', 'bool scale(pen p)', and 'bool adjust(pen p)'.
+
+ * The pen line width is specified in 'PostScript' units with 'pen
+ linewidth(real)'. The default line width is 0.5 bp; this value may
+ be changed with 'defaultpen(pen)'. The line width of a pen is
+ returned by 'real linewidth(pen p=currentpen)'. For convenience,
+ in the module 'plain_pens' we define
+ void defaultpen(real w) {defaultpen(linewidth(w));}
+ pen operator +(pen p, real w) {return p+linewidth(w);}
+ pen operator +(real w, pen p) {return linewidth(w)+p;}
+ so that one may set the line width like this:
+ defaultpen(2);
+ pen p=red+0.5;
+
+ * A pen with a specific 'PostScript' line cap is returned on calling
+ 'linecap' with an integer argument:
+ pen squarecap=linecap(0);
+ pen roundcap=linecap(1);
+ pen extendcap=linecap(2);
+
+ The default line cap, 'roundcap', may be changed with
+ 'defaultpen(pen)'. The line cap of a pen is returned by 'int
+ linecap(pen p=currentpen)'.
+
+ * A pen with a specific 'PostScript' join style is returned on
+ calling 'linejoin' with an integer argument:
+ pen miterjoin=linejoin(0);
+ pen roundjoin=linejoin(1);
+ pen beveljoin=linejoin(2);
+
+ The default join style, 'roundjoin', may be changed with
+ 'defaultpen(pen)'.The join style of a pen is returned by 'int
+ linejoin(pen p=currentpen)'.
+
+ * A pen with a specific 'PostScript' miter limit is returned by
+ calling 'miterlimit(real)'. The default miterlimit, '10.0', may be
+ changed with 'defaultpen(pen)'. The miter limit of a pen is
+ returned by 'real miterlimit(pen p=currentpen)'.
+
+ * A pen with a specific 'PostScript' fill rule is returned on calling
+ 'fillrule' with an integer argument:
+ pen zerowinding=fillrule(0);
+ pen evenodd=fillrule(1);
+
+ The fill rule, which identifies the algorithm used to determine the
+ insideness of a path or array of paths, only affects the 'clip',
+ 'fill', and 'inside' functions. For the 'zerowinding' fill rule, a
+ point 'z' is outside the region bounded by a path if the number of
+ upward intersections of the path with the horizontal line
+ 'z--z+infinity' minus the number of downward intersections is zero.
+ For the 'evenodd' fill rule, 'z' is considered to be outside the
+ region if the total number of such intersections is even. The
+ default fill rule, 'zerowinding', may be changed with
+ 'defaultpen(pen)'. The fill rule of a pen is returned by 'int
+ fillrule(pen p=currentpen)'.
+
+ * A pen with a specific text alignment setting is returned on calling
+ 'basealign' with an integer argument:
+ pen nobasealign=basealign(0);
+ pen basealign=basealign(1);
+
+ The default setting, 'nobasealign',which may be changed with
+ 'defaultpen(pen)', causes the label alignment routines to use the
+ full label bounding box for alignment. In contrast, 'basealign'
+ requests that the TeX baseline be respected. The base align
+ setting of a pen is returned by 'int basealign(pen p=currentpen)'.
+
+ * The font size is specified in TeX points (1 pt = 1/72.27 inches)
+ with the function 'pen fontsize(real size, real
+ lineskip=1.2*size)'. The default font size, 12pt, may be changed
+ with 'defaultpen(pen)'. Nonstandard font sizes may require
+ inserting
+ import fontsize;
+ at the beginning of the file (this requires the 'type1cm' package
+ available from
+ <http://mirror.ctan.org/macros/latex/contrib/type1cm/>
+ and included in recent 'LaTeX' distributions). The font size and
+ line skip of a pen can be examined with the routines 'real
+ fontsize(pen p=currentpen)' and 'real lineskip(pen p=currentpen)',
+ respectively.
+
+ * A pen using a specific LaTeX NFSS font is returned by calling the
+ function 'pen font(string encoding, string family, string series,
+ string shape)'. The default setting, 'font("OT1","cmr","m","n")',
+ corresponds to 12pt Computer Modern Roman; this may be changed with
+ 'defaultpen(pen)'. The font setting of a pen is returned by
+ 'string font(pen p=currentpen)'.
+
+ Alternatively, one may select a fixed-size TeX font (on which
+ 'fontsize' has no effect) like '"cmr12"' (12pt Computer Modern
+ Roman) or '"pcrr"' (Courier) using the function 'pen font(string
+ name)'. An optional size argument can also be given to scale the
+ font to the requested size: 'pen font(string name, real size)'.
+
+ A nonstandard font command can be generated with 'pen
+ fontcommand(string)'.
+
+ A convenient interface to the following standard 'PostScript' fonts
+ is also provided:
+ pen AvantGarde(string series="m", string shape="n");
+ pen Bookman(string series="m", string shape="n");
+ pen Courier(string series="m", string shape="n");
+ pen Helvetica(string series="m", string shape="n");
+ pen NewCenturySchoolBook(string series="m", string shape="n");
+ pen Palatino(string series="m", string shape="n");
+ pen TimesRoman(string series="m", string shape="n");
+ pen ZapfChancery(string series="m", string shape="n");
+ pen Symbol(string series="m", string shape="n");
+ pen ZapfDingbats(string series="m", string shape="n");
+
+ * Starting with the 2018/04/01 release, LaTeX takes UTF-8 as the new
+ default input encoding. However, you can still set different input
+ encoding (so as the font, font encoding or even language context).
+ Here is an example for 'cp1251' and Russian language in Cyrillic
+ script (font encoding 'T2A'):
+ texpreamble("\usepackage[math]{anttor}");
+ texpreamble("\usepackage[T2A]{fontenc}");
+ texpreamble("\usepackage[cp1251]{inputenc}");
+ texpreamble("\usepackage[russian]{babel}");
+ Support for Chinese, Japanese, and Korean fonts is provided by the
+ CJK package:
+ <https://ctan.org/pkg/cjk>
+ The following commands enable the CJK song family (within a label,
+ you can also temporarily switch to another family, say kai, by
+ prepending '"\CJKfamily{kai}"' to the label string):
+ texpreamble("\usepackage{CJK}
+ \AtBeginDocument{\begin{CJK*}{GBK}{song}}
+ \AtEndDocument{\clearpage\end{CJK*}}");
+
+ * The transparency of a pen can be changed with the command:
+ pen opacity(real opacity=1, string blend="Compatible");
+ The opacity can be varied from '0' (fully transparent) to the
+ default value of '1' (opaque), and 'blend' specifies one of the
+ following foreground-background blending operations:
+ "Compatible","Normal","Multiply","Screen","Overlay","SoftLight",
+ "HardLight","ColorDodge","ColorBurn","Darken","Lighten","Difference",
+ "Exclusion","Hue","Saturation","Color","Luminosity",
+ as described in
+ <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf>.
+ Since 'PostScript' does not support transparency, this feature is
+ only effective with the '-f pdf' output format option; other
+ formats can be produced from the resulting PDF file with the
+ 'ImageMagick' 'convert' program. Labels are always drawn with an
+ 'opacity' of 1. A simple example of transparent filling is
+ provided in the example file 'transparency.asy'.
+
+ * 'PostScript' commands within a 'picture' may be used to create a
+ tiling pattern, identified by the string 'name', for 'fill' and
+ 'draw' operations by adding it to the global 'PostScript' frame
+ 'currentpatterns', with optional left-bottom margin 'lb' and
+ right-top margin 'rt'.
+ import patterns;
+ void add(string name, picture pic, pair lb=0, pair rt=0);
+
+ To 'fill' or 'draw' using pattern 'name', use the pen
+ 'pattern("name")'. For example, rectangular tilings can be
+ constructed using the routines 'picture tile(real Hx=5mm, real
+ Hy=0, pen p=currentpen, filltype filltype=NoFill)', 'picture
+ checker(real Hx=5mm, real Hy=0, pen p=currentpen)', and 'picture
+ brick(real Hx=5mm, real Hy=0, pen p=currentpen)' defined in module
+ 'patterns':
+ size(0,90);
+ import patterns;
+
+ add("tile",tile());
+ add("filledtilewithmargin",tile(6mm,4mm,red,Fill),(1mm,1mm),(1mm,1mm));
+ add("checker",checker());
+ add("brick",brick());
+
+ real s=2.5;
+ filldraw(unitcircle,pattern("tile"));
+ filldraw(shift(s,0)*unitcircle,pattern("filledtilewithmargin"));
+ filldraw(shift(2s,0)*unitcircle,pattern("checker"));
+ filldraw(shift(3s,0)*unitcircle,pattern("brick"));
+
+ [./tile]
+
+ Hatch patterns can be generated with the routines 'picture
+ hatch(real H=5mm, pair dir=NE, pen p=currentpen)', 'picture
+ crosshatch(real H=5mm, pen p=currentpen)':
+ size(0,100);
+ import patterns;
+
+ add("hatch",hatch());
+ add("hatchback",hatch(NW));
+ add("crosshatch",crosshatch(3mm));
+
+ real s=1.25;
+ filldraw(unitsquare,pattern("hatch"));
+ filldraw(shift(s,0)*unitsquare,pattern("hatchback"));
+ filldraw(shift(2s,0)*unitsquare,pattern("crosshatch"));
+
+ [./hatch]
+
+ You may need to turn off aliasing in your 'PostScript' viewer for
+ patterns to appear correctly. Custom patterns can easily be
+ constructed, following the examples in module 'patterns'. The
+ tiled pattern can even incorporate shading (*note gradient
+ shading::), as illustrated in this example (not included in the
+ manual because not all printers support 'PostScript' 3):
+ size(0,100);
+ import patterns;
+
+ real d=4mm;
+ picture tiling;
+ path square=scale(d)*unitsquare;
+ axialshade(tiling,square,white,(0,0),black,(d,d));
+ fill(tiling,shift(d,d)*square,blue);
+ add("shadedtiling",tiling);
+
+ filldraw(unitcircle,pattern("shadedtiling"));
+
+
+ * One can specify a custom pen nib as an arbitrary polygonal path
+ with 'pen makepen(path)'; this path represents the mark to be drawn
+ for paths containing a single point. This pen nib path can be
+ recovered from a pen with 'path nib(pen)'. Unlike in 'MetaPost',
+ the path need not be convex:
+
+ size(200);
+ pen convex=makepen(scale(10)*polygon(8))+grey;
+ draw((1,0.4),convex);
+ draw((0,0)---(1,1)..(2,0)--cycle,convex);
+
+ pen nonconvex=scale(10)*
+ makepen((0,0)--(0.25,-1)--(0.5,0.25)--(1,0)--(0.5,1.25)--cycle)+red;
+ draw((0.5,-1.5),nonconvex);
+ draw((0,-1.5)..(1,-0.5)..(2,-1.5),nonconvex);
+
+ [./makepen]
+
+ The value 'nullpath' represents a circular pen nib (the default);
+ an elliptical pen can be achieved simply by multiplying the pen by
+ a transform: 'yscale(2)*currentpen'.
+
+ * One can prevent labels from overwriting one another by using the
+ pen attribute 'overwrite', which takes a single argument:
+
+ 'Allow'
+ Allow labels to overwrite one another. This is the default
+ behaviour (unless overridden with 'defaultpen(pen)'.
+
+ 'Suppress'
+ Suppress, with a warning, each label that would overwrite
+ another label.
+
+ 'SuppressQuiet'
+ Suppress, without warning, each label that would overwrite
+ another label.
+
+ 'Move'
+ Move a label that would overwrite another out of the way and
+ issue a warning. As this adjustment is during the final
+ output phase (in 'PostScript' coordinates) it could result in
+ a larger figure than requested.
+
+ 'MoveQuiet'
+ Move a label that would overwrite another out of the way,
+ without warning. As this adjustment is during the final
+ output phase (in 'PostScript' coordinates) it could result in
+ a larger figure than requested.
+
+ The routine 'defaultpen()' returns the current default pen
+attributes. Calling the routine 'resetdefaultpen()' resets all pen
+default attributes to their initial values.
+
+
+File: asymptote.info, Node: Transforms, Next: Frames and pictures, Prev: Pens, Up: Programming
+
+6.4 Transforms
+==============
+
+'Asymptote' makes extensive use of affine transforms. A pair '(x,y)' is
+transformed by the transform 't=(t.x,t.y,t.xx,t.xy,t.yx,t.yy)' to
+'(x',y')', where
+x' = t.x + t.xx * x + t.xy * y
+y' = t.y + t.yx * x + t.yy * y
+This is equivalent to the 'PostScript' transformation '[t.xx t.yx t.xy
+t.yy t.x t.y]'.
+
+ Transforms can be applied to pairs, guides, paths, pens, strings,
+transforms, frames, and pictures by multiplication (via the binary
+operator '*') on the left (*note circle:: for an example). Transforms
+can be composed with one another and inverted with the function
+'transform inverse(transform t)'; they can also be raised to any integer
+power with the '^' operator.
+
+ The built-in transforms are:
+
+'transform identity;'
+ the identity transform;
+'transform shift(pair z);'
+ translates by the pair 'z';
+'transform shift(real x, real y);'
+ translates by the pair '(x,y)';
+'transform xscale(real x);'
+ scales by 'x' in the x direction;
+'transform yscale(real y);'
+ scales by 'y' in the y direction;
+'transform scale(real s);'
+ scale by 's' in both x and y directions;
+'transform scale(real x, real y);'
+ scale by 'x' in the x direction and by 'y' in the y direction;
+'transform slant(real s);'
+ maps '(x,y)' -> '(x+s*y,y)';
+'transform rotate(real angle, pair z=(0,0));'
+ rotates by 'angle' in degrees about 'z';
+'transform reflect(pair a, pair b);'
+ reflects about the line 'a--b'.
+'transform zeroTransform;'
+ the zero transform;
+
+ The implicit initializer for transforms is 'identity()'. The
+routines 'shift(transform t)' and 'shiftless(transform t)' return the
+transforms '(t.x,t.y,0,0,0,0)' and '(0,0,t.xx,t.xy,t.yx,t.yy)'
+respectively. The function 'bool isometry(transform t)' can be used to
+test if 't' is an isometry (preserves distance).
+
+
+File: asymptote.info, Node: Frames and pictures, Next: Files, Prev: Transforms, Up: Programming
+
+6.5 Frames and pictures
+=======================
+
+'frame'
+ Frames are canvases for drawing in 'PostScript' coordinates. While
+ working with frames directly is occasionally necessary for
+ constructing deferred drawing routines, pictures are usually more
+ convenient to work with. The implicit initializer for frames is
+ 'newframe'. The function 'bool empty(frame f)' returns 'true' only
+ if the frame 'f' is empty. A frame may be erased with the
+ 'erase(frame)' routine. The functions 'pair min(frame)' and 'pair
+ max(frame)' return the (left,bottom) and (right,top) coordinates of
+ the frame bounding box, respectively. The contents of frame 'src'
+ may be appended to frame 'dest' with the command
+ void add(frame dest, frame src);
+ or prepended with
+ void prepend(frame dest, frame src);
+ A frame obtained by aligning frame 'f' in the direction 'align', in
+ a manner analogous to the 'align' argument of 'label' (*note
+ label::), is returned by
+ frame align(frame f, pair align);
+
+ To draw or fill a box or ellipse around a label or frame and return
+ the boundary as a path, use one of the predefined 'envelope'
+ routines
+ path box(frame f, Label L="", real xmargin=0,
+ real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+ path roundbox(frame f, Label L="", real xmargin=0,
+ real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+ path ellipse(frame f, Label L="", real xmargin=0,
+ real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill, bool above=true);
+
+'picture'
+ Pictures are high-level structures (*note Structures::) defined in
+ the module 'plain' that provide canvases for drawing in user
+ coordinates. The default picture is called 'currentpicture'. A
+ new picture can be created like this:
+ picture pic;
+ Anonymous pictures can be made by the expression 'new picture'.
+
+ The 'size' routine specifies the dimensions of the desired picture:
+
+ void size(picture pic=currentpicture, real x, real y=x,
+ bool keepAspect=Aspect);
+
+ If the 'x' and 'y' sizes are both 0, user coordinates will be
+ interpreted as 'PostScript' coordinates. In this case, the
+ transform mapping 'pic' to the final output frame is 'identity()'.
+
+ If exactly one of 'x' or 'y' is 0, no size restriction is imposed
+ in that direction; it will be scaled the same as the other
+ direction.
+
+ If 'keepAspect' is set to 'Aspect' or 'true', the picture will be
+ scaled with its aspect ratio preserved such that the final width is
+ no more than 'x' and the final height is no more than 'y'.
+
+ If 'keepAspect' is set to 'IgnoreAspect' or 'false', the picture
+ will be scaled in both directions so that the final width is 'x'
+ and the height is 'y'.
+
+ To make the user coordinates of picture 'pic' represent multiples
+ of 'x' units in the x direction and 'y' units in the y direction,
+ use
+ void unitsize(picture pic=currentpicture, real x, real y=x);
+ When nonzero, these 'x' and 'y' values override the corresponding
+ size parameters of picture 'pic'.
+
+ The routine
+ void size(picture pic=currentpicture, real xsize, real ysize,
+ pair min, pair max);
+ forces the final picture scaling to map the user coordinates
+ 'box(min,max)' to a region of width 'xsize' and height 'ysize'
+ (when these parameters are nonzero).
+
+ Alternatively, calling the routine
+ transform fixedscaling(picture pic=currentpicture, pair min,
+ pair max, pen p=nullpen, bool warn=false);
+ will cause picture 'pic' to use a fixed scaling to map user
+ coordinates in 'box(min,max)' to the (already specified) picture
+ size, taking account of the width of pen 'p'. A warning will be
+ issued if the final picture exceeds the specified size.
+
+ A picture 'pic' can be fit to a frame and output to a file
+ 'prefix'.'format' using image format 'format' by calling the
+ 'shipout' function:
+ void shipout(string prefix=defaultfilename, picture pic=currentpicture,
+ orientation orientation=orientation,
+ string format="", bool wait=false, bool view=true,
+ string options="", string script="",
+ light light=currentlight, projection P=currentprojection)
+ The default output format, 'PostScript', may be changed with the
+ '-f' or '-tex' command-line options. The 'options', 'script', and
+ 'projection' parameters are only relevant for 3D pictures. If
+ 'defaultfilename' is an empty string, the prefix 'outprefix()' will
+ be used.
+
+ A 'shipout()' command is added implicitly at file exit if no
+ previous 'shipout' commands have been executed. The default page
+ orientation is 'Portrait'; this may be modified by changing the
+ variable 'orientation'. To output in landscape mode, simply set
+ the variable 'orientation=Landscape' or issue the command
+ shipout(Landscape);
+
+ To rotate the page by -90 degrees, use the orientation 'Seascape'.
+ The orientation 'UpsideDown' rotates the page by 180 degrees.
+
+ A picture 'pic' can be explicitly fit to a frame by calling
+ frame pic.fit(real xsize=pic.xsize, real ysize=pic.ysize,
+ bool keepAspect=pic.keepAspect);
+ The default size and aspect ratio settings are those given to the
+ 'size' command (which default to '0', '0', and 'true',
+ respectively). The transformation that would currently be used to
+ fit a picture 'pic' to a frame is returned by the member function
+ 'pic.calculateTransform()'.
+
+ In certain cases (e.g. 2D graphs) where only an approximate size
+ estimate for 'pic' is available, the picture fitting routine
+ frame pic.scale(real xsize=this.xsize, real ysize=this.ysize,
+ bool keepAspect=this.keepAspect);
+ (which scales the resulting frame, including labels and fixed-size
+ objects) will enforce perfect compliance with the requested size
+ specification, but should not normally be required.
+
+ To draw a bounding box with margins around a picture, fit the
+ picture to a frame using the function
+ frame bbox(picture pic=currentpicture, real xmargin=0,
+ real ymargin=xmargin, pen p=currentpen,
+ filltype filltype=NoFill);
+ Here 'filltype' specifies one of the following fill types:
+ 'FillDraw'
+ Fill the interior and draw the boundary.
+
+ 'FillDraw(real xmargin=0, real ymargin=xmargin, pen fillpen=nullpen,'
+ 'pen drawpen=nullpen)' If 'fillpen' is 'nullpen', fill with
+ the drawing pen; otherwise fill with pen 'fillpen'. If
+ 'drawpen' is 'nullpen', draw the boundary with 'fillpen';
+ otherwise with 'drawpen'. An optional margin of 'xmargin' and
+ 'ymargin' can be specified.
+
+ 'Fill'
+ Fill the interior.
+
+ 'Fill(real xmargin=0, real ymargin=xmargin, pen p=nullpen)'
+ If 'p' is 'nullpen', fill with the drawing pen; otherwise fill
+ with pen 'p'. An optional margin of 'xmargin' and 'ymargin'
+ can be specified.
+
+ 'NoFill'
+ Do not fill.
+
+ 'Draw'
+ Draw only the boundary.
+
+ 'Draw(real xmargin=0, real ymargin=xmargin, pen p=nullpen)'
+ If 'p' is 'nullpen', draw the boundary with the drawing pen;
+ otherwise draw with pen 'p'. An optional margin of 'xmargin'
+ and 'ymargin' can be specified.
+
+ 'UnFill'
+ Clip the region.
+
+ 'UnFill(real xmargin=0, real ymargin=xmargin)'
+ Clip the region and surrounding margins 'xmargin' and
+ 'ymargin'.
+
+ 'RadialShade(pen penc, pen penr)'
+ Fill varying radially from 'penc' at the center of the
+ bounding box to 'penr' at the edge.
+
+ 'RadialShadeDraw(real xmargin=0, real ymargin=xmargin, pen penc,'
+ 'pen penr, pen drawpen=nullpen)' Fill with RadialShade and
+ draw the boundary.
+
+ For example, to draw a bounding box around a picture with a 0.25 cm
+ margin and output the resulting frame, use the command:
+ shipout(bbox(0.25cm));
+ A 'picture' may be fit to a frame with the background color pen
+ 'p', using the function 'bbox(p,Fill)'.
+
+ To pad a picture to a precise size in both directions, fit the
+ picture to a frame using the function
+ frame pad(picture pic=currentpicture, real xsize=pic.xsize,
+ real ysize=pic.ysize, filltype filltype=NoFill);
+
+ The functions
+ pair min(picture pic, user=false);
+ pair max(picture pic, user=false);
+ pair size(picture pic, user=false);
+ calculate the bounds that picture 'pic' would have if it were
+ currently fit to a frame using its default size specification. If
+ 'user' is 'false' the returned value is in 'PostScript'
+ coordinates, otherwise it is in user coordinates.
+
+ The function
+ pair point(picture pic=currentpicture, pair dir, bool user=true);
+ is a convenient way of determining the point on the bounding box of
+ 'pic' in the direction 'dir' relative to its center, ignoring the
+ contributions from fixed-size objects (such as labels and
+ arrowheads). If 'user' is 'true' the returned value is in user
+ coordinates, otherwise it is in 'PostScript' coordinates.
+
+ The function
+ pair truepoint(picture pic=currentpicture, pair dir, bool user=true);
+ is identical to 'point', except that it also accounts for
+ fixed-size objects, using the scaling transform that picture 'pic'
+ would have if currently fit to a frame using its default size
+ specification. If 'user' is 'true' the returned value is in user
+ coordinates, otherwise it is in 'PostScript' coordinates.
+
+ Sometimes it is useful to draw objects on separate pictures and add
+ one picture to another using the 'add' function:
+ void add(picture src, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+ void add(picture dest, picture src, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+ The first example adds 'src' to 'currentpicture'; the second one
+ adds 'src' to 'dest'. The 'group' option specifies whether or not
+ the graphical user interface should treat all of the elements of
+ 'src' as a single entity (*note GUI::), 'filltype' requests
+ optional background filling or clipping, and 'above' specifies
+ whether to add 'src' above or below existing objects.
+
+ There are also routines to add a picture or frame 'src' specified
+ in postscript coordinates to another picture 'dest' (or
+ 'currentpicture') about the user coordinate 'position':
+ void add(picture src, pair position, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+ void add(picture dest, picture src, pair position,
+ bool group=true, filltype filltype=NoFill, bool above=true);
+ void add(picture dest=currentpicture, frame src, pair position=0,
+ bool group=true, filltype filltype=NoFill, bool above=true);
+ void add(picture dest=currentpicture, frame src, pair position,
+ pair align, bool group=true, filltype filltype=NoFill,
+ bool above=true);
+
+ The optional 'align' argument in the last form specifies a
+ direction to use for aligning the frame, in a manner analogous to
+ the 'align' argument of 'label' (*note label::). However, one key
+ difference is that when 'align' is not specified, labels are
+ centered, whereas frames and pictures are aligned so that their
+ origin is at 'position'. Illustrations of frame alignment can be
+ found in the examples *note errorbars:: and *note image::. If you
+ want to align three or more subpictures, group them two at a time:
+
+ picture pic1;
+ real size=50;
+ size(pic1,size);
+ fill(pic1,(0,0)--(50,100)--(100,0)--cycle,red);
+
+ picture pic2;
+ size(pic2,size);
+ fill(pic2,unitcircle,green);
+
+ picture pic3;
+ size(pic3,size);
+ fill(pic3,unitsquare,blue);
+
+ picture pic;
+ add(pic,pic1.fit(),(0,0),N);
+ add(pic,pic2.fit(),(0,0),10S);
+
+ add(pic.fit(),(0,0),N);
+ add(pic3.fit(),(0,0),10S);
+
+
+ [./subpictures]
+
+ Alternatively, one can use 'attach' to automatically increase the
+ size of picture 'dest' to accommodate adding a frame 'src' about
+ the user coordinate 'position':
+ void attach(picture dest=currentpicture, frame src,
+ pair position=0, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+ void attach(picture dest=currentpicture, frame src,
+ pair position, pair align, bool group=true,
+ filltype filltype=NoFill, bool above=true);
+
+ To erase the contents of a picture (but not the size
+ specification), use the function
+ void erase(picture pic=currentpicture);
+
+ To save a snapshot of 'currentpicture', 'currentpen', and
+ 'currentprojection', use the function 'save()'.
+
+ To restore a snapshot of 'currentpicture', 'currentpen', and
+ 'currentprojection', use the function 'restore()'.
+
+ Many further examples of picture and frame operations are provided
+ in the base module 'plain'.
+
+ It is possible to insert verbatim 'PostScript' commands in a
+ picture with one of the routines
+ void postscript(picture pic=currentpicture, string s);
+ void postscript(picture pic=currentpicture, string s, pair min,
+ pair max)
+ Here 'min' and 'max' can be used to specify explicit bounds
+ associated with the resulting 'PostScript' code.
+
+ Verbatim TeX commands can be inserted in the intermediate 'LaTeX'
+ output file with one of the functions
+ void tex(picture pic=currentpicture, string s);
+ void tex(picture pic=currentpicture, string s, pair min, pair max)
+ Here 'min' and 'max' can be used to specify explicit bounds
+ associated with the resulting TeX code.
+
+ To issue a global TeX command (such as a TeX macro definition) in
+ the TeX preamble (valid for the remainder of the top-level module)
+ use:
+ void texpreamble(string s);
+
+ The TeX environment can be reset to its initial state, clearing all
+ macro definitions, with the function
+ void texreset();
+
+ The routine
+ void usepackage(string s, string options="");
+ provides a convenient abbreviation for
+ texpreamble("\usepackage["+options+"]{"+s+"}");
+ that can be used for importing 'LaTeX' packages.
+
+
+File: asymptote.info, Node: Files, Next: Variable initializers, Prev: Frames and pictures, Up: Programming
+
+6.6 Files
+=========
+
+'Asymptote' can read and write text files (including comma-separated
+value) files and portable XDR (External Data Representation) binary
+files.
+
+ An input file can be opened with
+input(string name="", bool check=true, string comment="#", string mode="");
+ reading is then done by assignment:
+file fin=input("test.txt");
+real a=fin;
+
+ If the optional boolean argument 'check' is 'false', no check will be
+made that the file exists. If the file does not exist or is not
+readable, the function 'bool error(file)' will return 'true'. The first
+character of the string 'comment' specifies a comment character. If
+this character is encountered in a data file, the remainder of the line
+is ignored. When reading strings, a comment character followed
+immediately by another comment character is treated as a single literal
+comment character. If 'Asymptote' is compiled with support for
+'libcurl', 'name' can be a URL.
+
+ Unless the '-noglobalread' command-line option is specified, one can
+change the current working directory for read operations to the contents
+of the string 's' with the function 'string cd(string s)', which returns
+the new working directory. If 'string s' is empty, the path is reset to
+the value it had at program startup.
+
+ When reading pairs, the enclosing parenthesis are optional. Strings
+are also read by assignment, by reading characters up to but not
+including a newline. In addition, 'Asymptote' provides the function
+'string getc(file)' to read the next character (treating the comment
+character as an ordinary character) and return it as a string.
+
+ A file named 'name' can be open for output with
+file output(string name="", bool update=false, string comment="#", string mode="");
+If 'update=false', any existing data in the file will be erased and only
+write operations can be used on the file. If 'update=true', any
+existing data will be preserved, the position will be set to the
+end-of-file, and both reading and writing operations will be enabled.
+For security reasons, writing to files in directories other than the
+current directory is allowed only if the '-globalwrite' (or '-nosafe')
+command-line option is specified. Reading from files in other
+directories is allowed unless the '-noglobalread' command-line option is
+specified. The function 'string mktemp(string s)' may be used to create
+and return the name of a unique temporary file in the current directory
+based on the string 's'.
+
+ There are two special files: 'stdin', which reads from the keyboard,
+and 'stdout', which writes to the terminal. The implicit initializer
+for files is 'null'.
+
+ Data of a built-in type 'T' can be written to an output file by
+calling one of the functions
+write(string s="", T x, suffix suffix=endl ... T[]);
+write(file file, string s="", T x, suffix suffix=none ... T[]);
+write(file file=stdout, string s="", explicit T[] x ... T[][]);
+write(file file=stdout, T[][]);
+write(file file=stdout, T[][][]);
+write(suffix suffix=endl);
+write(file file, suffix suffix=none);
+ If 'file' is not specified, 'stdout' is used and terminated by
+default with a newline. If specified, the optional identifying string
+'s' is written before the data 'x'. An arbitrary number of data values
+may be listed when writing scalars or one-dimensional arrays. The
+'suffix' may be one of the following: 'none' (do nothing), 'flush'
+(output buffered data), 'endl' (terminate with a newline and flush),
+'newl' (terminate with a newline), 'DOSendl' (terminate with a DOS
+newline and flush), 'DOSnewl' (terminate with a DOS newline), 'tab'
+(terminate with a tab), or 'comma' (terminate with a comma). Here are
+some simple examples of data output:
+file fout=output("test.txt");
+write(fout,1); // Writes "1"
+write(fout); // Writes a new line
+write(fout,"List: ",1,2,3); // Writes "List: 1 2 3"
+
+ A file may be opened with 'mode="xdr"', to read or write double
+precision (64-bit) reals and single precision (32-bit) integers in Sun
+Microsystem's XDR (External Data Representation) portable binary format
+(available on all 'UNIX' platforms). Alternatively, a file may also be
+opened with 'mode="binary"' to read or write double precision reals and
+single precision integers in the native (nonportable) machine binary
+format, or to read the entire file into a string. The virtual member
+functions 'file singlereal(bool b=true)' and 'file singleint(bool
+b=true)' be used to change the precision of real and integer I/O
+operations, respectively, for an XDR or binary file 'f'. Similarly, the
+function 'file signedint(bool b=true)' can be used to modify the
+signedness of integer reads and writes for an XDR or binary file 'f'.
+
+ The virtual members 'name', 'mode', 'singlereal', 'singleint', and
+'signedint' may be used to query the respective parameters for a given
+file.
+
+ One can test a file for end-of-file with the boolean function
+'eof(file)', end-of-line with 'eol(file)', and for I/O errors with
+'error(file)'. One can flush the output buffers with 'flush(file)',
+clear a previous I/O error with 'clear(file)', and close the file with
+'close(file)'. The function 'int precision(file file=stdout, int
+digits=0)' sets the number of digits of output precision for 'file' to
+'digits', provided 'digits' is nonzero, and returns the previous
+precision setting. The function 'int tell(file)' returns the current
+position in a file relative to the beginning. The routine 'seek(file
+file, int pos)' can be used to change this position, where a negative
+value for the position 'pos' is interpreted as relative to the
+end-of-file. For example, one can rewind a file 'file' with the command
+'seek(file,0)' and position to the final character in the file with
+'seek(file,-1)'. The command 'seekeof(file)' sets the position to the
+end of the file.
+
+ Assigning 'settings.scroll=n' for a positive integer 'n' requests a
+pause after every 'n' output lines to 'stdout'. One may then press
+'Enter' to continue to the next 'n' output lines, 's' followed by
+'Enter' to scroll without further interruption, or 'q' followed by
+'Enter' to quit the current output operation. If 'n' is negative, the
+output scrolls a page at a time (i.e. by one less than the current
+number of display lines). The default value, 'settings.scroll=0',
+specifies continuous scrolling.
+
+ The routines
+string getstring(string name="", string default="", string prompt="",
+ bool store=true);
+int getint(string name="", int default=0, string prompt="",
+ bool store=true);
+real getreal(string name="", real default=0, string prompt="",
+ bool store=true);
+pair getpair(string name="", pair default=0, string prompt="",
+ bool store=true);
+triple gettriple(string name="", triple default=(0,0,0), string prompt="",
+ bool store=true);
+defined in the module 'plain' may be used to prompt for a value from
+'stdin' using the GNU 'readline' library. If 'store=true', the history
+of values for 'name' is stored in the file '".asy_history_"+name' (*note
+history::). The most recent value in the history will be used to
+provide a default value for subsequent runs. The default value
+(initially 'default') is displayed after 'prompt'. These functions are
+based on the internal routines
+string readline(string prompt="", string name="", bool tabcompletion=false);
+void saveline(string name, string value, bool store=true);
+ Here, 'readline' prompts the user with the default value formatted
+according to 'prompt', while 'saveline' is used to save the string
+'value' in a local history named 'name', optionally storing the local
+history in a file '".asy_history_"+name'.
+
+ The routine 'history(string name, int n=1)' can be used to look up
+the 'n' most recent values (or all values up to 'historylines' if 'n=0')
+entered for string 'name'. The routine 'history(int n=0)' returns the
+interactive history. For example,
+write(output("transcript.asy"),history());
+outputs the interactive history to the file 'transcript.asy'.
+
+ The function 'int delete(string s)' deletes the file named by the
+string 's'. Unless the '-globalwrite' (or '-nosafe') option is enabled,
+the file must reside in the current directory. The function 'int
+rename(string from, string to)' may be used to rename file 'from' to
+file 'to'. Unless the '-globalwrite' (or '-nosafe') option is enabled,
+this operation is restricted to the current directory. The functions
+int convert(string args="", string file="", string format="");
+int animate(string args="", string file="", string format="");
+call the 'ImageMagick' commands 'convert' and 'animate', respectively,
+with the arguments 'args' and the file name constructed from the strings
+'file' and 'format'.
+
+
+File: asymptote.info, Node: Variable initializers, Next: Structures, Prev: Files, Up: Programming
+
+6.7 Variable initializers
+=========================
+
+A variable can be assigned a value when it is declared, as in 'int x=3;'
+where the variable 'x' is assigned the value '3'. As well as literal
+constants such as '3', arbitary expressions can be used as initializers,
+as in 'real x=2*sin(pi/2);'.
+
+ A variable is not added to the namespace until after the initializer
+is evaluated, so for example, in
+int x=2;
+int x=5*x;
+the 'x' in the initializer on the second line refers to the variable 'x'
+declared on the first line. The second line, then, declares a variable
+'x' shadowing the original 'x' and initializes it to the value '10'.
+
+ Variables of most types can be declared without an explicit
+initializer and they will be initialized by the default initializer of
+that type:
+
+ * Variables of the numeric types 'int', 'real', and 'pair' are all
+ initialized to zero; variables of type 'triple' are initialized to
+ 'O=(0,0,0)'.
+ * 'boolean' variables are initialized to 'false'.
+ * 'string' variables are initialized to the empty string.
+ * 'transform' variables are initialized to the identity
+ transformation.
+ * 'path' and 'guide' variables are initialized to 'nullpath'.
+ * 'pen' variables are initialized to the default pen.
+ * 'frame' and 'picture' variables are initialized to empty frames and
+ pictures, respectively.
+ * 'file' variables are initialized to 'null'.
+
+ The default initializers for user-defined array, structure, and
+function types are explained in their respective sections. Some types,
+such as 'code', do not have default initializers. When a variable of
+such a type is introduced, the user must initialize it by explicitly
+giving it a value.
+
+ The default initializer for any type 'T' can be redeclared by
+defining the function 'T operator init()'. For instance, 'int'
+variables are usually initialized to zero, but in
+int operator init() {
+ return 3;
+}
+int y;
+
+the variable 'y' is initialized to '3'. This example was given for
+illustrative purposes; redeclaring the initializers of built-in types is
+not recommended. Typically, 'operator init' is used to define sensible
+defaults for user-defined types.
+
+ The special type 'var' may be used to infer the type of a variable
+from its initializer. If the initializer is an expression of a unique
+type, then the variable will be defined with that type. For instance,
+var x=5;
+var y=4.3;
+var reddash=red+dashed;
+is equivalent to
+int x=5;
+real y=4.3;
+pen reddash=red+dashed;
+
+ 'var' may also be used with the extended 'for' loop syntax.
+
+int[] a = {1,2,3};
+for (var x : a)
+ write(x);
+
+
+File: asymptote.info, Node: Structures, Next: Operators, Prev: Variable initializers, Up: Programming
+
+6.8 Structures
+==============
+
+Users may also define their own data types as structures, along with
+user-defined operators, much as in C++. By default, structure members
+are 'public' (may be read and modified anywhere in the code), but may be
+optionally declared 'restricted' (readable anywhere but writeable only
+inside the structure where they are defined) or 'private' (readable and
+writable only inside the structure). In a structure definition, the
+keyword 'this' can be used as an expression to refer to the enclosing
+structure. Any code at the top-level scope within the structure is
+executed on initialization.
+
+ Variables hold references to structures. That is, in the example:
+struct T {
+ int x;
+}
+
+T foo;
+T bar=foo;
+bar.x=5;
+
+ The variable 'foo' holds a reference to an instance of the structure
+'T'. When 'bar' is assigned the value of 'foo', it too now holds a
+reference to the same instance as 'foo' does. The assignment 'bar.x=5'
+changes the value of the field 'x' in that instance, so that 'foo.x'
+will also be equal to '5'.
+
+ The expression 'new T' creates a new instance of the structure 'T'
+and returns a reference to that instance. In creating the new instance,
+any code in the body of the record definition is executed. For example:
+int Tcount=0;
+struct T {
+ int x;
+ ++Tcount;
+}
+
+T foo=new T;
+T foo;
+Here, 'new T' produces a new instance of the class, which causes
+'Tcount' to be incremented, tracking the number of instances produced.
+The declarations 'T foo=new T' and 'T foo' are equivalent: the second
+form implicitly creates a new instance of 'T'. That is, after the
+definition of a structure 'T', a variable of type 'T' is initialized to
+a new instance ('new T') by default. During the definition of the
+structure, however, variables of type 'T' are initialized to 'null' by
+default. This special behaviour is to avoid infinite recursion of
+creating new instances in code such as
+struct tree {
+ int value;
+ tree left;
+ tree right;
+}
+
+ The expression 'null' can be cast to any structure type to yield a
+null reference, a reference that does not actually refer to any instance
+of the structure. Trying to use a field of a null reference will cause
+an error.
+
+ The function 'bool alias(T,T)' checks to see if two structure
+references refer to the same instance of the structure (or both to
+'null'). In example at the beginning of this section, 'alias(foo,bar)'
+would return true, but 'alias(foo,new T)' would return false, as 'new T'
+creates a new instance of the structure 'T'. The boolean operators '=='
+and '!=' are by default equivalent to 'alias' and '!alias' respectively,
+but may be overwritten for a particular type (for example, to do a deep
+comparison).
+
+ Here is a simple example that illustrates the use of structures:
+struct S {
+ real a=1;
+ real f(real a) {return a+this.a;}
+}
+
+S s; // Initializes s with new S;
+
+write(s.f(2)); // Outputs 3
+
+S operator + (S s1, S s2)
+{
+ S result;
+ result.a=s1.a+s2.a;
+ return result;
+}
+
+write((s+s).f(0)); // Outputs 2
+
+
+ It is often convenient to have functions that construct new instances
+of a structure. Say we have a 'Person' structure:
+struct Person {
+ string firstname;
+ string lastname;
+}
+
+Person joe;
+joe.firstname="Joe";
+joe.lastname="Jones";
+Creating a new Person is a chore; it takes three lines to create a new
+instance and to initialize its fields (that's still considerably less
+effort than creating a new person in real life, though).
+
+ We can reduce the work by defining a constructor function
+'Person(string,string)':
+struct Person {
+ string firstname;
+ string lastname;
+
+ static Person Person(string firstname, string lastname) {
+ Person p=new Person;
+ p.firstname=firstname;
+ p.lastname=lastname;
+ return p;
+ }
+}
+
+Person joe=Person.Person("Joe", "Jones");
+
+ While it is now easier than before to create a new instance, we still
+have to refer to the constructor by the qualified name 'Person.Person'.
+If we add the line
+from Person unravel Person;
+immediately after the structure definition, then the constructor can be
+used without qualification: 'Person joe=Person("Joe", "Jones");'.
+
+ The constructor is now easy to use, but it is quite a hassle to
+define. If you write a lot of constructors, you will find that you are
+repeating a lot of code in each of them. Fortunately, your friendly
+neighbourhood Asymptote developers have devised a way to automate much
+of the process.
+
+ If, in the body of a structure, Asymptote encounters the definition
+of a function of the form 'void operator init(ARGS)', it implicitly
+defines a constructor function of the arguments 'ARGS' that uses the
+'void operator init' function to initialize a new instance of the
+structure. That is, it essentially defines the following constructor
+(assuming the structure is called 'Foo'):
+
+ static Foo Foo(ARGS) {
+ Foo instance=new Foo;
+ instance.operator init(ARGS);
+ return instance;
+ }
+
+ This constructor is also implicitly copied to the enclosing scope
+after the end of the structure definition, so that it can used
+subsequently without qualifying it by the structure name. Our 'Person'
+example can thus be implemented as:
+struct Person {
+ string firstname;
+ string lastname;
+
+ void operator init(string firstname, string lastname) {
+ this.firstname=firstname;
+ this.lastname=lastname;
+ }
+}
+
+Person joe=Person("Joe", "Jones");
+
+ The use of 'operator init' to implicitly define constructors should
+not be confused with its use to define default values for variables
+(*note Variable initializers::). Indeed, in the first case, the return
+type of the 'operator init' must be 'void' while in the second, it must
+be the (non-'void') type of the variable.
+
+ The function 'cputime()' returns a structure 'cputime' with
+cumulative CPU times broken down into the fields 'parent.user',
+'parent.system', 'child.user', and 'child.system', along with the
+cumulative wall clock time in 'parent.clock', all measured in seconds.
+For convenience, the incremental fields 'change.user', 'change.system',
+and 'change.clock' indicate the change in the corresponding fields since
+the last call to 'cputime()'. The function
+void write(file file=stdout, string s="", cputime c,
+ string format=cputimeformat, suffix suffix=none);
+displays the incremental user cputime followed by "u", the incremental
+system cputime followed by "s", the total user cputime followed by "U",
+and the total system cputime followed by "S".
+
+ Much like in C++, casting (*note Casts::) provides for an elegant
+implementation of structure inheritance, including virtual functions:
+struct parent {
+ real x;
+ void operator init(int x) {this.x=x;}
+ void virtual(int) {write(0);}
+ void f() {virtual(1);}
+}
+
+void write(parent p) {write(p.x);}
+
+struct child {
+ parent parent;
+ real y=3;
+ void operator init(int x) {parent.operator init(x);}
+ void virtual(int x) {write(x);}
+ parent.virtual=virtual;
+ void f()=parent.f;
+}
+
+parent operator cast(child child) {return child.parent;}
+
+parent p=parent(1);
+child c=child(2);
+
+write(c); // Outputs 2;
+
+p.f(); // Outputs 0;
+c.f(); // Outputs 1;
+
+write(c.parent.x); // Outputs 2;
+write(c.y); // Outputs 3;
+
+ For further examples of structures, see 'Legend' and 'picture' in the
+'Asymptote' base module 'plain'.
+
+
+File: asymptote.info, Node: Operators, Next: Implicit scaling, Prev: Structures, Up: Programming
+
+6.9 Operators
+=============
+
+* Menu:
+
+* Arithmetic & logical:: Basic mathematical operators
+* Self & prefix operators:: Increment and decrement
+* User-defined operators:: Overloading operators
+
+
+File: asymptote.info, Node: Arithmetic & logical, Next: Self & prefix operators, Prev: Operators, Up: Operators
+
+6.9.1 Arithmetic & logical operators
+------------------------------------
+
+'Asymptote' uses the standard binary arithmetic operators. However,
+when one integer is divided by another, both arguments are converted to
+real values before dividing and a real quotient is returned (since this
+is typically what is intended; otherwise one can use the function 'int
+quotient(int x, int y)', which returns greatest integer less than or
+equal to 'x/y'). In all other cases both operands are promoted to the
+same type, which will also be the type of the result:
+'+'
+ addition
+'-'
+ subtraction
+'*'
+ multiplication
+'/'
+ division
+'#'
+ integer division; equivalent to 'quotient(x,y)'. Noting that the
+ 'Python3' community adopted our comment symbol ('//') for integer
+ division, we decided to reciprocate and use their comment symbol
+ for integer division in 'Asymptote'!
+'%'
+ modulo; the result always has the same sign as the divisor. In
+ particular, this makes 'q*(p # q)+p % q == p' for all integers 'p'
+ and nonzero integers 'q'.
+'^'
+ power; if the exponent (second argument) is an int, recursive
+ multiplication is used; otherwise, logarithms and exponentials are
+ used ('**' is a synonym for '^').
+
+ The usual boolean operators are also defined:
+'=='
+ equals
+'!='
+ not equals
+'<'
+ less than
+'<='
+ less than or equals
+'>='
+ greater than or equals
+'>'
+ greater than
+'&&'
+ and (with conditional evaluation of right-hand argument)
+'&'
+ and
+'||'
+ or (with conditional evaluation of right-hand argument)
+'|'
+ or
+'^'
+ xor
+'!'
+ not
+
+ 'Asymptote' also supports the C-like conditional syntax:
+bool positive=(pi > 0) ? true : false;
+
+ The function 'T interp(T a, T b, real t)' returns '(1-t)*a+t*b' for
+nonintegral built-in arithmetic types 'T'. If 'a' and 'b' are pens,
+they are first promoted to the same color space.
+
+ 'Asymptote' also defines bitwise functions 'int AND(int,int)', 'int
+OR(int,int)', 'int XOR(int,int)', 'int NOT(int)', 'int CLZ(int)' (count
+leading zeros), 'int CTZ(int)' (count trailing zeros), 'int
+popcount(int)' (count bits populated by ones), and 'int bitreverse(int
+a, int bits)' (reverse bits within a word of length bits).
+
+
+File: asymptote.info, Node: Self & prefix operators, Next: User-defined operators, Prev: Arithmetic & logical, Up: Operators
+
+6.9.2 Self & prefix operators
+-----------------------------
+
+As in C, each of the arithmetic operators '+', '-', '*', '/', '#', '%',
+and '^' can be used as a self operator. The prefix operators '++'
+(increment by one) and '--' (decrement by one) are also defined. For
+example,
+int i=1;
+i += 2;
+int j=++i;
+
+is equivalent to the code
+int i=1;
+i=i+2;
+int j=i=i+1;
+
+ However, postfix operators like 'i++' and 'i--' are not defined
+(because of the inherent ambiguities that would arise with the '--'
+path-joining operator). In the rare instances where 'i++' and 'i--' are
+really needed, one can substitute the expressions '(++i-1)' and
+'(--i+1)', respectively.
+
+
+File: asymptote.info, Node: User-defined operators, Prev: Self & prefix operators, Up: Operators
+
+6.9.3 User-defined operators
+----------------------------
+
+The following symbols may be used with 'operator' to define or redefine
+operators on structures and built-in types:
+- + * / % ^ ! < > == != <= >= & | ^^ .. :: -- --- ++
+<< >> $ $$ @ @@ <>
+The operators on the second line have precedence one higher than the
+boolean operators '<', '>', '<=', and '>='.
+
+ Guide operators like '..' may be overloaded, say, to write a user
+function that produces a new guide from a given guide:
+guide dots(... guide[] g)=operator ..;
+
+guide operator ..(... guide[] g) {
+ guide G;
+ if(g.length > 0) {
+ write(g[0]);
+ G=g[0];
+ }
+ for(int i=1; i < g.length; ++i) {
+ write(g[i]);
+ write();
+ G=dots(G,g[i]);
+ }
+ return G;
+}
+
+guide g=(0,0){up}..{SW}(100,100){NE}..{curl 3}(50,50)..(10,10);
+write("g=",g);
+
+
+File: asymptote.info, Node: Implicit scaling, Next: Functions, Prev: Operators, Up: Programming
+
+6.10 Implicit scaling
+=====================
+
+If a numeric literal is in front of certain types of expressions, then
+the two are multiplied:
+int x=2;
+real y=2.0;
+real cm=72/2.540005;
+
+write(3x);
+write(2.5x);
+write(3y);
+write(-1.602e-19 y);
+write(0.5(x,y));
+write(2x^2);
+write(3x+2y);
+write(3(x+2y));
+write(3sin(x));
+write(3(sin(x))^2);
+write(10cm);
+
+ This produces the output
+6
+5
+6
+-3.204e-19
+(1,1)
+8
+10
+18
+2.72789228047704
+2.48046543129542
+283.464008929116
+
+
+File: asymptote.info, Node: Functions, Next: Arrays, Prev: Implicit scaling, Up: Programming
+
+6.11 Functions
+==============
+
+* Menu:
+
+* Default arguments:: Default values can appear anywhere
+* Named arguments:: Assigning function arguments by keyword
+* Rest arguments:: Functions with a variable number of arguments
+* Mathematical functions:: Standard libm functions
+
+'Asymptote' functions are treated as variables with a signature
+(non-function variables have null signatures). Variables with the same
+name are allowed, so long as they have distinct signatures.
+
+ Function arguments are passed by value. To pass an argument by
+reference, simply enclose it in a structure (*note Structures::).
+
+ Here are some significant features of 'Asymptote' functions:
+
+ 1. Variables with signatures (functions) and without signatures
+ (nonfunction variables) are distinct:
+ int x, x();
+ x=5;
+ x=new int() {return 17;};
+ x=x(); // calls x() and puts the result, 17, in the scalar x
+
+ 2. Traditional function definitions are allowed:
+ int sqr(int x)
+ {
+ return x*x;
+ }
+ sqr=null; // but the function is still just a variable.
+
+ 3. Casting can be used to resolve ambiguities:
+ int a, a(), b, b(); // Valid: creates four variables.
+ a=b; // Invalid: assignment is ambiguous.
+ a=(int) b; // Valid: resolves ambiguity.
+ (int) (a=b); // Valid: resolves ambiguity.
+ (int) a=b; // Invalid: cast expressions cannot be L-values.
+
+ int c();
+ c=a; // Valid: only one possible assignment.
+
+ 4. Anonymous (so-called "high-order") functions are also allowed:
+ typedef int intop(int);
+ intop adder(int m)
+ {
+ return new int(int n) {return m+n;};
+ }
+ intop addby7=adder(7);
+ write(addby7(1)); // Writes 8.
+
+ 5. One may redefine a function 'f', even for calls to 'f' in
+ previously declared functions, by assigning another (anonymous or
+ named) function to it. However, if 'f' is overloaded by a new
+ function definition, previous calls will still access the original
+ version of 'f', as illustrated in this example:
+ void f() {
+ write("hi");
+ }
+
+ void g() {
+ f();
+ }
+
+ g(); // writes "hi"
+
+ f=new void() {write("bye");};
+
+ g(); // writes "bye"
+
+ void f() {write("overloaded");};
+
+ f(); // writes "overloaded"
+ g(); // writes "bye"
+
+ 6. Anonymous functions can be used to redefine a function variable
+ that has been declared (and implicitly initialized to the null
+ function) but not yet explicitly defined:
+ void f(bool b);
+
+ void g(bool b) {
+ if(b) f(b);
+ else write(b);
+ }
+
+ f=new void(bool b) {
+ write(b);
+ g(false);
+ };
+
+ g(true); // Writes true, then writes false.
+
+ 'Asymptote' is the only language we know of that treats functions as
+variables, but allows overloading by distinguishing variables based on
+their signatures.
+
+ Functions are allowed to call themselves recursively. As in C++,
+infinite nested recursion will generate a stack overflow (reported as a
+segmentation fault, unless a fully working version of the GNU library
+'libsigsegv' (e.g. 2.4 or later) is installed at configuration time).
+
+
+File: asymptote.info, Node: Default arguments, Next: Named arguments, Prev: Functions, Up: Functions
+
+6.11.1 Default arguments
+------------------------
+
+'Asymptote' supports a more flexible mechanism for default function
+arguments than C++: they may appear anywhere in the function prototype.
+Because certain data types are implicitly cast to more sophisticated
+types (*note Casts::) one can often avoid ambiguities by ordering
+function arguments from the simplest to the most complicated. For
+example, given
+real f(int a=1, real b=0) {return a+b;}
+then 'f(1)' returns 1.0, but 'f(1.0)' returns 2.0.
+
+ The value of a default argument is determined by evaluating the given
+'Asymptote' expression in the scope where the called function is
+defined.
+
+
+File: asymptote.info, Node: Named arguments, Next: Rest arguments, Prev: Default arguments, Up: Functions
+
+6.11.2 Named arguments
+----------------------
+
+It is sometimes difficult to remember the order in which arguments
+appear in a function declaration. Named (keyword) arguments make
+calling functions with multiple arguments easier. Unlike in the C and
+C++ languages, an assignment in a function argument is interpreted as an
+assignment to a parameter of the same name in the function signature,
+_not within the local scope_. The command-line option '-d' may be used
+to check 'Asymptote' code for cases where a named argument may be
+mistaken for a local assignment.
+
+ When matching arguments to signatures, first all of the keywords are
+matched, then the arguments without names are matched against the
+unmatched formals as usual. For example,
+int f(int x, int y) {
+ return 10x+y;
+}
+write(f(4,x=3));
+outputs 34, as 'x' is already matched when we try to match the unnamed
+argument '4', so it gets matched to the next item, 'y'.
+
+ For the rare occasions where it is desirable to assign a value to
+local variable within a function argument (generally _not_ a good
+programming practice), simply enclose the assignment in parentheses.
+For example, given the definition of 'f' in the previous example,
+int x;
+write(f(4,(x=3)));
+is equivalent to the statements
+int x;
+x=3;
+write(f(4,3));
+and outputs 43.
+
+ Parameters can be specified as "keyword-only" by putting 'keyword'
+immediately before the parameter name, as in 'int f(int keyword x)' or
+'int f(int keyword x=77)'. This forces the caller of the function to
+use a named argument to give a value for this parameter. That is,
+'f(x=42)' is legal, but 'f(25)' is not. Keyword-only parameters must be
+listed after normal parameters in a function definition.
+
+ As a technical detail, we point out that, since variables of the same
+name but different signatures are allowed in the same scope, the code
+int f(int x, int x()) {
+ return x+x();
+}
+int seven() {return 7;}
+is legal in 'Asymptote', with 'f(2,seven)' returning 9. A named
+argument matches the first unmatched formal of the same name, so
+'f(x=2,x=seven)' is an equivalent call, but 'f(x=seven,2)' is not, as
+the first argument is matched to the first formal, and 'int ()' cannot
+be implicitly cast to 'int'. Default arguments do not affect which
+formal a named argument is matched to, so if 'f' were defined as
+int f(int x=3, int x()) {
+ return x+x();
+}
+then 'f(x=seven)' would be illegal, even though 'f(seven)' obviously
+would be allowed.
+
+
+File: asymptote.info, Node: Rest arguments, Next: Mathematical functions, Prev: Named arguments, Up: Functions
+
+6.11.3 Rest arguments
+---------------------
+
+Rest arguments allow one to write functions that take a variable number
+of arguments:
+// This function sums its arguments.
+int sum(... int[] nums) {
+ int total=0;
+ for(int i=0; i < nums.length; ++i)
+ total += nums[i];
+ return total;
+}
+
+sum(1,2,3,4); // returns 10
+sum(); // returns 0
+
+// This function subtracts subsequent arguments from the first.
+int subtract(int start ... int[] subs) {
+ for(int i=0; i < subs.length; ++i)
+ start -= subs[i];
+ return start;
+}
+
+subtract(10,1,2); // returns 7
+subtract(10); // returns 10
+subtract(); // illegal
+
+ Putting an argument into a rest array is called _packing_. One can
+give an explicit list of arguments for the rest argument, so 'subtract'
+could alternatively be implemented as
+int subtract(int start ... int[] subs) {
+ return start - sum(... subs);
+}
+
+ One can even combine normal arguments with rest arguments:
+sum(1,2,3 ... new int[] {4,5,6}); // returns 21
+This builds a new six-element array that is passed to 'sum' as 'nums'.
+The opposite operation, _unpacking_, is not allowed:
+subtract(... new int[] {10, 1, 2});
+is illegal, as the start formal is not matched.
+
+ If no arguments are packed, then a zero-length array (as opposed to
+'null') is bound to the rest parameter. Note that default arguments are
+ignored for rest formals and the rest argument is not bound to a
+keyword.
+
+ In some cases, keyword-only parameters are helpful to avoid arguments
+intended for the rest parameter to be assigned to other parameters. For
+example, here the use of 'keyword' is to avoid 'pnorm(1.0,2.0,0.3)'
+matching '1.0' to 'p'.
+real pnorm(real keyword p=2.0 ... real[] v)
+{
+ return sum(v^p)^(1/p);
+}
+
+ The overloading resolution in 'Asymptote' is similar to the function
+matching rules used in C++. Every argument match is given a score.
+Exact matches score better than matches with casting, and matches with
+formals (regardless of casting) score better than packing an argument
+into the rest array. A candidate is maximal if all of the arguments
+score as well in it as with any other candidate. If there is one unique
+maximal candidate, it is chosen; otherwise, there is an ambiguity error.
+
+int f(path g);
+int f(guide g);
+f((0,0)--(100,100)); // matches the second; the argument is a guide
+
+int g(int x, real y);
+int g(real x, int x);
+
+g(3,4); // ambiguous; the first candidate is better for the first argument,
+ // but the second candidate is better for the second argument
+
+int h(... int[] rest);
+int h(real x ... int[] rest);
+
+h(1,2); // the second definition matches, even though there is a cast,
+ // because casting is preferred over packing
+
+int i(int x ... int[] rest);
+int i(real x, real y ... int[] rest);
+
+i(3,4); // ambiguous; the first candidate is better for the first argument,
+ // but the second candidate is better for the second one
+
+
+File: asymptote.info, Node: Mathematical functions, Prev: Rest arguments, Up: Functions
+
+6.11.4 Mathematical functions
+-----------------------------
+
+'Asymptote' has built-in versions of the standard 'libm' mathematical
+real(real) functions 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'exp',
+'log', 'pow10', 'log10', 'sinh', 'cosh', 'tanh', 'asinh', 'acosh',
+'atanh', 'sqrt', 'cbrt', 'fabs', 'expm1', 'log1p', as well as the
+identity function 'identity'. 'Asymptote' also defines the order 'n'
+Bessel functions of the first kind 'Jn(int n, real)' and second kind
+'Yn(int n, real)', as well as the gamma function 'gamma', the error
+function 'erf', and the complementary error function 'erfc'. The
+standard real(real, real) functions 'atan2', 'hypot', 'fmod',
+'remainder' are also included.
+
+ The functions 'degrees(real radians)' and 'radians(real degrees)' can
+be used to convert between radians and degrees. The function
+'Degrees(real radians)' returns the angle in degrees in the interval
+[0,360). For convenience, 'Asymptote' defines variants 'Sin', 'Cos',
+'Tan', 'aSin', 'aCos', and 'aTan' of the standard trigonometric
+functions that use degrees rather than radians. We also define complex
+versions of the 'sqrt', 'sin', 'cos', 'exp', 'log', and 'gamma'
+functions.
+
+ The functions 'floor', 'ceil', and 'round' differ from their usual
+definitions in that they all return an int value rather than a real
+(since that is normally what one wants). The functions 'Floor', 'Ceil',
+and 'Round' are respectively similar, except that if the result cannot
+be converted to a valid int, they return 'intMax' for positive arguments
+and 'intMin' for negative arguments, rather than generating an integer
+overflow. We also define a function 'sgn', which returns the sign of
+its real argument as an integer (-1, 0, or 1).
+
+ There is an 'abs(int)' function, as well as an 'abs(real)' function
+(equivalent to 'fabs(real)'), an 'abs(pair)' function (equivalent to
+'length(pair)').
+
+ Random numbers can be seeded with 'srand(int)' and generated with the
+'int rand()' function, which returns a random integer between 0 and the
+integer 'randMax'. The 'unitrand()' function returns a random number
+uniformly distributed in the interval [0,1]. A Gaussian random number
+generator 'Gaussrand' and a collection of statistics routines, including
+'histogram', are provided in the module 'stats'. The functions
+'factorial(int n)', which returns n!, and 'choose(int n, int k)', which
+returns n!/(k!(n-k)!), are also defined.
+
+ When configured with the GNU Scientific Library (GSL), available from
+<https://www.gnu.org/software/gsl/>, 'Asymptote' contains an internal
+module 'gsl' that defines the airy functions 'Ai(real)', 'Bi(real)',
+'Ai_deriv(real)', 'Bi_deriv(real)', 'zero_Ai(int)', 'zero_Bi(int)',
+'zero_Ai_deriv(int)', 'zero_Bi_deriv(int)', the Bessel functions 'I(int,
+real)', 'K(int, real)', 'j(int, real)', 'y(int, real)', 'i_scaled(int,
+real)', 'k_scaled(int, real)', 'J(real, real)', 'Y(real, real)',
+'I(real, real)', 'K(real, real)', 'zero_J(real, int)', the elliptic
+functions 'F(real, real)', 'E(real, real)', and 'P(real, real)', the
+Jacobi elliptic functions 'real[] sncndn(real,real)', the
+exponential/trigonometric integrals 'Ei', 'Si', and 'Ci', the Legendre
+polynomials 'Pl(int, real)', and the Riemann zeta function 'zeta(real)'.
+For example, to compute the sine integral 'Si' of 1.0:
+import gsl;
+write(Si(1.0));
+
+ 'Asymptote' also provides a few general purpose numerical routines:
+
+'real newton(int iterations=100, real f(real), real fprime(real), real x, bool verbose=false);'
+ Use Newton-Raphson iteration to solve for a root of a real-valued
+ differentiable function 'f', given its derivative 'fprime' and an
+ initial guess 'x'. Diagnostics for each iteration are printed if
+ 'verbose=true'. If the iteration fails after the maximum allowed
+ number of loops ('iterations'), 'realMax' is returned.
+
+'real newton(int iterations=100, real f(real), real fprime(real), real x1, real x2, bool verbose=false);'
+ Use bracketed Newton-Raphson bisection to solve for a root of a
+ real-valued differentiable function 'f' within an interval
+ ['x1','x2'] (on which the endpoint values of 'f' have opposite
+ signs), given its derivative 'fprime'. Diagnostics for each
+ iteration are printed if 'verbose=true'. If the iteration fails
+ after the maximum allowed number of loops ('iterations'), 'realMax'
+ is returned.
+
+'real simpson(real f(real), real a, real b, real acc=realEpsilon, real dxmax=b-a)'
+ returns the integral of 'f' from 'a' to 'b' using adaptive Simpson
+ integration.
+
+
+File: asymptote.info, Node: Arrays, Next: Casts, Prev: Functions, Up: Programming
+
+6.12 Arrays
+===========
+
+* Menu:
+
+* Slices:: Python-style array slices
+
+Appending '[]' to a built-in or user-defined type yields an array. The
+array element 'i' of an array 'A' can be accessed as 'A[i]'. By
+default, attempts to access or assign to an array element using a
+negative index generates an error. Reading an array element with an
+index beyond the length of the array also generates an error; however,
+assignment to an element beyond the length of the array causes the array
+to be resized to accommodate the new element. One can also index an
+array 'A' with an integer array 'B': the array 'A[B]' is formed by
+indexing array 'A' with successive elements of array 'B'. A convenient
+Java-style shorthand exists for iterating over all elements of an array;
+see *note array iteration::.
+
+ The declaration
+real[] A;
+
+initializes 'A' to be an empty (zero-length) array. Empty arrays should
+be distinguished from null arrays. If we say
+real[] A=null;
+
+then 'A' cannot be dereferenced at all (null arrays have no length and
+cannot be read from or assigned to).
+
+ Arrays can be explicitly initialized like this:
+real[] A={0,1,2};
+
+ Array assignment in 'Asymptote' does a shallow copy: only the pointer
+is copied (if one copy if modified, the other will be too). The 'copy'
+function listed below provides a deep copy of an array.
+
+ Every array 'A' of type 'T[]' has the virtual members
+ * 'int length',
+ * 'int cyclic',
+ * 'int[] keys',
+ * 'T push(T x)',
+ * 'void append(T[] a)',
+ * 'T pop()',
+ * 'void insert(int i ... T[] x)',
+ * 'void delete(int i, int j=i)',
+ * 'void delete()', and
+ * 'bool initialized(int n)'.
+
+ The member 'A.length' evaluates to the length of the array. Setting
+'A.cyclic=true' signifies that array indices should be reduced modulo
+the current array length. Reading from or writing to a nonempty cyclic
+array never leads to out-of-bounds errors or array resizing.
+
+ The member 'A.keys' evaluates to an array of integers containing the
+indices of initialized entries in the array in ascending order. Hence,
+for an array of length 'n' with all entries initialized, 'A.keys'
+evaluates to '{0,1,...,n-1}'. A new keys array is produced each time
+'A.keys' is evaluated.
+
+ The functions 'A.push' and 'A.append' append their arguments onto the
+end of the array, while 'A.insert(int i ... T[] x)' inserts 'x' into the
+array at index 'i'. For convenience 'A.push' returns the pushed item.
+The function 'A.pop()' pops and returns the last element, while
+'A.delete(int i, int j=i)' deletes elements with indices in the range
+['i','j'], shifting the position of all higher-indexed elements down.
+If no arguments are given, 'A.delete()' provides a convenient way of
+deleting all elements of 'A'. The routine 'A.initialized(int n)' can be
+used to examine whether the element at index 'n' is initialized. Like
+all 'Asymptote' functions, 'push', 'append', 'pop', 'insert', 'delete',
+and 'initialized' can be "pulled off" of the array and used on their
+own. For example,
+int[] A={1};
+A.push(2); // A now contains {1,2}.
+A.append(A); // A now contains {1,2,1,2}.
+int f(int)=A.push;
+f(3); // A now contains {1,2,1,2,3}.
+int g()=A.pop;
+write(g()); // Outputs 3.
+A.delete(0); // A now contains {2,1,2}.
+A.delete(0,1); // A now contains {2}.
+A.insert(1,3); // A now contains {2,3}.
+A.insert(1 ... A); // A now contains {2,2,3,3}
+A.insert(2,4,5); // A now contains {2,2,4,5,3,3}.
+
+ The '[]' suffix can also appear after the variable name; this is
+sometimes convenient for declaring a list of variables and arrays of the
+same type:
+real a,A[];
+This declares 'a' to be 'real' and implicitly declares 'A' to be of type
+'real[]'.
+
+ In the following list of built-in array functions, 'T' represents a
+generic type. Note that the internal functions 'alias', 'array',
+'copy', 'concat', 'sequence', 'map', and 'transpose', which depend on
+type 'T[]', are defined only after the first declaration of a variable
+of type 'T[]'.
+
+'new T[]'
+ returns a new empty array of type 'T[]';
+
+'new T[] {list}'
+ returns a new array of type 'T[]' initialized with 'list' (a comma
+ delimited list of elements);
+
+'new T[n]'
+ returns a new array of 'n' elements of type 'T[]'. These 'n' array
+ elements are not initialized unless they are arrays themselves (in
+ which case they are each initialized to empty arrays);
+
+'T[] array(int n, T value, int depth=intMax)'
+ returns an array consisting of 'n' copies of 'value'. If 'value'
+ is itself an array, a deep copy of 'value' is made for each entry.
+ If 'depth' is specified, this deep copying only recurses to the
+ specified number of levels;
+
+'int[] sequence(int n)'
+ if 'n >= 1' returns the array '{0,1,...,n-1}' (otherwise returns a
+ null array);
+
+'int[] sequence(int n, int m)'
+ if 'm >= n' returns an array '{n,n+1,...,m}' (otherwise returns a
+ null array);
+
+'T[] sequence(T f(int), int n)'
+ if 'n >= 1' returns the sequence '{f_i :i=0,1,...n-1}' given a
+ function 'T f(int)' and integer 'int n' (otherwise returns a null
+ array);
+
+'T[] map(T f(T), T[] a)'
+ returns the array obtained by applying the function 'f' to each
+ element of the array 'a'. This is equivalent to 'sequence(new
+ T(int i) {return f(a[i]);},a.length)';
+
+'T2[] map(T2 f(T1), T1[] a)'
+ constructed by calling 'mapArray("T1","T2")', returns the array
+ obtained by applying the function 'f' to each element of the array
+ 'a';
+
+'int[] reverse(int n)'
+ if 'n >= 1' returns the array '{n-1,n-2,...,0}' (otherwise returns
+ a null array);
+
+'int[] complement(int[] a, int n)'
+ returns the complement of the integer array 'a' in
+ '{0,1,2,...,n-1}', so that 'b[complement(a,b.length)]' yields the
+ complement of 'b[a]';
+
+'real[] uniform(real a, real b, int n)'
+ if 'n >= 1' returns a uniform partition of '[a,b]' into 'n'
+ subintervals (otherwise returns a null array);
+
+'int find(bool[] a, int n=1)'
+ returns the index of the 'n'th 'true' value in the boolean array
+ 'a' or -1 if not found. If 'n' is negative, search backwards from
+ the end of the array for the '-n'th value;
+
+'int[] findall(bool[] a)'
+ returns the indices of all 'true' values in the boolean array 'a';
+
+'int search(T[] a, T key)'
+ For built-in ordered types 'T', searches a sorted array 'a' of 'n'
+ elements for k, returning the index 'i' if 'a[i] <= key < a[i+1]',
+ '-1' if 'key' is less than all elements of 'a', or 'n-1' if 'key'
+ is greater than or equal to the last element of 'a';
+
+'int search(T[] a, T key, bool less(T i, T j))'
+ searches an array 'a' sorted in ascending order such that element
+ 'i' precedes element 'j' if 'less(i,j)' is true;
+
+'T[] copy(T[] a)'
+ returns a deep copy of the array 'a';
+
+'T[] concat(... T[][] a)'
+ returns a new array formed by concatenating the given
+ one-dimensional arrays given as arguments;
+
+'bool alias(T[] a, T[] b)'
+ returns 'true' if the arrays 'a' and 'b' are identical;
+
+'T[] sort(T[] a)'
+ For built-in ordered types 'T', returns a copy of 'a' sorted in
+ ascending order;
+
+'T[][] sort(T[][] a)'
+ For built-in ordered types 'T', returns a copy of 'a' with the rows
+ sorted by the first column, breaking ties with successively higher
+ columns. For example:
+ string[][] a={{"bob","9"},{"alice","5"},{"pete","7"},
+ {"alice","4"}};
+ // Row sort (by column 0, using column 1 to break ties):
+ write(sort(a));
+
+ produces
+ alice 4
+ alice 5
+ bob 9
+ pete 7
+
+'T[] sort(T[] a, bool less(T i, T j), bool stable=true)'
+ returns a copy of 'a' sorted in ascending order such that element
+ 'i' precedes element 'j' if 'less(i,j)' is true, subject to (if
+ 'stable' is 'true') the stability constraint that the original
+ order of elements 'i' and 'j' is preserved if 'less(i,j)' and
+ 'less(j,i)' are both 'false';
+
+'T[][] transpose(T[][] a)'
+ returns the transpose of 'a';
+
+'T[][][] transpose(T[][][] a, int[] perm)'
+ returns the 3D transpose of 'a' obtained by applying the
+ permutation 'perm' of 'new int[]{0,1,2}' to the indices of each
+ entry;
+
+'T sum(T[] a)'
+ for arithmetic types 'T', returns the sum of 'a'. In the case
+ where 'T' is 'bool', the number of true elements in 'a' is
+ returned;
+
+'T min(T[] a)'
+'T min(T[][] a)'
+'T min(T[][][] a)'
+ for built-in ordered types 'T', returns the minimum element of 'a';
+
+'T max(T[] a)'
+'T max(T[][] a)'
+'T max(T[][][] a)'
+ for built-in ordered types 'T', returns the maximum element of 'a';
+
+'T[] min(T[] a, T[] b)'
+ for built-in ordered types 'T', and arrays 'a' and 'b' of the same
+ length, returns an array composed of the minimum of the
+ corresponding elements of 'a' and 'b';
+
+'T[] max(T[] a, T[] b)'
+ for built-in ordered types 'T', and arrays 'a' and 'b' of the same
+ length, returns an array composed of the maximum of the
+ corresponding elements of 'a' and 'b';
+
+'pair[] pairs(real[] x, real[] y);'
+ for arrays 'x' and 'y' of the same length, returns the pair array
+ 'sequence(new pair(int i) {return (x[i],y[i]);},x.length)';
+
+'pair[] fft(pair[] a, int sign=1)'
+ returns the unnormalized Fast Fourier Transform of 'a' (if the
+ optional 'FFTW' package is installed), using the given 'sign'.
+ Here is a simple example:
+ int n=4;
+ pair[] f=sequence(n);
+ write(f);
+ pair[] g=fft(f,-1);
+ write();
+ write(g);
+ f=fft(g,1);
+ write();
+ write(f/n);
+
+'pair[][] fft(pair[][] a, int sign=1)'
+ returns the unnormalized two-dimensional Fourier transform of 'a'
+ using the given 'sign';
+
+'pair[][][] fft(pair[][][] a, int sign=1)'
+ returns the unnormalized three-dimensional Fourier transform of 'a'
+ using the given 'sign';
+
+'real dot(real[] a, real[] b)'
+ returns the dot product of the vectors 'a' and 'b';
+
+'pair dot(pair[] a, pair[] b)'
+ returns the complex dot product 'sum(a*conj(b))' of the vectors 'a'
+ and 'b';
+
+'real[] tridiagonal(real[] a, real[] b, real[] c, real[] f);'
+ Solve the periodic tridiagonal problem L'x'='f' and return the
+ solution 'x', where 'f' is an n vector and L is the n \times n
+ matrix
+ [ b[0] c[0] a[0] ]
+ [ a[1] b[1] c[1] ]
+ [ a[2] b[2] c[2] ]
+ [ ... ]
+ [ c[n-1] a[n-1] b[n-1] ]
+ For Dirichlet boundary conditions (denoted here by 'u[-1]' and
+ 'u[n]'), replace 'f[0]' by 'f[0]-a[0]u[-1]' and
+ 'f[n-1]-c[n-1]u[n]'; then set 'a[0]=c[n-1]=0';
+
+'real[] solve(real[][] a, real[] b, bool warn=true)'
+ Solve the linear equation 'a'x='b' by LU decomposition and return
+ the solution x, where 'a' is an n \times n matrix and 'b' is an
+ array of length n. For example:
+ import math;
+ real[][] a={{1,-2,3,0},{4,-5,6,2},{-7,-8,10,5},{1,50,1,-2}};
+ real[] b={7,19,33,3};
+ real[] x=solve(a,b);
+ write(a); write();
+ write(b); write();
+ write(x); write();
+ write(a*x);
+ If 'a' is a singular matrix and 'warn' is 'false', return an empty
+ array. If the matrix 'a' is tridiagonal, the routine 'tridiagonal'
+ provides a more efficient algorithm (*note tridiagonal::);
+
+'real[][] solve(real[][] a, real[][] b, bool warn=true)'
+ Solve the linear equation 'a'x='b' and return the solution x, where
+ 'a' is an n \times n matrix and 'b' is an n \times m matrix. If
+ 'a' is a singular matrix and 'warn' is 'false', return an empty
+ matrix;
+
+'real[][] identity(int n);'
+ returns the n \times n identity matrix;
+
+'real[][] diagonal(... real[] a)'
+ returns the diagonal matrix with diagonal entries given by a;
+
+'real[][] inverse(real[][] a)'
+ returns the inverse of a square matrix 'a';
+
+'real[] quadraticroots(real a, real b, real c);'
+ This numerically robust solver returns the real roots of the
+ quadratic equation ax^2+bx+c=0, in ascending order. Multiple roots
+ are listed separately;
+
+'pair[] quadraticroots(explicit pair a, explicit pair b, explicit pair c);'
+ This numerically robust solver returns the complex roots of the
+ quadratic equation ax^2+bx+c=0;
+
+'real[] cubicroots(real a, real b, real c, real d);'
+ This numerically robust solver returns the real roots of the cubic
+ equation ax^3+bx^2+cx+d=0. Multiple roots are listed separately.
+
+ 'Asymptote' includes a full set of vectorized array instructions for
+arithmetic (including self) and logical operations. These
+element-by-element instructions are implemented in C++ code for speed.
+Given
+real[] a={1,2};
+real[] b={3,2};
+then 'a == b' and 'a >= 2' both evaluate to the vector '{false, true}'.
+To test whether all components of 'a' and 'b' agree, use the boolean
+function 'all(a == b)'. One can also use conditionals like '(a >= 2) ?
+a : b', which returns the array '{3,2}', or 'write((a >= 2) ? a : null',
+which returns the array '{2}'.
+
+ All of the standard built-in 'libm' functions of signature
+'real(real)' also take a real array as an argument, effectively like an
+implicit call to 'map'.
+
+ As with other built-in types, arrays of the basic data types can be
+read in by assignment. In this example, the code
+file fin=input("test.txt");
+real[] A=fin;
+
+reads real values into 'A' until the end-of-file is reached (or an I/O
+error occurs).
+
+ The virtual members 'dimension', 'line', 'csv', 'word', and 'read' of
+a file are useful for reading arrays. For example, if line mode is set
+with 'file line(bool b=true)', then reading will stop once the end of
+the line is reached instead:
+file fin=input("test.txt");
+real[] A=fin.line();
+
+ Since string reads by default read up to the end of line anyway, line
+mode normally has no effect on string array reads. However, there is a
+white-space delimiter mode for reading strings, 'file word(bool
+b=true)', which causes string reads to respect white-space delimiters,
+instead of the default end-of-line delimiter:
+file fin=input("test.txt").line().word();
+real[] A=fin;
+
+ Another useful mode is comma-separated-value mode, 'file csv(bool
+b=true)', which causes reads to respect comma delimiters:
+file fin=input("test.txt").csv();
+real[] A=fin;
+
+ To restrict the number of values read, use the 'file dimension(int)'
+function:
+file fin=input("test.txt");
+real[] A=fin.dimension(10);
+
+ This reads 10 values into A, unless end-of-file (or end-of-line in
+line mode) occurs first. Attempting to read beyond the end of the file
+will produce a runtime error message. Specifying a value of 0 for the
+integer limit is equivalent to the previous example of reading until
+end-of-file (or end-of-line in line mode) is encountered.
+
+ Two- and three-dimensional arrays of the basic data types can be read
+in like this:
+file fin=input("test.txt");
+real[][] A=fin.dimension(2,3);
+real[][][] B=fin.dimension(2,3,4);
+
+ Sometimes the array dimensions are stored with the data as integer
+fields at the beginning of an array. Such 1, 2, or 3 dimensional arrays
+can be read in with the virtual member functions 'read(1)', 'read(2)',
+or 'read(3)', respectively:
+file fin=input("test.txt");
+real[] A=fin.read(1);
+real[][] B=fin.read(2);
+real[][][] C=fin.read(3);
+
+ One, two, and three-dimensional arrays of the basic data types can be
+output with the functions 'write(file,T[])', 'write(file,T[][])',
+'write(file,T[][][])', respectively.
+
+
+File: asymptote.info, Node: Slices, Prev: Arrays, Up: Arrays
+
+6.12.1 Slices
+-------------
+
+Asymptote allows a section of an array to be addressed as a slice using
+a Python-like syntax. If 'A' is an array, the expression 'A[m:n]'
+returns a new array consisting of the elements of 'A' with indices from
+'m' up to but not including 'n'. For example,
+int[] x={0,1,2,3,4,5,6,7,8,9};
+int[] y=x[2:6]; // y={2,3,4,5};
+int[] z=x[5:10]; // z={5,6,7,8,9};
+
+ If the left index is omitted, it is taken be '0'. If the right index
+is omitted it is taken to be the length of the array. If both are
+omitted, the slice then goes from the start of the array to the end,
+producing a non-cyclic deep copy of the array. For example:
+int[] x={0,1,2,3,4,5,6,7,8,9};
+int[] y=x[:4]; // y={0,1,2,3}
+int[] z=x[5:]; // z={5,6,7,8,9}
+int[] w=x[:]; // w={0,1,2,3,4,5,6,7,8,9}, distinct from array x.
+
+ If A is a non-cyclic array, it is illegal to use negative values for
+either of the indices. If the indices exceed the length of the array,
+however, they are politely truncated to that length.
+
+ For cyclic arrays, the slice 'A[m:n]' still consists of the cells
+with indices in the set ['m','n'), but now negative values and values
+beyond the length of the array are allowed. The indices simply wrap
+around. For example:
+
+int[] x={0,1,2,3,4,5,6,7,8,9};
+x.cyclic=true;
+int[] y=x[8:15]; // y={8,9,0,1,2,3,4}.
+int[] z=x[-5:5]; // z={5,6,7,8,9,0,1,2,3,4}
+int[] w=x[-3:17]; // w={7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6}
+
+ Notice that with cyclic arrays, it is possible to include the same
+element of the original array multiple times within a slice. Regardless
+of the original array, arrays produced by slices are always non-cyclic.
+
+ If the left and right indices of a slice are the same, the result is
+an empty array. If the array being sliced is empty, the result is an
+empty array. Any slice with a left index greater than its right index
+will yield an error.
+
+ Slices can also be assigned to, changing the value of the original
+array. If the array being assigned to the slice has a different length
+than the slice itself, elements will be inserted or removed from the
+array to accommodate it. For instance:
+string[] toppings={"mayo", "salt", "ham", "lettuce"};
+toppings[0:2]=new string[] {"mustard", "pepper"};
+ // Now toppings={"mustard", "pepper", "ham", "lettuce"}
+toppings[2:3]=new string[] {"turkey", "bacon" };
+ // Now toppings={"mustard", "pepper", "turkey", "bacon", "lettuce"}
+toppings[0:3]=new string[] {"tomato"};
+ // Now toppings={"tomato", "bacon", "lettuce"}
+
+ If an array is assigned to a slice of itself, a copy of the original
+array is assigned to the slice. That is, code such as 'x[m:n]=x' is
+equivalent to 'x[m:n]=copy(x)'. One can use the shorthand 'x[m:m]=y' to
+insert the contents of the array 'y' into the array 'x' starting at the
+location just before 'x[m]'.
+
+ For a cyclic array, a slice is bridging if it addresses cells up to
+the end of the array and then continues on to address cells at the start
+of the array. For instance, if 'A' is a cyclic array of length 10,
+'A[8:12]', 'A[-3:1]', and 'A[5:25]' are bridging slices whereas
+'A[3:7]', 'A[7:10]', 'A[-3:0]' and 'A[103:107]' are not. Bridging
+slices can only be assigned to if the number of elements in the slice is
+exactly equal to the number of elements we are assigning to it.
+Otherwise, there is no clear way to decide which of the new entries
+should be 'A[0]' and an error is reported. Non-bridging slices may be
+assigned an array of any length.
+
+ For a cyclic array 'A' an expression of the form
+'A[A.length:A.length]' is equivalent to the expression 'A[0:0]' and so
+assigning to this slice will insert values at the start of the array.
+'A.append()' can be used to insert values at the end of the array.
+
+ It is illegal to assign to a slice of a cyclic array that repeats any
+of the cells.
+
+
+File: asymptote.info, Node: Casts, Next: Import, Prev: Arrays, Up: Programming
+
+6.13 Casts
+==========
+
+'Asymptote' implicitly casts 'int' to 'real', 'int' to 'pair', 'real' to
+'pair', 'pair' to 'path', 'pair' to 'guide', 'path' to 'guide', 'guide'
+to 'path', 'real' to 'pen', 'pair[]' to 'guide[]', 'pair[]' to 'path[]',
+'path' to 'path[]', and 'guide' to 'path[]', along with various
+three-dimensional casts defined in module 'three'. Implicit casts are
+automatically attempted on assignment and when trying to match function
+calls with possible function signatures. Implicit casting can be
+inhibited by declaring individual arguments 'explicit' in the function
+signature, say to avoid an ambiguous function call in the following
+example, which outputs 0:
+int f(pair a) {return 0;}
+int f(explicit real x) {return 1;}
+
+write(f(0));
+
+ Other conversions, say 'real' to 'int' or 'real' to 'string', require
+an explicit cast:
+int i=(int) 2.5;
+string s=(string) 2.5;
+
+real[] a={2.5,-3.5};
+int[] b=(int []) a;
+write(stdout,b); // Outputs 2,-3
+ In situations where casting from a string to a type 'T' fails, an
+uninitialized variable is returned; this condition can be detected with
+the function 'bool initialized(T);'
+int i=(int) "2.5";
+assert(initialized(i),"Invalid cast.");
+
+real x=(real) "2.5a";
+assert(initialized(x),"Invalid cast.");
+
+ Casting to user-defined types is also possible using 'operator cast':
+struct rpair {
+ real radius;
+ real angle;
+}
+
+pair operator cast(rpair x) {
+ return (x.radius*cos(x.angle),x.radius*sin(x.angle));
+}
+
+rpair x;
+x.radius=1;
+x.angle=pi/6;
+
+write(x); // Outputs (0.866025403784439,0.5)
+
+ One must use care when defining new cast operators. Suppose that in
+some code one wants all integers to represent multiples of 100. To
+convert them to reals, one would first want to multiply them by 100.
+However, the straightforward implementation
+real operator cast(int x) {return x*100;}
+is equivalent to an infinite recursion, since the result 'x*100' needs
+itself to be cast from an integer to a real. Instead, we want to use
+the standard conversion of int to real:
+real convert(int x) {return x*100;}
+real operator cast(int x)=convert;
+
+ Explicit casts are implemented similarly, with 'operator ecast'.
+
+
+File: asymptote.info, Node: Import, Next: Static, Prev: Casts, Up: Programming
+
+6.14 Import
+===========
+
+While 'Asymptote' provides many features by default, some applications
+require specialized features contained in external 'Asymptote' modules.
+For instance, the lines
+access graph;
+graph.axes();
+draw x and y axes on a two-dimensional graph. Here, the command looks
+up the module under the name 'graph' in a global dictionary of modules
+and puts it in a new variable named 'graph'. The module is a structure,
+and we can refer to its fields as we usually would with a structure.
+
+ Often, one wants to use module functions without having to specify
+the module name. The code
+from graph access axes;
+adds the 'axes' field of 'graph' into the local name space, so that
+subsequently, one can just write 'axes()'. If the given name is
+overloaded, all types and variables of that name are added. To add more
+than one name, just use a comma-separated list:
+from graph access axes, xaxis, yaxis;
+Wild card notation can be used to add all non-private fields and types
+of a module to the local name space:
+
+from graph access *;
+
+ Similarly, one can add the non-private fields and types of a
+structure to the local environment with the 'unravel' keyword:
+struct matrix {
+ real a,b,c,d;
+}
+
+real det(matrix m) {
+ unravel m;
+ return a*d-b*c;
+}
+ Alternatively, one can unravel selective fields:
+real det(matrix m) {
+ from m unravel a,b,c as C,d;
+ return a*d-b*C;
+}
+
+ The command
+import graph;
+ is a convenient abbreviation for the commands
+access graph;
+unravel graph;
+ That is, 'import graph' first loads a module into a structure called
+'graph' and then adds its non-private fields and types to the local
+environment. This way, if a member variable (or function) is
+overwritten with a local variable (or function of the same signature),
+the original one can still be accessed by qualifying it with the module
+name.
+
+ Wild card importing will work fine in most cases, but one does not
+usually know all of the internal types and variables of a module, which
+can also change as the module writer adds or changes features of the
+module. As such, it is prudent to add 'import' commands at the start of
+an 'Asymptote' file, so that imported names won't shadow locally defined
+functions. Still, imported names may shadow other imported names,
+depending on the order in which they were imported, and imported
+functions may cause overloading resolution problems if they have the
+same name as local functions defined later.
+
+ To rename modules or fields when adding them to the local
+environment, use 'as':
+access graph as graph2d;
+from graph access xaxis as xline, yaxis as yline;
+
+ The command
+import graph as graph2d;
+ is a convenient abbreviation for the commands
+access graph as graph2d;
+unravel graph2d;
+
+ Except for a few built-in modules, such as 'settings', all modules
+are implemented as 'Asymptote' files. When looking up a module that has
+not yet been loaded, 'Asymptote' searches the standard search paths
+(*note Search paths::) for the matching file. The file corresponding to
+that name is read and the code within it is interpreted as the body of a
+structure defining the module.
+
+ If the file name contains nonalphanumeric characters, enclose it with
+quotation marks:
+
+'access "/usr/local/share/asymptote/graph.asy" as graph;'
+
+'from "/usr/local/share/asymptote/graph.asy" access axes;'
+
+'import "/usr/local/share/asymptote/graph.asy" as graph;'
+
+ If 'Asymptote' is compiled with support for 'libcurl', the file name
+can even be a URL: 'import
+"https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/doc/axis3.asy"
+as axis3;'
+
+ It is an error if modules import themselves (or each other in a
+cycle). The module name to be imported must be known at compile time.
+
+ However, you can import an 'Asymptote' module determined by the
+string 's' at runtime like this:
+eval("import "+s,true);
+
+ To conditionally execute an array of asy files, use
+void asy(string format, bool overwrite ... string[] s);
+ The file will only be processed, using output format 'format', if
+overwrite is 'true' or the output file is missing.
+
+ One can evaluate an 'Asymptote' expression (without any return value,
+however) contained in the string 's' with:
+void eval(string s, bool embedded=false);
+ It is not necessary to terminate the string 's' with a semicolon. If
+'embedded' is 'true', the string will be evaluated at the top level of
+the current environment. If 'embedded' is 'false' (the default), the
+string will be evaluated in an independent environment, sharing the same
+'settings' module (*note settings::).
+
+ One can evaluate arbitrary 'Asymptote' code (which may contain
+unescaped quotation marks) with the command
+void eval(code s, bool embedded=false);
+ Here 'code' is a special type used with 'quote {}' to enclose
+'Asymptote code' like this:
+real a=1;
+code s=quote {
+ write(a);
+};
+eval(s,true); // Outputs 1
+
+ One application of 'eval' is the creation of parametrized Asymptote
+code, such as a map from one type to another (*note map::).
+
+ To include the contents of an existing file 'graph' verbatim (as if
+the contents of the file were inserted at that point), use one of the
+forms:
+include graph;
+
+'include "/usr/local/share/asymptote/graph.asy";'
+
+ To list all global functions and variables defined in a module named
+by the contents of the string 's', use the function
+void list(string s, bool imports=false);
+Imported global functions and variables are also listed if 'imports' is
+'true'.
+
+
+File: asymptote.info, Node: Static, Prev: Import, Up: Programming
+
+6.15 Static
+===========
+
+Static qualifiers allocate the memory address of a variable in a higher
+enclosing level.
+
+ For a function body, the variable is allocated in the block where the
+function is defined; so in the code
+struct s {
+ int count() {
+ static int c=0;
+ ++c;
+ return c;
+ }
+}
+
+there is one instance of the variable 'c' for each object 's' (as
+opposed to each call of 'count').
+
+ Similarly, in
+int factorial(int n) {
+ int helper(int k) {
+ static int x=1;
+ x *= k;
+ return k == 1 ? x : helper(k-1);
+ }
+ return helper(n);
+}
+
+there is one instance of 'x' for every call to 'factorial' (and not for
+every call to 'helper'), so this is a correct, but ugly, implementation
+of factorial.
+
+ Similarly, a static variable declared within a structure is allocated
+in the block where the structure is defined. Thus,
+struct A {
+ struct B {
+ static pair z;
+ }
+}
+
+creates one object 'z' for each object of type 'A' created.
+
+ In this example,
+int pow(int n, int k) {
+ struct A {
+ static int x=1;
+ void helper() {
+ x *= n;
+ }
+ }
+ for(int i=0; i < k; ++i) {
+ A a;
+ a.helper();
+ }
+ return A.x;
+}
+
+there is one instance of 'x' for each call to 'pow', so this is an ugly
+implementation of exponentiation.
+
+ Loop constructs allocate a new frame in every iteration. This is so
+that higher-order functions can refer to variables of a specific
+iteration of a loop:
+void f();
+for(int i=0; i < 10; ++i) {
+ int x=i;
+ if(x==5) {
+ f=new void() {write(x);};
+ }
+}
+f();
+
+ Here, every iteration of the loop has its own variable 'x', so 'f()'
+will write '5'. If a variable in a loop is declared static, it will be
+allocated where the enclosing function or structure was defined (just as
+if it were declared static outside of the loop). For instance, in:
+void f() {
+ static int x;
+ for(int i=0; i < 10; ++i) {
+ static int y;
+ }
+}
+both 'x' and 'y' will be allocated in the same place, which is also
+where 'f' is allocated.
+
+ Statements may also be declared static, in which case they are run at
+the place where the enclosing function or structure is defined.
+Declarations or statements not enclosed in a function or structure
+definition are already at the top level, so static modifiers are
+meaningless. A warning is given in such a case.
+
+ Since structures can have static fields, it is not always clear for a
+qualified name whether the qualifier is a variable or a type. For
+instance, in:
+
+struct A {
+ static int x;
+}
+pair A;
+
+int y=A.x;
+does the 'A' in 'A.x' refer to the structure or to the pair variable.
+It is the convention in Asymptote that, if there is a non-function
+variable with the same name as the qualifier, the qualifier refers to
+that variable, and not to the type. This is regardless of what fields
+the variable actually possesses.
+
+
+File: asymptote.info, Node: LaTeX usage, Next: Base modules, Prev: Programming, Up: Top
+
+7 'LaTeX' usage
+***************
+
+'Asymptote' comes with a convenient 'LaTeX' style file 'asymptote.sty'
+(v1.36 or later required) that makes 'LaTeX' 'Asymptote'-aware.
+Entering 'Asymptote' code directly into the 'LaTeX' source file, at the
+point where it is needed, keeps figures organized and avoids the need to
+invent new file names for each figure. Simply add the line
+'\usepackage{asymptote}' at the beginning of your file and enclose your
+'Asymptote' code within a '\begin{asy}...\end{asy}' environment. As
+with the 'LaTeX' 'comment' environment, the '\end{asy}' command must
+appear on a line by itself, with no trailing commands/comments. A blank
+line is not allowed after '\begin{asy}'.
+
+ The sample 'LaTeX' file below, named 'latexusage.tex', can be run as
+follows:
+latex latexusage
+asy latexusage-*.asy
+latex latexusage
+
+or
+pdflatex latexusage
+asy latexusage-*.asy
+pdflatex latexusage
+To switch between using inline Asymptote code with 'latex' and
+'pdflatex' you may first need to remove the files 'latexusage-*.tex'.
+
+ An even better method for processing a 'LaTeX' file with embedded
+'Asymptote' code is to use the 'latexmk' utility from
+ <http://mirror.ctan.org/support/latexmk/>
+after putting the contents of
+<https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/doc/latexmkrc>
+in a file 'latexmkrc' in the same directory. The command
+latexmk -pdf latexusage
+will then call 'Asymptote' automatically, recompiling only the figures
+that have changed. Since each figure is compiled in a separate system
+process, this method also tends to use less memory. To store the
+figures in a separate directory named 'asy', one can define
+\def\asydir{asy}
+ in 'latexusage.tex' and put the contents of
+<https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/doc/latexmkrc_asydir>
+in a file 'latexmkrc' in the same directory. External 'Asymptote' code
+can be included with
+\asyinclude[<options>]{<filename.asy>}
+so that 'latexmk' will recognize when the code is changed. Note that
+'latemk' requires 'perl', available from <https://www.perl.org/>.
+
+ One can specify 'width', 'height', 'keepAspect', 'viewportwidth',
+'viewportheight', 'attach', and 'inline'. 'keyval'-style options to the
+'asy' and 'asyinclude' environments. Three-dimensional PRC files may
+either be embedded within the page (the default) or attached as
+annotated (but printable) attachments, using the 'attach' option and the
+'attachfile2' (or older 'attachfile') 'LaTeX' package. The 'inline'
+option generates inline 'LaTeX' code instead of EPS or PDF files. This
+makes 2D LaTeX symbols visible to the '\begin{asy}...\end{asy}'
+environment. In this mode, Asymptote correctly aligns 2D LaTeX symbols
+defined outside of '\begin{asy}...\end{asy}', but treats their size as
+zero; an optional second string can be given to 'Label' to provide an
+estimate of the unknown label size.
+
+ Note that if the 'latex' TeX engine is used with the 'inline' option,
+labels might not show up in DVI viewers that cannot handle raw
+'PostScript' code. One can use 'dvips'/'dvipdf' to produce
+'PostScript'/PDF output (we recommend using the modified version of
+'dvipdf' in the 'Asymptote' patches directory, which accepts the 'dvips
+-z' hyperdvi option).
+
+ Here now is 'latexusage.tex':
+\documentclass[12pt]{article}
+
+% Use this form to include EPS (latex) or PDF (pdflatex) files:
+%\usepackage{asymptote}
+
+% Use this form with latex or pdflatex to include inline LaTeX code by default:
+\usepackage[inline]{asymptote}
+
+% Use this form with latex or pdflatex to create PDF attachments by default:
+%\usepackage[attach]{asymptote}
+
+% Enable this line to support the attach option:
+%\usepackage[dvips]{attachfile2}
+
+\begin{document}
+
+% Optional subdirectory for latex files (no spaces):
+\def\asylatexdir{}
+% Optional subdirectory for asy files (no spaces):
+\def\asydir{}
+
+\begin{asydef}
+// Global Asymptote definitions can be put here.
+import three;
+usepackage("bm");
+texpreamble("\def\V#1{\bm{#1}}");
+// One can globally override the default toolbar settings here:
+// settings.toolbar=true;
+\end{asydef}
+
+Here is a venn diagram produced with Asymptote, drawn to width 4cm:
+
+\def\A{A}
+\def\B{\V{B}}
+
+%\begin{figure}
+\begin{center}
+\begin{asy}
+size(4cm,0);
+pen colour1=red;
+pen colour2=green;
+
+pair z0=(0,0);
+pair z1=(-1,0);
+pair z2=(1,0);
+real r=1.5;
+path c1=circle(z1,r);
+path c2=circle(z2,r);
+fill(c1,colour1);
+fill(c2,colour2);
+
+picture intersection=new picture;
+fill(intersection,c1,colour1+colour2);
+clip(intersection,c2);
+
+add(intersection);
+
+draw(c1);
+draw(c2);
+
+//draw("$\A$",box,z1); // Requires [inline] package option.
+//draw(Label("$\B$","$B$"),box,z2); // Requires [inline] package option.
+draw("$A$",box,z1);
+draw("$\V{B}$",box,z2);
+
+pair z=(0,-2);
+real m=3;
+margin BigMargin=Margin(0,m*dot(unit(z1-z),unit(z0-z)));
+
+draw(Label("$A\cap B$",0),conj(z)--z0,Arrow,BigMargin);
+draw(Label("$A\cup B$",0),z--z0,Arrow,BigMargin);
+draw(z--z1,Arrow,Margin(0,m));
+draw(z--z2,Arrow,Margin(0,m));
+
+shipout(bbox(0.25cm));
+\end{asy}
+%\caption{Venn diagram}\label{venn}
+\end{center}
+%\end{figure}
+
+Each graph is drawn in its own environment. One can specify the width
+and height to \LaTeX\ explicitly. This 3D example can be viewed
+interactively either with Adobe Reader or Asymptote's fast OpenGL-based
+renderer. To support {\tt latexmk}, 3D figures should specify
+\verb+inline=true+. It is sometimes desirable to embed 3D files as annotated
+attachments; this requires the \verb+attach=true+ option as well as the
+\verb+attachfile2+ \LaTeX\ package.
+\begin{center}
+\begin{asy}[height=4cm,inline=true,attach=false,viewportwidth=\linewidth]
+currentprojection=orthographic(5,4,2);
+draw(unitcube,blue);
+label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
+\end{asy}
+\end{center}
+
+One can also scale the figure to the full line width:
+\begin{center}
+\begin{asy}[width=\the\linewidth,inline=true]
+pair z0=(0,0);
+pair z1=(2,0);
+pair z2=(5,0);
+pair zf=z1+0.75*(z2-z1);
+
+draw(z1--z2);
+dot(z1,red+0.15cm);
+dot(z2,darkgreen+0.3cm);
+label("$m$",z1,1.2N,red);
+label("$M$",z2,1.5N,darkgreen);
+label("$\hat{\ }$",zf,0.2*S,fontsize(24pt)+blue);
+
+pair s=-0.2*I;
+draw("$x$",z0+s--z1+s,N,red,Arrows,Bars,PenMargins);
+s=-0.5*I;
+draw("$\bar{x}$",z0+s--zf+s,blue,Arrows,Bars,PenMargins);
+s=-0.95*I;
+draw("$X$",z0+s--z2+s,darkgreen,Arrows,Bars,PenMargins);
+\end{asy}
+\end{center}
+\end{document}
+[./latexusage]
+
+File: asymptote.info, Node: Base modules, Next: Options, Prev: LaTeX usage, Up: Top
+
+8 Base modules
+**************
+
+'Asymptote' currently ships with the following base modules:
+
+* Menu:
+
+* plain:: Default 'Asymptote' base file
+* simplex:: Linear programming: simplex method
+* math:: Extend 'Asymptote''s math capabilities
+* interpolate:: Interpolation routines
+* geometry:: Geometry routines
+* trembling:: Wavy lines
+* stats:: Statistics routines and histograms
+* patterns:: Custom fill and draw patterns
+* markers:: Custom path marker routines
+* map:: Map keys to values
+* tree:: Dynamic binary search tree
+* binarytree:: Binary tree drawing module
+* drawtree:: Tree drawing module
+* syzygy:: Syzygy and braid drawing module
+* feynman:: Feynman diagrams
+* roundedpath:: Round the sharp corners of paths
+* animation:: Embedded PDF and MPEG movies
+* embed:: Embedding movies, sounds, and 3D objects
+* slide:: Making presentations with 'Asymptote'
+* MetaPost:: 'MetaPost' compatibility routines
+* babel:: Interface to 'LaTeX' 'babel' package
+* labelpath:: Drawing curved labels
+* labelpath3:: Drawing curved labels in 3D
+* annotate:: Annotate your PDF files
+* CAD:: 2D CAD pen and measurement functions (DIN 15)
+* graph:: 2D linear & logarithmic graphs
+* palette:: Color density images and palettes
+* three:: 3D vector graphics
+* obj:: 3D obj files
+* graph3:: 3D linear & logarithmic graphs
+* grid3:: 3D grids
+* solids:: 3D solid geometry
+* tube:: 3D rotation minimizing tubes
+* flowchart:: Flowchart drawing routines
+* contour:: Contour lines
+* contour3:: Contour surfaces
+* smoothcontour3:: Smooth implicit surfaces
+* slopefield:: Slope fields
+* ode:: Ordinary differential equations
+
+
+File: asymptote.info, Node: plain, Next: simplex, Prev: Base modules, Up: Base modules
+
+8.1 'plain'
+===========
+
+This is the default 'Asymptote' base file, which defines key parts of
+the drawing language (such as the 'picture' structure).
+
+ By default, an implicit 'private import plain;' occurs before
+translating a file and before the first command given in interactive
+mode. This also applies when translating files for module definitions
+(except when translating 'plain', of course). This means that the types
+and functions defined in 'plain' are accessible in almost all
+'Asymptote' code. Use the '-noautoplain' command-line option to disable
+this feature.
+
+
+File: asymptote.info, Node: simplex, Next: math, Prev: plain, Up: Base modules
+
+8.2 'simplex'
+=============
+
+This module solves the two-variable linear programming problem using the
+simplex method. It is used by the module 'plain' for automatic sizing
+of pictures.
+
+
+File: asymptote.info, Node: math, Next: interpolate, Prev: simplex, Up: Base modules
+
+8.3 'math'
+==========
+
+This module extends 'Asymptote''s mathematical capabilities with useful
+functions such as
+
+'void drawline(picture pic=currentpicture, pair P, pair Q, pen p=currentpen);'
+ draw the visible portion of the (infinite) line going through 'P'
+ and 'Q', without altering the size of picture 'pic', using pen 'p'.
+
+'real intersect(triple P, triple Q, triple n, triple Z);'
+ returns the intersection time of the extension of the line segment
+ 'PQ' with the plane perpendicular to 'n' and passing through 'Z'.
+
+'triple intersectionpoint(triple n0, triple P0, triple n1, triple P1);'
+ Return any point on the intersection of the two planes with normals
+ 'n0' and 'n1' passing through points 'P0' and 'P1', respectively.
+ If the planes are parallel, return '(infinity,infinity,infinity)'.
+
+'pair[] quarticroots(real a, real b, real c, real d, real e);'
+ returns the four complex roots of the quartic equation
+ ax^4+bx^3+cx^2+dx+e=0.
+
+'real time(path g, real x, int n=0)'
+ returns the 'n'th intersection time of path 'g' with the vertical
+ line through x.
+
+'real time(path g, explicit pair z, int n=0)'
+ returns the 'n'th intersection time of path 'g' with the horizontal
+ line through '(0,z.y)'.
+
+'real value(path g, real x, int n=0)'
+ returns the 'n'th 'y' value of 'g' at 'x'.
+
+'real value(path g, explicit pair z, int n=0)'
+ returns the 'n'th 'x' value of 'g' at 'y=z.y'.
+
+'real slope(path g, real x, int n=0)'
+ returns the 'n'th slope of 'g' at 'x'.
+
+'real slope(path g, explicit pair z, int n=0)'
+ returns the 'n'th slope of 'g' at 'y=z.y'.
+
+ int[][] segment(bool[] b) returns the indices of consecutive
+ true-element segments of bool[] 'b'.
+
+'real[] partialsum(real[] a)'
+ returns the partial sums of a real array 'a'.
+
+'real[] partialsum(real[] a, real[] dx)'
+ returns the partial 'dx'-weighted sums of a real array 'a'.
+
+'bool increasing(real[] a, bool strict=false)'
+ returns, if 'strict=false', whether 'i > j' implies 'a[i] >= a[j]',
+ or if 'strict=true', whether 'i > j' implies implies 'a[i] > a[j]'.
+
+'int unique(real[] a, real x)'
+ if the sorted array 'a' does not contain 'x', insert it
+ sequentially, returning the index of 'x' in the resulting array.
+
+'bool lexorder(pair a, pair b)'
+ returns the strict lexicographical partial order of 'a' and 'b'.
+
+'bool lexorder(triple a, triple b)'
+ returns the strict lexicographical partial order of 'a' and 'b'.
+
+
+File: asymptote.info, Node: interpolate, Next: geometry, Prev: math, Up: Base modules
+
+8.4 'interpolate'
+=================
+
+This module implements Lagrange, Hermite, and standard cubic spline
+interpolation in 'Asymptote', as illustrated in the example
+'interpolate1.asy'.
+
+
+File: asymptote.info, Node: geometry, Next: trembling, Prev: interpolate, Up: Base modules
+
+8.5 'geometry'
+==============
+
+This module, written by Philippe Ivaldi, provides an extensive set of
+geometry routines, including 'perpendicular' symbols and a 'triangle'
+structure. Link to the documentation for the 'geometry' module are
+posted here: <https://asymptote.sourceforge.io/links.html>, including an
+extensive set of examples,
+<http://www.piprime.fr/files/asymptote/geometry/>, and an index:
+ <http://www.piprime.fr/files/asymptote/geometry/modules/geometry.asy.index.type.html>
+
+
+File: asymptote.info, Node: trembling, Next: stats, Prev: geometry, Up: Base modules
+
+8.6 'trembling'
+===============
+
+This module, written by Philippe Ivaldi and illustrated in the example
+'floatingdisk.asy', allows one to draw wavy lines, as if drawn by hand.
+
+
+File: asymptote.info, Node: stats, Next: patterns, Prev: trembling, Up: Base modules
+
+8.7 'stats'
+===========
+
+This module implements a Gaussian random number generator and a
+collection of statistics routines, including 'histogram' and
+'leastsquares'.
+
+
+File: asymptote.info, Node: patterns, Next: markers, Prev: stats, Up: Base modules
+
+8.8 'patterns'
+==============
+
+This module implements 'PostScript' tiling patterns and includes several
+convenient pattern generation routines.
+
+
+File: asymptote.info, Node: markers, Next: tree, Prev: patterns, Up: Base modules
+
+8.9 'markers'
+=============
+
+This module implements specialized routines for marking paths and
+angles. The principal mark routine provided by this module is
+markroutine markinterval(int n=1, frame f, bool rotated=false);
+which centers 'n' copies of frame 'f' within uniformly space intervals
+in arclength along the path, optionally rotated by the angle of the
+local tangent.
+
+ The 'marker' (*note marker::) routine can be used to construct new
+markers from these predefined frames:
+
+frame stickframe(int n=1, real size=0, pair space=0, real angle=0,
+ pair offset=0, pen p=currentpen);
+frame circlebarframe(int n=1, real barsize=0,
+ real radius=0,real angle=0,
+ pair offset=0, pen p=currentpen,
+ filltype filltype=NoFill, bool above=false);
+frame crossframe(int n=3, real size=0, pair space=0,
+ real angle=0, pair offset=0, pen p=currentpen);
+frame tildeframe(int n=1, real size=0, pair space=0,
+ real angle=0, pair offset=0, pen p=currentpen);
+
+ For convenience, this module also constructs the markers
+'StickIntervalMarker', 'CrossIntervalMarker', 'CircleBarIntervalMarker',
+and 'TildeIntervalMarker' from the above frames. The example
+'markers1.asy' illustrates the use of these markers:
+
+
+ [./markers1]
+
+ This module also provides a routine for marking an angle AOB:
+void markangle(picture pic=currentpicture, Label L="",
+ int n=1, real radius=0, real space=0,
+ pair A, pair O, pair B, arrowbar arrow=None,
+ pen p=currentpen, margin margin=NoMargin,
+ marker marker=nomarker);
+as illustrated in the example 'markers2.asy'.
+
+
+ [./markers2]
+
+
+File: asymptote.info, Node: map, Next: tree, Prev: markers, Up: Base modules
+
+8.10 'map'
+==========
+
+This module creates a struct parameterized by the types specified in
+strings 'key' and 'value', mapping keys to values with a specified
+default:
+import map;
+
+mapTemplate(name="map",key="string",value="int",default="-1");
+
+map M;
+
+M.add("z",2);
+M.add("a",3);
+M.add("d",4);
+write(M.lookup("a"));
+write(M.lookup("y"));
+
+
+File: asymptote.info, Node: tree, Next: binarytree, Prev: markers, Up: Base modules
+
+8.11 'tree'
+===========
+
+This module implements an example of a dynamic binary search tree.
+
+
+File: asymptote.info, Node: binarytree, Next: drawtree, Prev: tree, Up: Base modules
+
+8.12 'binarytree'
+=================
+
+This module can be used to draw an arbitrary binary tree and includes an
+input routine for the special case of a binary search tree, as
+illustrated in the example 'binarytreetest.asy':
+import binarytree;
+
+picture pic,pic2;
+
+binarytree bt=binarytree(1,2,4,nil,5,nil,nil,0,nil,nil,3,6,nil,nil,7);
+draw(pic,bt,condensed=false);
+
+binarytree st=searchtree(10,5,2,1,3,4,7,6,8,9,15,13,12,11,14,17,16,18,19);
+draw(pic2,st,blue,condensed=true);
+
+add(pic.fit(),(0,0),10N);
+add(pic2.fit(),(0,0),10S);
+
+
+ [./binarytreetest]
+
+
+File: asymptote.info, Node: drawtree, Next: syzygy, Prev: binarytree, Up: Base modules
+
+8.13 'drawtree'
+===============
+
+This is a simple tree drawing module used by the example 'treetest.asy'.
+
+
+File: asymptote.info, Node: syzygy, Next: feynman, Prev: drawtree, Up: Base modules
+
+8.14 'syzygy'
+=============
+
+This module automates the drawing of braids, relations, and syzygies,
+along with the corresponding equations, as illustrated in the example
+'knots.asy'.
+
+
+File: asymptote.info, Node: feynman, Next: roundedpath, Prev: syzygy, Up: Base modules
+
+8.15 'feynman'
+==============
+
+This module, contributed by Martin Wiebusch, is useful for drawing
+Feynman diagrams, as illustrated by the examples 'eetomumu.asy' and
+'fermi.asy'.
+
+
+File: asymptote.info, Node: roundedpath, Next: animation, Prev: feynman, Up: Base modules
+
+8.16 'roundedpath'
+==================
+
+This module, contributed by Stefan Knorr, is useful for rounding the
+sharp corners of paths, as illustrated in the example file
+'roundpath.asy'.
+
+
+File: asymptote.info, Node: animation, Next: embed, Prev: roundedpath, Up: Base modules
+
+8.17 'animation'
+================
+
+This module allows one to generate animations, as illustrated by the
+files 'wheel.asy', 'wavepacket.asy', and 'cube.asy' in the 'animations'
+subdirectory of the examples directory. These animations use the
+'ImageMagick' 'convert' program to merge multiple images into a GIF or
+MPEG movie.
+
+ The related 'animate' module, derived from the 'animation' module,
+generates higher-quality portable clickable PDF movies, with optional
+controls. This requires installing the module
+ <http://mirror.ctan.org/macros/latex/contrib/animate/animate.sty>
+(version 2007/11/30 or later) in a new directory 'animate' in the local
+'LaTeX' directory (for example, in
+'/usr/local/share/texmf/tex/latex/animate'). On 'UNIX' systems, one
+must then execute the command 'texhash'.
+
+ The example 'pdfmovie.asy' in the 'animations' directory, along with
+the slide presentations 'slidemovies.asy' and 'intro', illustrate the
+use of embedded PDF movies. The examples 'inlinemovie.tex' and
+'inlinemovie3.tex' show how to generate and embed PDF movies directly
+within a 'LaTeX' file (*note LaTeX usage::). The member function
+string pdf(fit fit=NoBox, real delay=animationdelay, string options="",
+ bool keep=settings.keep, bool multipage=true);
+of the 'animate' structure accepts any of the 'animate.sty' options, as
+described here:
+ <http://mirror.ctan.org/macros/latex/contrib/animate/doc/animate.pdf>
+
+
+File: asymptote.info, Node: embed, Next: slide, Prev: animation, Up: Base modules
+
+8.18 'embed'
+============
+
+This module provides an interface to the 'LaTeX' package (included with
+'MikTeX')
+ <http://mirror.ctan.org/macros/latex/contrib/media9>
+for embedding movies, sounds, and 3D objects into a PDF document.
+
+ A more portable method for embedding movie files, which should work
+on any platform and does not require the 'media9' package, is provided
+by using the 'external' module instead of 'embed'.
+
+ Examples of the above two interfaces is provided in the file
+'embeddedmovie.asy' in the 'animations' subdirectory of the examples
+directory and in 'externalmovie.asy'. For a higher quality embedded
+movie generated directly by 'Asymptote', use the 'animate' module along
+with the 'animate.sty' package to embed a portable PDF animation (*note
+animate::).
+
+ An example of embedding 'U3D' code is provided in the file
+'embeddedu3d'.
+
+
+File: asymptote.info, Node: slide, Next: MetaPost, Prev: embed, Up: Base modules
+
+8.19 'slide'
+============
+
+This module provides a simple yet high-quality facility for making
+presentation slides, including portable embedded PDF animations (see the
+file 'slidemovies.asy'). A simple example is provided in
+'slidedemo.asy'.
+
+
+File: asymptote.info, Node: MetaPost, Next: babel, Prev: slide, Up: Base modules
+
+8.20 'MetaPost'
+===============
+
+This module provides some useful routines to help 'MetaPost' users
+migrate old 'MetaPost' code to 'Asymptote'. Further contributions here
+are welcome.
+
+ Unlike 'MetaPost', 'Asymptote' does not implicitly solve linear
+equations and therefore does not have the notion of a 'whatever'
+unknown. The routine 'extension' (*note extension::) provides a useful
+replacement for a common use of 'whatever': finding the intersection
+point of the lines through 'P', 'Q' and 'p', 'q'. For less common
+occurrences of 'whatever', one can use the built-in explicit linear
+equation solver 'solve' instead.
+
+
+File: asymptote.info, Node: babel, Next: labelpath, Prev: MetaPost, Up: Base modules
+
+8.21 'babel'
+============
+
+This module implements the 'LaTeX' 'babel' package in 'Asymptote'. For
+example:
+import babel;
+babel("german");
+
+
+File: asymptote.info, Node: labelpath, Next: labelpath3, Prev: babel, Up: Base modules
+
+8.22 'labelpath'
+================
+
+This module uses the 'PSTricks' 'pstextpath' macro to fit labels along a
+path (properly kerned, as illustrated in the example file
+'curvedlabel.asy'), using the command
+void labelpath(picture pic=currentpicture, Label L, path g,
+ string justify=Centered, pen p=currentpen);
+Here 'justify' is one of 'LeftJustified', 'Centered', or
+'RightJustified'. The x component of a shift transform applied to the
+Label is interpreted as a shift along the curve, whereas the y component
+is interpreted as a shift away from the curve. All other Label
+transforms are ignored. This module requires the 'latex' tex engine and
+inherits the limitations of the 'PSTricks' '\pstextpath' macro.
+
+
+File: asymptote.info, Node: labelpath3, Next: annotate, Prev: labelpath, Up: Base modules
+
+8.23 'labelpath3'
+=================
+
+This module, contributed by Jens Schwaiger, implements a 3D version of
+'labelpath' that does not require the 'PSTricks' package. An example is
+provided in 'curvedlabel3.asy'.
+
+
+File: asymptote.info, Node: annotate, Next: CAD, Prev: labelpath3, Up: Base modules
+
+8.24 'annotate'
+===============
+
+This module supports PDF annotations for viewing with 'Adobe Reader',
+via the function
+void annotate(picture pic=currentpicture, string title, string text,
+ pair position);
+Annotations are illustrated in the example file 'annotation.asy'.
+Currently, annotations are only implemented for the 'latex' (default)
+and 'tex' TeX engines.
+
+
+File: asymptote.info, Node: CAD, Next: graph, Prev: annotate, Up: Base modules
+
+8.25 'CAD'
+==========
+
+This module, contributed by Mark Henning, provides basic pen definitions
+and measurement functions for simple 2D CAD drawings according to DIN
+15. It is documented separately, in the file 'CAD.pdf'.
+
+
+File: asymptote.info, Node: graph, Next: palette, Prev: CAD, Up: Base modules
+
+8.26 'graph'
+============
+
+This module implements two-dimensional linear and logarithmic graphs,
+including automatic scale and tick selection (with the ability to
+override manually). A graph is a 'guide' (that can be drawn with the
+draw command, with an optional legend) constructed with one of the
+following routines:
+
+ * guide graph(picture pic=currentpicture, real f(real), real a, real b,
+ int n=ngraph, real T(real)=identity,
+ interpolate join=operator --);
+ guide[] graph(picture pic=currentpicture, real f(real), real a, real b,
+ int n=ngraph, real T(real)=identity, bool3 cond(real),
+ interpolate join=operator --);
+
+ Returns a graph using the scaling information for picture 'pic'
+ (*note automatic scaling::) of the function 'f' on the interval
+ ['T'('a'),'T'('b')], sampling at 'n' points evenly spaced in
+ ['a','b'], optionally restricted by the bool3 function 'cond' on
+ ['a','b']. If 'cond' is:
+ * 'true', the point is added to the existing guide;
+ * 'default', the point is added to a new guide;
+ * 'false', the point is omitted and a new guide is begun.
+ The points are connected using the interpolation specified by
+ 'join':
+
+ * 'operator --' (linear interpolation; the abbreviation
+ 'Straight' is also accepted);
+
+ * 'operator ..' (piecewise Bezier cubic spline interpolation;
+ the abbreviation 'Spline' is also accepted);
+
+ * 'Hermite' (standard cubic spline interpolation using boundary
+ condition 'notaknot', 'natural', 'periodic', 'clamped(real
+ slopea, real slopeb)'), or 'monotonic'. The abbreviation
+ 'Hermite' is equivalent to 'Hermite(notaknot)' for nonperiodic
+ data and 'Hermite(periodic)' for periodic data).
+
+ * guide graph(picture pic=currentpicture, real x(real), real y(real),
+ real a, real b, int n=ngraph, real T(real)=identity,
+ interpolate join=operator --);
+ guide[] graph(picture pic=currentpicture, real x(real), real y(real),
+ real a, real b, int n=ngraph, real T(real)=identity,
+ bool3 cond(real), interpolate join=operator --);
+
+ Returns a graph using the scaling information for picture 'pic' of
+ the parametrized function ('x'(t),'y'(t)) for t in the interval
+ ['T'('a'),'T'('b')], sampling at 'n' points evenly spaced in
+ ['a','b'], optionally restricted by the bool3 function 'cond' on
+ ['a','b'], using the given interpolation type.
+
+ * guide graph(picture pic=currentpicture, pair z(real), real a, real b,
+ int n=ngraph, real T(real)=identity,
+ interpolate join=operator --);
+ guide[] graph(picture pic=currentpicture, pair z(real), real a, real b,
+ int n=ngraph, real T(real)=identity, bool3 cond(real),
+ interpolate join=operator --);
+
+ Returns a graph using the scaling information for picture 'pic' of
+ the parametrized function 'z'(t) for t in the interval
+ ['T'('a'),'T'('b')], sampling at 'n' points evenly spaced in
+ ['a','b'], optionally restricted by the bool3 function 'cond' on
+ ['a','b'], using the given interpolation type.
+
+ * guide graph(picture pic=currentpicture, pair[] z,
+ interpolate join=operator --);
+ guide[] graph(picture pic=currentpicture, pair[] z, bool3[] cond,
+ interpolate join=operator --);
+
+ Returns a graph using the scaling information for picture 'pic' of
+ the elements of the array 'z', optionally restricted to those
+ indices for which the elements of the boolean array 'cond' are
+ 'true', using the given interpolation type.
+
+ * guide graph(picture pic=currentpicture, real[] x, real[] y,
+ interpolate join=operator --);
+ guide[] graph(picture pic=currentpicture, real[] x, real[] y,
+ bool3[] cond, interpolate join=operator --);
+
+ Returns a graph using the scaling information for picture 'pic' of
+ the elements of the arrays ('x','y'), optionally restricted to
+ those indices for which the elements of the boolean array 'cond'
+ are 'true', using the given interpolation type.
+
+ * guide polargraph(picture pic=currentpicture, real f(real), real a,
+ real b, int n=ngraph, interpolate join=operator --);
+
+ Returns a polar-coordinate graph using the scaling information for
+ picture 'pic' of the function 'f' on the interval ['a','b'],
+ sampling at 'n' evenly spaced points, with the given interpolation
+ type.
+
+ * guide polargraph(picture pic=currentpicture, real[] r, real[] theta,
+ interpolate join=operator--);
+ Returns a polar-coordinate graph using the scaling information for
+ picture 'pic' of the elements of the arrays ('r','theta'), using
+ the given interpolation type.
+
+
+
+
+ An axis can be drawn on a picture with one of the following commands:
+
+ * void xaxis(picture pic=currentpicture, Label L="", axis axis=YZero,
+ real xmin=-infinity, real xmax=infinity, pen p=currentpen,
+ ticks ticks=NoTicks, arrowbar arrow=None, bool above=false);
+
+ Draw an x axis on picture 'pic' from x='xmin' to x='xmax' using pen
+ 'p', optionally labelling it with Label 'L'. The relative label
+ location along the axis (a real number from [0,1]) defaults to 1
+ (*note Label::), so that the label is drawn at the end of the axis.
+ An infinite value of 'xmin' or 'xmax' specifies that the
+ corresponding axis limit will be automatically determined from the
+ picture limits. The optional 'arrow' argument takes the same
+ values as in the 'draw' command (*note arrows::). The axis is
+ drawn before any existing objects in 'pic' unless 'above=true'.
+ The axis placement is determined by one of the following 'axis'
+ types:
+
+ 'YZero(bool extend=true)'
+ Request an x axis at y=0 (or y=1 on a logarithmic axis)
+ extending to the full dimensions of the picture, unless
+ 'extend'=false.
+
+ 'YEquals(real Y, bool extend=true)'
+ Request an x axis at y='Y' extending to the full dimensions of
+ the picture, unless 'extend'=false.
+
+ 'Bottom(bool extend=false)'
+ Request a bottom axis.
+
+ 'Top(bool extend=false)'
+ Request a top axis.
+
+ 'BottomTop(bool extend=false)'
+ Request a bottom and top axis.
+
+ Custom axis types can be created by following the examples in the
+ module 'graph.asy'. One can easily override the default values for
+ the standard axis types:
+ import graph;
+
+ YZero=new axis(bool extend=true) {
+ return new void(picture pic, axisT axis) {
+ real y=pic.scale.x.scale.logarithmic ? 1 : 0;
+ axis.value=I*pic.scale.y.T(y);
+ axis.position=1;
+ axis.side=right;
+ axis.align=2.5E;
+ axis.value2=Infinity;
+ axis.extend=extend;
+ };
+ };
+ YZero=YZero();
+
+
+ The default tick option is 'NoTicks'. The options 'LeftTicks',
+ 'RightTicks', or 'Ticks' can be used to draw ticks on the left,
+ right, or both sides of the path, relative to the direction in
+ which the path is drawn. These tick routines accept a number of
+ optional arguments:
+ ticks LeftTicks(Label format="", ticklabel ticklabel=null,
+ bool beginlabel=true, bool endlabel=true,
+ int N=0, int n=0, real Step=0, real step=0,
+ bool begin=true, bool end=true, tickmodifier modify=None,
+ real Size=0, real size=0, bool extend=false,
+ pen pTick=nullpen, pen ptick=nullpen);
+
+ If any of these parameters are omitted, reasonable defaults will be
+ chosen:
+ 'Label format'
+ override the default tick label format ('defaultformat',
+ initially "$%.4g$"), rotation, pen, and alignment (for
+ example, 'LeftSide', 'Center', or 'RightSide') relative to the
+ axis. To enable 'LaTeX' math mode fonts, the format string
+ should begin and end with '$' *note format::. If the format
+ string is 'trailingzero', trailing zeros will be added to the
+ tick labels; if the format string is '"%"', the tick label
+ will be suppressed;
+ 'ticklabel'
+ is a function 'string(real x)' returning the label (by
+ default, format(format.s,x)) for each major tick value 'x';
+ 'bool beginlabel'
+ include the first label;
+ 'bool endlabel'
+ include the last label;
+ 'int N'
+ when automatic scaling is enabled (the default; *note
+ automatic scaling::), divide a linear axis evenly into this
+ many intervals, separated by major ticks; for a logarithmic
+ axis, this is the number of decades between labelled ticks;
+ 'int n'
+ divide each interval into this many subintervals, separated by
+ minor ticks;
+ 'real Step'
+ the tick value spacing between major ticks (if 'N'='0');
+ 'real step'
+ the tick value spacing between minor ticks (if 'n'='0');
+ 'bool begin'
+ include the first major tick;
+ 'bool end'
+ include the last major tick;
+ 'tickmodifier modify;'
+ an optional function that takes and returns a 'tickvalue'
+ structure having real[] members 'major' and 'minor' consisting
+ of the tick values (to allow modification of the automatically
+ generated tick values);
+ 'real Size'
+ the size of the major ticks (in 'PostScript' coordinates);
+ 'real size'
+ the size of the minor ticks (in 'PostScript' coordinates);
+ 'bool extend;'
+ extend the ticks between two axes (useful for drawing a grid
+ on the graph);
+ 'pen pTick'
+ an optional pen used to draw the major ticks;
+ 'pen ptick'
+ an optional pen used to draw the minor ticks.
+
+ For convenience, the predefined tickmodifiers 'OmitTick(... real[]
+ x)', 'OmitTickInterval(real a, real b)', and
+ 'OmitTickIntervals(real[] a, real[] b)' can be used to remove
+ specific auto-generated ticks and their labels. The
+ 'OmitFormat(string s=defaultformat ... real[] x)' ticklabel can be
+ used to remove specific tick labels but not the corresponding
+ ticks. The tickmodifier 'NoZero' is an abbreviation for
+ 'OmitTick(0)' and the ticklabel 'NoZeroFormat' is an abbrevation
+ for 'OmitFormat(0)'.
+
+ It is also possible to specify custom tick locations with
+ 'LeftTicks', 'RightTicks', and 'Ticks' by passing explicit real
+ arrays 'Ticks' and (optionally) 'ticks' containing the locations of
+ the major and minor ticks, respectively:
+ ticks LeftTicks(Label format="", ticklabel ticklabel=null,
+ bool beginlabel=true, bool endlabel=true,
+ real[] Ticks, real[] ticks=new real[],
+ real Size=0, real size=0, bool extend=false,
+ pen pTick=nullpen, pen ptick=nullpen)
+
+ * void yaxis(picture pic=currentpicture, Label L="", axis axis=XZero,
+ real ymin=-infinity, real ymax=infinity, pen p=currentpen,
+ ticks ticks=NoTicks, arrowbar arrow=None, bool above=false,
+ bool autorotate=true);
+
+ Draw a y axis on picture 'pic' from y='ymin' to y='ymax' using pen
+ 'p', optionally labelling it with a Label 'L' that is autorotated
+ unless 'autorotate=false'. The relative location of the label (a
+ real number from [0,1]) defaults to 1 (*note Label::). An infinite
+ value of 'ymin' or 'ymax' specifies that the corresponding axis
+ limit will be automatically determined from the picture limits.
+ The optional 'arrow' argument takes the same values as in the
+ 'draw' command (*note arrows::). The axis is drawn before any
+ existing objects in 'pic' unless 'above=true'. The tick type is
+ specified by 'ticks' and the axis placement is determined by one of
+ the following 'axis' types:
+
+ 'XZero(bool extend=true)'
+ Request a y axis at x=0 (or x=1 on a logarithmic axis)
+ extending to the full dimensions of the picture, unless
+ 'extend'=false.
+
+ 'XEquals(real X, bool extend=true)'
+ Request a y axis at x='X' extending to the full dimensions of
+ the picture, unless 'extend'=false.
+
+ 'Left(bool extend=false)'
+ Request a left axis.
+
+ 'Right(bool extend=false)'
+ Request a right axis.
+
+ 'LeftRight(bool extend=false)'
+ Request a left and right axis.
+
+ * For convenience, the functions
+ void xequals(picture pic=currentpicture, Label L="", real x,
+ bool extend=false, real ymin=-infinity, real ymax=infinity,
+ pen p=currentpen, ticks ticks=NoTicks, bool above=true,
+ arrowbar arrow=None);
+ and
+ void yequals(picture pic=currentpicture, Label L="", real y,
+ bool extend=false, real xmin=-infinity, real xmax=infinity,
+ pen p=currentpen, ticks ticks=NoTicks, bool above=true,
+ arrowbar arrow=None);
+ can be respectively used to call 'yaxis' and 'xaxis' with the
+ appropriate axis types 'XEquals(x,extend)' and 'YEquals(y,extend)'.
+ This is the recommended way of drawing vertical or horizontal lines
+ and axes at arbitrary locations.
+
+ * void axes(picture pic=currentpicture, Label xlabel="", Label ylabel="",
+ bool extend=true,
+ pair min=(-infinity,-infinity), pair max=(infinity,infinity),
+ pen p=currentpen, arrowbar arrow=None, bool above=false);
+ This convenience routine draws both x and y axes on picture 'pic'
+ from 'min' to 'max', with optional labels 'xlabel' and 'ylabel' and
+ any arrows specified by 'arrow'. The axes are drawn on top of
+ existing objects in 'pic' only if 'above=true'.
+
+ * void axis(picture pic=currentpicture, Label L="", path g,
+ pen p=currentpen, ticks ticks, ticklocate locate,
+ arrowbar arrow=None, int[] divisor=new int[],
+ bool above=false, bool opposite=false);
+
+ This routine can be used to draw on picture 'pic' a general axis
+ based on an arbitrary path 'g', using pen 'p'. One can optionally
+ label the axis with Label 'L' and add an arrow 'arrow'. The tick
+ type is given by 'ticks'. The optional integer array 'divisor'
+ specifies what tick divisors to try in the attempt to produce
+ uncrowded tick labels. A 'true' value for the flag 'opposite'
+ identifies an unlabelled secondary axis (typically drawn opposite a
+ primary axis). The axis is drawn before any existing objects in
+ 'pic' unless 'above=true'. The tick locator 'ticklocate' is
+ constructed by the routine
+ ticklocate ticklocate(real a, real b, autoscaleT S=defaultS,
+ real tickmin=-infinity, real tickmax=infinity,
+ real time(real)=null, pair dir(real)=zero);
+ where 'a' and 'b' specify the respective tick values at
+ 'point(g,0)' and 'point(g,length(g))', 'S' specifies the
+ autoscaling transformation, the function 'real time(real v)'
+ returns the time corresponding to the value 'v', and 'pair dir(real
+ t)' returns the absolute tick direction as a function of 't' (zero
+ means draw the tick perpendicular to the axis).
+
+ * These routines are useful for manually putting ticks and labels on
+ axes (if the variable 'Label' is given as the 'Label' argument, the
+ 'format' argument will be used to format a string based on the tick
+ location):
+ void xtick(picture pic=currentpicture, Label L="", explicit pair z,
+ pair dir=N, string format="",
+ real size=Ticksize, pen p=currentpen);
+ void xtick(picture pic=currentpicture, Label L="", real x,
+ pair dir=N, string format="",
+ real size=Ticksize, pen p=currentpen);
+ void ytick(picture pic=currentpicture, Label L="", explicit pair z,
+ pair dir=E, string format="",
+ real size=Ticksize, pen p=currentpen);
+ void ytick(picture pic=currentpicture, Label L="", real y,
+ pair dir=E, string format="",
+ real size=Ticksize, pen p=currentpen);
+ void tick(picture pic=currentpicture, pair z,
+ pair dir, real size=Ticksize, pen p=currentpen);
+ void labelx(picture pic=currentpicture, Label L="", explicit pair z,
+ align align=S, string format="", pen p=currentpen);
+ void labelx(picture pic=currentpicture, Label L="", real x,
+ align align=S, string format="", pen p=currentpen);
+ void labelx(picture pic=currentpicture, Label L,
+ string format="", explicit pen p=currentpen);
+ void labely(picture pic=currentpicture, Label L="", explicit pair z,
+ align align=W, string format="", pen p=currentpen);
+ void labely(picture pic=currentpicture, Label L="", real y,
+ align align=W, string format="", pen p=currentpen);
+ void labely(picture pic=currentpicture, Label L,
+ string format="", explicit pen p=currentpen);
+
+ Here are some simple examples of two-dimensional graphs:
+
+ 1. This example draws a textbook-style graph of y= exp(x), with the y
+ axis starting at y=0:
+ import graph;
+ size(150,0);
+
+ real f(real x) {return exp(x);}
+ pair F(real x) {return (x,f(x));}
+
+ draw(graph(f,-4,2,operator ..),red);
+
+ xaxis("$x$");
+ yaxis("$y$",0);
+
+ labely(1,E);
+ label("$e^x$",F(1),SE);
+
+
+ [./exp]
+
+ 2. The next example draws a scientific-style graph with a legend. The
+ position of the legend can be adjusted either explicitly or by
+ using the graphical user interface (*note GUI::). If an
+ 'UnFill(real xmargin=0, real ymargin=xmargin)' or 'Fill(pen)'
+ option is specified to 'add', the legend will obscure any
+ underlying objects. Here we illustrate how to clip the portion of
+ the picture covered by a label:
+
+ import graph;
+
+ size(400,200,IgnoreAspect);
+
+ real Sin(real t) {return sin(2pi*t);}
+ real Cos(real t) {return cos(2pi*t);}
+
+ draw(graph(Sin,0,1),red,"$\sin(2\pi x)$");
+ draw(graph(Cos,0,1),blue,"$\cos(2\pi x)$");
+
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$y$",LeftRight,RightTicks(trailingzero));
+
+ label("LABEL",point(0),UnFill(1mm));
+
+ add(legend(),point(E),20E,UnFill);
+
+ [./lineargraph0]
+
+ To specify a fixed size for the graph proper, use 'attach':
+ import graph;
+
+ size(250,200,IgnoreAspect);
+
+ real Sin(real t) {return sin(2pi*t);}
+ real Cos(real t) {return cos(2pi*t);}
+
+ draw(graph(Sin,0,1),red,"$\sin(2\pi x)$");
+ draw(graph(Cos,0,1),blue,"$\cos(2\pi x)$");
+
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$y$",LeftRight,RightTicks(trailingzero));
+
+ label("LABEL",point(0),UnFill(1mm));
+
+ attach(legend(),truepoint(E),20E,UnFill);
+
+ A legend can have multiple entries per line:
+ import graph;
+ size(8cm,6cm,IgnoreAspect);
+
+ typedef real realfcn(real);
+ realfcn F(real p) {
+ return new real(real x) {return sin(p*x);};
+ };
+
+ for(int i=1; i < 5; ++i)
+ draw(graph(F(i*pi),0,1),Pen(i),
+ "$\sin("+(i == 1 ? "" : (string) i)+"\pi x)$");
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$y$",LeftRight,RightTicks(trailingzero));
+
+ attach(legend(2),(point(S).x,truepoint(S).y),10S,UnFill);
+
+ [./legend]
+
+ 3. This example draws a graph of one array versus another (both of the
+ same size) using custom tick locations and a smaller font size for
+ the tick labels on the y axis.
+ import graph;
+
+ size(200,150,IgnoreAspect);
+
+ real[] x={0,1,2,3};
+ real[] y=x^2;
+
+ draw(graph(x,y),red);
+
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$y$",LeftRight,
+ RightTicks(Label(fontsize(8pt)),new real[]{0,4,9}));
+
+ [./datagraph]
+
+ 4. This example shows how to graph columns of data read from a file.
+ import graph;
+
+ size(200,150,IgnoreAspect);
+
+ file in=input("filegraph.dat").line();
+ real[][] a=in;
+ a=transpose(a);
+
+ real[] x=a[0];
+ real[] y=a[1];
+
+ draw(graph(x,y),red);
+
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$y$",LeftRight,RightTicks);
+
+ [./filegraph]
+
+ 5. The next example draws two graphs of an array of coordinate pairs,
+ using frame alignment and data markers. In the left-hand graph,
+ the markers, constructed with
+ marker marker(path g, markroutine markroutine=marknodes,
+ pen p=currentpen, filltype filltype=NoFill,
+ bool above=true);
+ using the path 'unitcircle' (*note filltype::), are drawn below
+ each node. Any frame can be converted to a marker, using
+ marker marker(frame f, markroutine markroutine=marknodes,
+ bool above=true);
+ In the right-hand graph, the unit n-sided regular polygon
+ 'polygon(int n)' and the unit n-point cyclic cross 'cross(int n,
+ bool round=true, real r=0)' (where 'r' is an optional "inner"
+ radius) are used to build a custom marker frame. Here
+ 'markuniform(bool centered=false, int n, bool rotated=false)' adds
+ this frame at 'n' uniformly spaced points along the arclength of
+ the path, optionally rotated by the angle of the local tangent to
+ the path (if centered is true, the frames will be centered within
+ 'n' evenly spaced arclength intervals). Alternatively, one can use
+ markroutine 'marknodes' to request that the marks be placed at each
+ Bezier node of the path, or markroutine 'markuniform(pair z(real
+ t), real a, real b, int n)' to place marks at points 'z(t)' for n
+ evenly spaced values of 't' in '[a,b]'.
+
+ These markers are predefined:
+ marker[] Mark={
+ marker(scale(circlescale)*unitcircle),
+ marker(polygon(3)),marker(polygon(4)),
+ marker(polygon(5)),marker(invert*polygon(3)),
+ marker(cross(4)),marker(cross(6))
+ };
+
+ marker[] MarkFill={
+ marker(scale(circlescale)*unitcircle,Fill),marker(polygon(3),Fill),
+ marker(polygon(4),Fill),marker(polygon(5),Fill),
+ marker(invert*polygon(3),Fill)
+ };
+
+ The example also illustrates the 'errorbar' routines:
+
+ void errorbars(picture pic=currentpicture, pair[] z, pair[] dp,
+ pair[] dm={}, bool[] cond={}, pen p=currentpen,
+ real size=0);
+
+ void errorbars(picture pic=currentpicture, real[] x, real[] y,
+ real[] dpx, real[] dpy, real[] dmx={}, real[] dmy={},
+ bool[] cond={}, pen p=currentpen, real size=0);
+
+ Here, the positive and negative extents of the error are given by
+ the absolute values of the elements of the pair array 'dp' and the
+ optional pair array 'dm'. If 'dm' is not specified, the positive
+ and negative extents of the error are assumed to be equal.
+ import graph;
+
+ picture pic;
+ real xsize=200, ysize=140;
+ size(pic,xsize,ysize,IgnoreAspect);
+
+ pair[] f={(5,5),(50,20),(90,90)};
+ pair[] df={(0,0),(5,7),(0,5)};
+
+ errorbars(pic,f,df,red);
+ draw(pic,graph(pic,f),"legend",
+ marker(scale(0.8mm)*unitcircle,red,FillDraw(blue),above=false));
+
+ scale(pic,true);
+
+ xaxis(pic,"$x$",BottomTop,LeftTicks);
+ yaxis(pic,"$y$",LeftRight,RightTicks);
+ add(pic,legend(pic),point(pic,NW),20SE,UnFill);
+
+ picture pic2;
+ size(pic2,xsize,ysize,IgnoreAspect);
+
+ frame mark;
+ filldraw(mark,scale(0.8mm)*polygon(6),green,green);
+ draw(mark,scale(0.8mm)*cross(6),blue);
+
+ draw(pic2,graph(pic2,f),marker(mark,markuniform(5)));
+
+ scale(pic2,true);
+
+ xaxis(pic2,"$x$",BottomTop,LeftTicks);
+ yaxis(pic2,"$y$",LeftRight,RightTicks);
+
+ yequals(pic2,55.0,red+Dotted);
+ xequals(pic2,70.0,red+Dotted);
+
+ // Fit pic to W of origin:
+ add(pic.fit(),(0,0),W);
+
+ // Fit pic2 to E of (5mm,0):
+ add(pic2.fit(),(5mm,0),E);
+
+
+ [./errorbars]
+
+ 6. A custom mark routine can be also be specified:
+ import graph;
+
+ size(200,100,IgnoreAspect);
+
+ markroutine marks() {
+ return new void(picture pic=currentpicture, frame f, path g) {
+ path p=scale(1mm)*unitcircle;
+ for(int i=0; i <= length(g); ++i) {
+ pair z=point(g,i);
+ frame f;
+ if(i % 4 == 0) {
+ fill(f,p);
+ add(pic,f,z);
+ } else {
+ if(z.y > 50) {
+ pic.add(new void(frame F, transform t) {
+ path q=shift(t*z)*p;
+ unfill(F,q);
+ draw(F,q);
+ });
+ } else {
+ draw(f,p);
+ add(pic,f,z);
+ }
+ }
+ }
+ };
+ }
+
+ pair[] f={(5,5),(40,20),(55,51),(90,30)};
+
+ draw(graph(f),marker(marks()));
+
+ scale(true);
+
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$y$",LeftRight,RightTicks);
+
+ [./graphmarkers]
+
+ 7. This example shows how to label an axis with arbitrary strings.
+ import graph;
+
+ size(400,150,IgnoreAspect);
+
+ real[] x=sequence(12);
+ real[] y=sin(2pi*x/12);
+
+ scale(false);
+
+ string[] month={"Jan","Feb","Mar","Apr","May","Jun",
+ "Jul","Aug","Sep","Oct","Nov","Dec"};
+
+ draw(graph(x,y),red,MarkFill[0]);
+
+ xaxis(BottomTop,LeftTicks(new string(real x) {
+ return month[round(x % 12)];}));
+ yaxis("$y$",LeftRight,RightTicks(4));
+
+ [./monthaxis]
+
+ 8. The next example draws a graph of a parametrized curve. The calls
+ to
+ xlimits(picture pic=currentpicture, real min=-infinity,
+ real max=infinity, bool crop=NoCrop);
+ and the analogous function 'ylimits' can be uncommented to set the
+ respective axes limits for picture 'pic' to the specified 'min' and
+ 'max' values. Alternatively, the function
+ void limits(picture pic=currentpicture, pair min, pair max, bool crop=NoCrop);
+ can be used to limit the axes to the box having opposite vertices
+ at the given pairs). Existing objects in picture 'pic' will be
+ cropped to lie within the given limits if 'crop'='Crop'. The
+ function 'crop(picture pic)' can be used to crop a graph to the
+ current graph limits.
+ import graph;
+
+ size(0,200);
+
+ real x(real t) {return cos(2pi*t);}
+ real y(real t) {return sin(2pi*t);}
+
+ draw(graph(x,y,0,1));
+
+ //limits((0,-1),(1,0),Crop);
+
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$y$",LeftRight,RightTicks(trailingzero));
+
+
+
+ [./parametricgraph]
+
+ The next example illustrates how one can extract a common axis
+ scaling factor.
+ import graph;
+
+ axiscoverage=0.9;
+ size(200,IgnoreAspect);
+
+ real[] x={-1e-11,1e-11};
+ real[] y={0,1e6};
+
+ real xscale=round(log10(max(x)));
+ real yscale=round(log10(max(y)))-1;
+
+ draw(graph(x*10^(-xscale),y*10^(-yscale)),red);
+
+ xaxis("$x/10^{"+(string) xscale+"}$",BottomTop,LeftTicks);
+ yaxis("$y/10^{"+(string) yscale+"}$",LeftRight,RightTicks(trailingzero));
+
+ [./scaledgraph]
+
+ Axis scaling can be requested and/or automatic selection of the
+ axis limits can be inhibited with one of these 'scale' routines:
+ void scale(picture pic=currentpicture, scaleT x, scaleT y);
+
+ void scale(picture pic=currentpicture, bool xautoscale=true,
+ bool yautoscale=xautoscale, bool zautoscale=yautoscale);
+
+ This sets the scalings for picture 'pic'. The 'graph' routines
+ accept an optional 'picture' argument for determining the
+ appropriate scalings to use; if none is given, it uses those set
+ for 'currentpicture'.
+
+ Two frequently used scaling routines 'Linear' and 'Log' are
+ predefined in 'graph'.
+
+ All picture coordinates (including those in paths and those given
+ to the 'label' and 'limits' functions) are always treated as linear
+ (post-scaled) coordinates. Use
+ pair Scale(picture pic=currentpicture, pair z);
+ to convert a graph coordinate into a scaled picture coordinate.
+
+ The x and y components can be individually scaled using the
+ analogous routines
+ real ScaleX(picture pic=currentpicture, real x);
+ real ScaleY(picture pic=currentpicture, real y);
+
+ The predefined scaling routines can be given two optional boolean
+ arguments: 'automin=false' and 'automax=automin'. These default to
+ 'false' but can be respectively set to 'true' to enable automatic
+ selection of "nice" axis minimum and maximum values. The 'Linear'
+ scaling can also take as optional final arguments a multiplicative
+ scaling factor and intercept (e.g. for a depth axis, 'Linear(-1)'
+ requests axis reversal).
+
+ For example, to draw a log/log graph of a function, use
+ 'scale(Log,Log)':
+ import graph;
+
+ size(200,200,IgnoreAspect);
+
+ real f(real t) {return 1/t;}
+
+ scale(Log,Log);
+
+ draw(graph(f,0.1,10));
+
+ //limits((1,0.1),(10,0.5),Crop);
+
+ dot(Label("(3,5)",align=S),Scale((3,5)));
+
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$y$",LeftRight,RightTicks);
+
+
+ [./loggraph]
+
+ By extending the ticks, one can easily produce a logarithmic grid:
+ import graph;
+ size(200,200,IgnoreAspect);
+
+ real f(real t) {return 1/t;}
+
+ scale(Log,Log);
+ draw(graph(f,0.1,10),red);
+ pen thin=linewidth(0.5*linewidth());
+ xaxis("$x$",BottomTop,LeftTicks(begin=false,end=false,extend=true,
+ ptick=thin));
+ yaxis("$y$",LeftRight,RightTicks(begin=false,end=false,extend=true,
+ ptick=thin));
+
+
+
+ [./loggrid]
+
+ One can also specify custom tick locations and formats for
+ logarithmic axes:
+ import graph;
+
+ size(300,175,IgnoreAspect);
+ scale(Log,Log);
+ draw(graph(identity,5,20));
+ xlimits(5,20);
+ ylimits(1,100);
+ xaxis("$M/M_\odot$",BottomTop,LeftTicks(DefaultFormat,
+ new real[] {6,10,12,14,16,18}));
+ yaxis("$\nu_{\rm upp}$ [Hz]",LeftRight,RightTicks(DefaultFormat));
+
+
+ [./logticks]
+
+ It is easy to draw logarithmic graphs with respect to other bases:
+ import graph;
+ size(200,IgnoreAspect);
+
+ // Base-2 logarithmic scale on y-axis:
+
+ real log2(real x) {static real log2=log(2); return log(x)/log2;}
+ real pow2(real x) {return 2^x;}
+
+ scaleT yscale=scaleT(log2,pow2,logarithmic=true);
+ scale(Linear,yscale);
+
+ real f(real x) {return 1+x^2;}
+
+ draw(graph(f,-4,4));
+
+ yaxis("$y$",ymin=1,ymax=f(5),RightTicks(Label(Fill(white))),EndArrow);
+ xaxis("$x$",xmin=-5,xmax=5,LeftTicks,EndArrow);
+
+ [./log2graph]
+
+ Here is an example of "broken" linear x and logarithmic y axes that
+ omit the segments [3,8] and [100,1000], respectively. In the case
+ of a logarithmic axis, the break endpoints are automatically
+ rounded to the nearest integral power of the base.
+ import graph;
+
+ size(200,150,IgnoreAspect);
+
+ // Break the x axis at 3; restart at 8:
+ real a=3, b=8;
+
+ // Break the y axis at 100; restart at 1000:
+ real c=100, d=1000;
+
+ scale(Broken(a,b),BrokenLog(c,d));
+
+ real[] x={1,2,4,6,10};
+ real[] y=x^4;
+
+ draw(graph(x,y),red,MarkFill[0]);
+
+ xaxis("$x$",BottomTop,LeftTicks(Break(a,b)));
+ yaxis("$y$",LeftRight,RightTicks(Break(c,d)));
+
+ label(rotate(90)*Break,(a,point(S).y));
+ label(rotate(90)*Break,(a,point(N).y));
+ label(Break,(point(W).x,ScaleY(c)));
+ label(Break,(point(E).x,ScaleY(c)));
+
+
+ [./brokenaxis]
+
+ 9. 'Asymptote' can draw secondary axes with the routines
+ picture secondaryX(picture primary=currentpicture, void f(picture));
+ picture secondaryY(picture primary=currentpicture, void f(picture));
+
+ In this example, 'secondaryY' is used to draw a secondary linear y
+ axis against a primary logarithmic y axis:
+ import graph;
+ texpreamble("\def\Arg{\mathop {\rm Arg}\nolimits}");
+
+ size(10cm,5cm,IgnoreAspect);
+
+ real ampl(real x) {return 2.5/sqrt(1+x^2);}
+ real phas(real x) {return -atan(x)/pi;}
+
+ scale(Log,Log);
+ draw(graph(ampl,0.01,10));
+ ylimits(0.001,100);
+
+ xaxis("$\omega\tau_0$",BottomTop,LeftTicks);
+ yaxis("$|G(\omega\tau_0)|$",Left,RightTicks);
+
+ picture q=secondaryY(new void(picture pic) {
+ scale(pic,Log,Linear);
+ draw(pic,graph(pic,phas,0.01,10),red);
+ ylimits(pic,-1.0,1.5);
+ yaxis(pic,"$\Arg G/\pi$",Right,red,
+ LeftTicks("$% #.1f$",
+ begin=false,end=false));
+ yequals(pic,1,Dotted);
+ });
+ label(q,"(1,0)",Scale(q,(1,0)),red);
+ add(q);
+
+
+ [./Bode]
+
+ A secondary logarithmic y axis can be drawn like this:
+ import graph;
+
+ size(9cm,6cm,IgnoreAspect);
+ string data="secondaryaxis.csv";
+
+ file in=input(data).line().csv();
+
+ string[] titlelabel=in;
+ string[] columnlabel=in;
+
+ real[][] a=in;
+ a=transpose(a);
+ real[] t=a[0], susceptible=a[1], infectious=a[2], dead=a[3], larvae=a[4];
+ real[] susceptibleM=a[5], exposed=a[6],infectiousM=a[7];
+
+ scale(true);
+
+ draw(graph(t,susceptible,t >= 10 & t <= 15));
+ draw(graph(t,dead,t >= 10 & t <= 15),dashed);
+
+ xaxis("Time ($\tau$)",BottomTop,LeftTicks);
+ yaxis(Left,RightTicks);
+
+ picture secondary=secondaryY(new void(picture pic) {
+ scale(pic,Linear(true),Log(true));
+ draw(pic,graph(pic,t,infectious,t >= 10 & t <= 15),red);
+ yaxis(pic,Right,red,LeftTicks(begin=false,end=false));
+ });
+
+ add(secondary);
+ label(shift(5mm*N)*"Proportion of crows",point(NW),E);
+
+
+ [./secondaryaxis]
+
+ 10. Here is a histogram example, which uses the 'stats' module.
+ import graph;
+ import stats;
+
+ size(400,200,IgnoreAspect);
+
+ int n=10000;
+ real[] a=new real[n];
+ for(int i=0; i < n; ++i) a[i]=Gaussrand();
+
+ draw(graph(Gaussian,min(a),max(a)),blue);
+
+ // Optionally calculate "optimal" number of bins a la Shimazaki and Shinomoto.
+ int N=bins(a);
+
+ histogram(a,min(a),max(a),N,normalize=true,low=0,lightred,black,bars=false);
+
+ xaxis("$x$",BottomTop,LeftTicks);
+ yaxis("$dP/dx$",LeftRight,RightTicks(trailingzero));
+
+
+ [./histogram]
+
+ 11. Here is an example of reading column data in from a file and a
+ least-squares fit, using the 'stats' module.
+ size(400,200,IgnoreAspect);
+
+ import graph;
+ import stats;
+
+ file fin=input("leastsquares.dat").line();
+
+ real[][] a=fin;
+ a=transpose(a);
+
+ real[] t=a[0], rho=a[1];
+
+ // Read in parameters from the keyboard:
+ //real first=getreal("first");
+ //real step=getreal("step");
+ //real last=getreal("last");
+
+ real first=100;
+ real step=50;
+ real last=700;
+
+ // Remove negative or zero values of rho:
+ t=rho > 0 ? t : null;
+ rho=rho > 0 ? rho : null;
+
+ scale(Log(true),Linear(true));
+
+ int n=step > 0 ? ceil((last-first)/step) : 0;
+
+ real[] T,xi,dxi;
+
+ for(int i=0; i <= n; ++i) {
+ real first=first+i*step;
+ real[] logrho=(t >= first & t <= last) ? log(rho) : null;
+ real[] logt=(t >= first & t <= last) ? -log(t) : null;
+
+ if(logt.length < 2) break;
+
+ // Fit to the line logt=L.m*logrho+L.b:
+ linefit L=leastsquares(logt,logrho);
+
+ T.push(first);
+ xi.push(L.m);
+ dxi.push(L.dm);
+ }
+
+ draw(graph(T,xi),blue);
+ errorbars(T,xi,dxi,red);
+
+ crop();
+
+ ylimits(0);
+
+ xaxis("$T$",BottomTop,LeftTicks);
+ yaxis("$\xi$",LeftRight,RightTicks);
+
+ [./leastsquares]
+
+ 12. Here is an example that illustrates the general 'axis' routine.
+ import graph;
+ size(0,100);
+
+ path g=ellipse((0,0),1,2);
+
+ scale(true);
+
+ axis(Label("C",align=10W),g,LeftTicks(endlabel=false,8,end=false),
+ ticklocate(0,360,new real(real v) {
+ path h=(0,0)--max(abs(max(g)),abs(min(g)))*dir(v);
+ return intersect(g,h)[0];}));
+
+ [./generalaxis]
+
+ 13. To draw a vector field of 'n' arrows evenly spaced along the
+ arclength of a path, use the routine
+ picture vectorfield(path vector(real), path g, int n, bool truesize=false,
+ pen p=currentpen, arrowbar arrow=Arrow);
+ as illustrated in this simple example of a flow field:
+ import graph;
+ defaultpen(1.0);
+
+ size(0,150,IgnoreAspect);
+
+ real arrowsize=4mm;
+ real arrowlength=2arrowsize;
+
+ typedef path vector(real);
+
+ // Return a vector interpolated linearly between a and b.
+ vector vector(pair a, pair b) {
+ return new path(real x) {
+ return (0,0)--arrowlength*interp(a,b,x);
+ };
+ }
+
+ real f(real x) {return 1/x;}
+
+ real epsilon=0.5;
+ path g=graph(f,epsilon,1/epsilon);
+
+ int n=3;
+ draw(g);
+ xaxis("$x$");
+ yaxis("$y$");
+
+ add(vectorfield(vector(W,W),g,n,true));
+ add(vectorfield(vector(NE,NW),(0,0)--(point(E).x,0),n,true));
+ add(vectorfield(vector(NE,NE),(0,0)--(0,point(N).y),n,true));
+
+
+ [./flow]
+
+ 14. To draw a vector field of 'nx'\times'ny' arrows in 'box(a,b)', use
+ the routine
+ picture vectorfield(path vector(pair), pair a, pair b,
+ int nx=nmesh, int ny=nx, bool truesize=false,
+ real maxlength=truesize ? 0 : maxlength(a,b,nx,ny),
+ bool cond(pair z)=null, pen p=currentpen,
+ arrowbar arrow=Arrow, margin margin=PenMargin)
+ as illustrated in this example:
+ import graph;
+ size(100);
+
+ pair a=(0,0);
+ pair b=(2pi,2pi);
+
+ path vector(pair z) {return (0,0)--(sin(z.x),cos(z.y));}
+
+ add(vectorfield(vector,a,b));
+
+ [./vectorfield]
+
+ 15. The following scientific graphs, which illustrate many features of
+ 'Asymptote''s graphics routines, were generated from the examples
+ 'diatom.asy' and 'westnile.asy', using the comma-separated data in
+ 'diatom.csv' and 'westnile.csv'.
+
+
+ [./diatom]
+
+ [./westnile]
+
+
+File: asymptote.info, Node: palette, Next: three, Prev: graph, Up: Base modules
+
+8.27 'palette'
+==============
+
+'Asymptote' can also generate color density images and palettes. The
+following palettes are predefined in 'palette.asy':
+
+'pen[] Grayscale(int NColors=256)'
+ a grayscale palette;
+
+'pen[] Rainbow(int NColors=32766)'
+ a rainbow spectrum;
+
+'pen[] BWRainbow(int NColors=32761)'
+ a rainbow spectrum tapering off to black/white at the ends;
+
+'pen[] BWRainbow2(int NColors=32761)'
+ a double rainbow palette tapering off to black/white at the ends,
+ with a linearly scaled intensity.
+
+'pen[] Wheel(int NColors=32766)'
+ a full color wheel palette;
+
+'pen[] Gradient(int NColors=256 ... pen[] p)'
+ a palette varying linearly over the specified array of pens, using
+ NColors in each interpolation interval;
+
+ The function 'cmyk(pen[] Palette)' may be used to convert any of
+these palettes to the CMYK colorspace.
+
+ A color density plot using palette 'palette' can be generated from a
+function 'f'(x,y) and added to a picture 'pic':
+bounds image(picture pic=currentpicture, real f(real, real),
+ range range=Full, pair initial, pair final,
+ int nx=ngraph, int ny=nx, pen[] palette, bool antialias=false)
+ The function 'f' will be sampled at 'nx' and 'ny' evenly spaced
+points over a rectangle defined by the points 'initial' and 'final',
+respecting the current graphical scaling of 'pic'. The color space is
+scaled according to the z axis scaling (*note automatic scaling::). A
+bounds structure for the function values is returned:
+struct bounds {
+ real min;
+ real max;
+ // Possible tick intervals:
+ int[] divisor;
+}
+This information can be used for generating an optional palette bar.
+The palette color space corresponds to a range of values specified by
+the argument 'range', which can be 'Full', 'Automatic', or an explicit
+range 'Range(real min, real max)'. Here 'Full' specifies a range
+varying from the minimum to maximum values of the function over the
+sampling interval, while 'Automatic' selects "nice" limits. The example
+'imagecontour.asy' illustrates how level sets (contour lines) can be
+drawn on a color density plot (*note contour::).
+
+ A color density plot can also be generated from an explicit real[][]
+array 'data':
+bounds image(picture pic=currentpicture, real[][] f, range range=Full,
+ pair initial, pair final, pen[] palette,
+ bool transpose=(initial.x < final.x && initial.y < final.y),
+ bool copy=true, bool antialias=false);
+If the initial point is to the left and below the final point, by
+default the array indices are interpreted according to the Cartesian
+convention (first index: x, second index: y) rather than the usual
+matrix convention (first index: -y, second index: x).
+
+ To construct an image from an array of irregularly spaced points and
+an array of values 'f' at these points, use one of the routines
+bounds image(picture pic=currentpicture, pair[] z, real[] f,
+ range range=Full, pen[] palette)
+bounds image(picture pic=currentpicture, real[] x, real[] y, real[] f,
+ range range=Full, pen[] palette)
+
+ An optionally labelled palette bar may be generated with the routine
+void palette(picture pic=currentpicture, Label L="", bounds bounds,
+ pair initial, pair final, axis axis=Right, pen[] palette,
+ pen p=currentpen, paletteticks ticks=PaletteTicks,
+ bool copy=true, bool antialias=false);
+ The color space of 'palette' is taken to be over bounds 'bounds' with
+scaling given by the z scaling of 'pic'. The palette orientation is
+specified by 'axis', which may be one of 'Right', 'Left', 'Top', or
+'Bottom'. The bar is drawn over the rectangle from 'initial' to
+'final'. The argument 'paletteticks' is a special tick type (*note
+ticks::) that takes the following arguments:
+paletteticks PaletteTicks(Label format="", ticklabel ticklabel=null,
+ bool beginlabel=true, bool endlabel=true,
+ int N=0, int n=0, real Step=0, real step=0,
+ pen pTick=nullpen, pen ptick=nullpen);
+
+ The image and palette bar can be fit to a frame and added and
+optionally aligned to a picture at the desired location:
+
+size(12cm,12cm);
+
+import graph;
+import palette;
+
+int n=256;
+real ninv=2pi/n;
+real[][] v=new real[n][n];
+
+for(int i=0; i < n; ++i)
+ for(int j=0; j < n; ++j)
+ v[i][j]=sin(i*ninv)*cos(j*ninv);
+
+pen[] Palette=BWRainbow();
+
+picture bar;
+
+bounds range=image(v,(0,0),(1,1),Palette);
+palette(bar,"$A$",range,(0,0),(0.5cm,8cm),Right,Palette,
+ PaletteTicks("$%+#.1f$"));
+add(bar.fit(),point(E),30E);
+
+ [./image]
+
+ Here is an example that uses logarithmic scaling of the function
+values:
+
+import graph;
+import palette;
+
+size(10cm,10cm,IgnoreAspect);
+
+real f(real x, real y) {
+ return 0.9*pow10(2*sin(x/5+2*y^0.25)) + 0.1*(1+cos(10*log(y)));
+}
+
+scale(Linear,Log,Log);
+
+pen[] Palette=BWRainbow();
+
+bounds range=image(f,Automatic,(0,1),(100,100),nx=200,Palette);
+
+xaxis("$x$",BottomTop,LeftTicks,above=true);
+yaxis("$y$",LeftRight,RightTicks,above=true);
+
+palette("$f(x,y)$",range,(0,200),(100,250),Top,Palette,
+ PaletteTicks(ptick=linewidth(0.5*linewidth())));
+
+
+
+ [./logimage]
+
+ One can also draw an image directly from a two-dimensional pen array
+or a function 'pen f(int, int)':
+void image(picture pic=currentpicture, pen[][] data,
+ pair initial, pair final,
+ bool transpose=(initial.x < final.x && initial.y < final.y),
+ bool copy=true, bool antialias=false);
+void image(picture pic=currentpicture, pen f(int, int), int width, int height,
+ pair initial, pair final,
+ bool transpose=(initial.x < final.x && initial.y < final.y),
+ bool antialias=false);
+as illustrated in the following examples:
+
+size(200);
+
+import palette;
+
+int n=256;
+real ninv=2pi/n;
+pen[][] v=new pen[n][n];
+
+for(int i=0; i < n; ++i)
+ for(int j=0; j < n; ++j)
+ v[i][j]=rgb(0.5*(1+sin(i*ninv)),0.5*(1+cos(j*ninv)),0);
+
+image(v,(0,0),(1,1));
+
+
+ [./penimage]
+
+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 f(int u, int v) {
+ pair z=a+(u*dx,v*dy);
+ pair w=pws(z);
+ real phase=degrees(w,warn=false);
+ real modulus=w == 0 ? 0: fracpart(log(abs(w)));
+ return hsv(phase,1,sqrt(modulus));
+}
+
+image(f,N,N,(0,0),(300,300),antialias=true);
+
+ [./penfunctionimage]
+
+ For convenience, the module 'palette' also defines functions that may
+be used to construct a pen array from a given function and palette:
+pen[] palette(real[] f, pen[] palette);
+pen[][] palette(real[][] f, pen[] palette);
+
+
+File: asymptote.info, Node: three, Next: obj, Prev: palette, Up: Base modules
+
+8.28 'three'
+============
+
+This module fully extends the notion of guides and paths in 'Asymptote'
+to three dimensions. It introduces the new types guide3, path3, and
+surface. Guides in three dimensions are specified with the same syntax
+as in two dimensions except that triples '(x,y,z)' are used in place of
+pairs '(x,y)' for the nodes and direction specifiers. This
+generalization of John Hobby's spline algorithm is shape-invariant under
+three-dimensional rotation, scaling, and shifting, and reduces in the
+planar case to the two-dimensional algorithm used in 'Asymptote',
+'MetaPost', and 'MetaFont' [cf. J. C. Bowman, Proceedings in Applied
+Mathematics and Mechanics, 7:1, 2010021-2010022 (2007)].
+
+ For example, a unit circle in the XY plane may be filled and drawn
+like this:
+import three;
+
+size(100);
+
+path3 g=(1,0,0)..(0,1,0)..(-1,0,0)..(0,-1,0)..cycle;
+draw(g);
+draw(O--Z,red+dashed,Arrow3);
+draw(((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle));
+dot(g,red);
+
+ [./unitcircle3]
+and then distorted into a saddle:
+import three;
+
+size(100,0);
+path3 g=(1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle;
+draw(g);
+draw(((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle));
+dot(g,red);
+
+ [./saddle]
+
+ Module 'three' provides constructors for converting two-dimensional
+paths to three-dimensional ones, and vice-versa:
+path3 path3(path p, triple plane(pair)=XYplane);
+path path(path3 p, pair P(triple)=xypart);
+
+ A Bezier surface, the natural two-dimensional generalization of
+Bezier curves, is defined in 'three_surface.asy' as a structure
+containing an array of Bezier patches. Surfaces may drawn with one of
+the routines
+void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
+ material surfacepen=currentpen, pen meshpen=nullpen,
+ light light=currentlight, light meshlight=nolight, string name="",
+ render render=defaultrender);
+void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
+ material[] surfacepen, pen meshpen,
+ light light=currentlight, light meshlight=nolight, string name="",
+ render render=defaultrender);
+void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
+ material[] surfacepen, pen[] meshpen=nullpens,
+ light light=currentlight, light meshlight=nolight, string name="",
+ render render=defaultrender);
+
+ The parameters 'nu' and 'nv' specify the number of subdivisions for
+drawing optional mesh lines for each Bezier patch. The optional 'name'
+parameter is used as a prefix for naming the surface patches in the PRC
+model tree. Here material is a structure defined in 'three_light.asy':
+struct material {
+ pen[] p; // diffusepen,emissivepen,specularpen
+ real opacity;
+ real shininess;
+ real metallic;
+ real fresnel0;
+}
+These material properties are used to implement physically based
+rendering (PBR) using light properties defined in 'plain_prethree.asy'
+and 'three_light.asy':
+struct light {
+ real[][] diffuse;
+ real[][] specular;
+ pen background=nullpen; // Background color of the canvas.
+ real specularfactor;
+ triple[] position; // Only directional lights are currently implemented.
+}
+
+light Viewport=light(specularfactor=3,(0.25,-0.25,1));
+
+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[] {(-2,-1.5,-0.5),(2,1.1,-2.5),(-0.5,0,2)});
+
+light Headlamp=light(gray(0.8),specular=gray(0.7),
+ specularfactor=3,dir(42,48));
+
+currentlight=Headlamp;
+
+light nolight;
+ The 'currentlight.background' (or 'background' member of the
+specified 'light') can be used to set the background colour for 2D (or
+3D) images. The default background is white for 'HTML' images and
+transparent for all other formats. One can request a completely
+transparent background for 3D 'WebGL' images with
+'currentlight.background=black+opacity(0.0);'
+
+ Sample Bezier surfaces are contained in the example files
+'BezierSurface.asy', 'teapot.asy', and 'parametricsurface.asy'. The
+structure 'render' contains specialized rendering options documented at
+the beginning of module 'three'.
+
+ The examples 'elevation.asy' and 'sphericalharmonic.asy' illustrate
+how to draw a surface with patch-dependent colors. The examples
+'vertexshading.asy' and 'smoothelevation.asy' illustrate
+vertex-dependent colors, which are supported by 'Asymptote''s native
+'OpenGL'/'WebGL' renderers and the two-dimensional vector output format
+('settings.render=0'). Since the PRC output format does not currently
+support vertex shading of Bezier surfaces, PRC patches are shaded with
+the mean of the four vertex colors.
+
+ A surface can be constructed from a cyclic 'path3' with the
+constructor
+surface surface(path3 external, triple[] internal=new triple[],
+ pen[] colors=new pen[], bool3 planar=default);
+and then filled:
+draw(surface(unitsquare3,new triple[] {X,Y,Z,O}),red);
+draw(surface(O--X{Y}..Y{-X}--cycle,new triple[] {Z}),red);
+draw(surface(path3(polygon(5))),red,nolight);
+draw(surface(unitcircle3),red,nolight);
+draw(surface(unitcircle3,new pen[] {red,green,blue,black}),nolight);
+The first example draws a Bezier patch and the second example draws a
+Bezier triangle. The third and fourth examples are planar surfaces.
+The last example constructs a patch with vertex-specific colors. A
+three-dimensional planar surface in the plane 'plane' can be constructed
+from a two-dimensional cyclic path 'g' with the constructor
+surface surface(path p, triple plane(pair)=XYplane);
+and then filled:
+draw(surface((0,0)--E+2N--2E--E+N..0.2E..cycle),red);
+Planar Bezier surfaces patches are constructed using Orest Shardt's
+'bezulate' routine, which decomposes (possibly nonsimply connected)
+regions bounded (according to the 'zerowinding' fill rule) by simple
+cyclic paths (intersecting only at the endpoints) into subregions
+bounded by cyclic paths of length '4' or less.
+
+ A more efficient routine also exists for drawing tessellations
+composed of many 3D triangles, with specified vertices, and optional
+normals or vertex colors:
+void draw(picture pic=currentpicture, triple[] v, int[][] vi,
+ triple[] n={}, int[][] ni=vi, material m=currentpen, pen[] p={},
+ int[][] pi=vi, light light=currentlight);
+ Here, the triple array 'v' lists the (typically distinct) vertices,
+while the array 'vi' contains integer arrays of length 3 containing the
+indices of the elements in 'v' that form the vertices of each triangle.
+Similarly, the arguments 'n' and 'ni' contain optional normal data and
+'p' and 'pi' contain optional pen vertex data. If more than one normal
+or pen is specified for a vertex, the last one specified is used. An
+example of this tessellation facility is given in 'triangles.asy'.
+
+ Arbitrary thick three-dimensional curves and line caps (which the
+'OpenGL' standard does not require implementations to provide) are
+constructed with
+tube tube(path3 p, real width, render render=defaultrender);
+this returns a tube structure representing a tube of diameter 'width'
+centered approximately on 'g'. The tube structure consists of a surface
+'s' and the actual tube center, path3 'center'. Drawing thick lines as
+tubes can be slow to render, especially with the 'Adobe Reader'
+renderer. The setting 'thick=false' can be used to disable this feature
+and force all lines to be drawn with 'linewidth(0)' (one pixel wide,
+regardless of the resolution). By default, mesh and contour lines in
+three-dimensions are always drawn thin, unless an explicit line width is
+given in the pen parameter or the setting 'thin' is set to 'false'. The
+pens 'thin()' and 'thick()' defined in 'plain_pens.asy' can also be used
+to override these defaults for specific draw commands.
+
+There are five choices for viewing 3D 'Asymptote' output:
+
+ 1. Use the native 'Asymptote' adaptive 'OpenGL'-based renderer (with
+ the command-line option '-V' and the default settings
+ 'outformat=""' and 'render=-1'). On 'UNIX' systems with graphics
+ support for multisampling, the sample width can be controlled with
+ the setting 'multisample'. The ratio of physical to logical screen
+ pixels can be specified with the setting 'devicepixelratio'. An
+ initial screen position can be specified with the pair setting
+ 'position', where negative values are interpreted as relative to
+ the corresponding maximum screen dimension. The default settings
+ import settings;
+ leftbutton=new string[] {"rotate","zoom","shift","pan"};
+ middlebutton=new string[] {""};
+ rightbutton=new string[] {"zoom","rotateX","rotateY","rotateZ"};
+ wheelup=new string[] {"zoomin"};
+ wheeldown=new string[] {"zoomout"};
+ bind the mouse buttons as follows:
+ * Left: rotate
+ * Shift Left: zoom
+ * Ctrl Left: shift viewport
+ * Alt Left: pan
+ * Wheel Up: zoom in
+ * Wheel Down: zoom out
+ * Right: zoom
+ * Shift Right: rotate about the X axis
+ * Ctrl Right: rotate about the Y axis
+ * Alt Right: rotate about the Z axis
+
+ The keyboard shortcuts are:
+ * h: home
+ * f: toggle fitscreen
+ * x: spin about the X axis
+ * y: spin about the Y axis
+ * z: spin about the Z axis
+ * s: stop spinning
+ * m: rendering mode (solid/patch/mesh)
+ * e: export
+ * c: show camera parameters
+ * p: play animation
+ * r: reverse animation
+ * : step animation
+ * +: expand
+ * =: expand
+ * >: expand
+ * -: shrink
+ * _: shrink
+ * <: shrink
+ * q: exit
+ * Ctrl-q: exit
+
+ 2. Generate 'WebGL' interactive vector graphics output with the the
+ command-line option and '-f html' (or the setting
+ 'outformat="html"'). The resulting 3D HTML file can then be viewed
+ directly in any modern desktop or mobile browser, or even embedded
+ within another web page:
+ <div>
+ <object data="logo3.html"
+ style="width:210;height:140;position:relative;top:0;left:0;">
+ </object>
+ </div>
+
+ Normally, 'WebGL' files generated by 'Asymptote' are dynamically
+ remeshed to fit the browser window dimensions. However, the
+ setting 'absolute=true' can be used to force the image to be
+ rendered at its designed size (accounting for multiple device
+ pixels per 'css' pixel).
+
+ The interactive 'WebGL' files produced by 'Asymptote' use the
+ default mouse and (many of the same) key bindings as the 'OpenGL'
+ renderer. Zooming via the mouse wheel of a 'WebGL' image embedded
+ within another page is disabled until the image is activated by a
+ click or touch event and will remain enabled until the 'ESC' key is
+ pressed.
+
+ By default, viewing the 3D HTML files generated by Asymptote
+ requires network access to download the 'AsyGL' rendering library,
+ which is normally cached by the browser for future use. However,
+ the setting 'offline=true' can be used to embed this small (about
+ 48kB) library within a stand-alone HTML file that can be viewed
+ offline.
+
+ 3. Render the scene to a specified rasterized format 'outformat' at
+ the resolution of 'n' pixels per 'bp', as specified by the setting
+ 'render=n'. A negative value of 'n' is interpreted as '|2n|' for
+ EPS and PDF formats and '|n|' for other formats. The default value
+ of 'render' is -1. By default, the scene is internally rendered at
+ twice the specified resolution; this can be disabled by setting
+ 'antialias=1'. High resolution rendering is done by tiling the
+ image. If your graphics card allows it, the rendering can be made
+ more efficient by increasing the maximum tile size 'maxtile' to
+ your screen dimensions (indicated by 'maxtile=(0,0)'. If your
+ video card generates unwanted black stripes in the output, try
+ setting the horizontal and vertical components of 'maxtiles' to
+ something less than your screen dimensions. The tile size is also
+ limited by the setting 'maxviewport', which restricts the maximum
+ width and height of the viewport. On 'UNIX' systems some graphics
+ drivers support batch mode ('-noV') rendering in an iconified
+ window; this can be enabled with the setting 'iconify=true'.
+
+ 4. Embed the 3D PRC format in a PDF file and view the resulting PDF
+ file with version '9.0' or later of 'Adobe Reader'. In addition to
+ the default 'settings.prc=true', this requires
+ 'settings.outformat="pdf"', which can be specified by the command
+ line option '-f pdf', put in the 'Asymptote' configuration file
+ (*note configuration file::), or specified in the script before
+ module 'three' (or 'graph3') is imported. The 'media9' LaTeX
+ package is also required (*note embed::). The example '100d.asy'
+ illustrates how one can generate a list of predefined views (see
+ '100d.views'). A stationary preview image with a resolution of 'n'
+ pixels per 'bp' can be embedded with the setting 'render=n'; this
+ allows the file to be viewed with other 'PDF' viewers.
+ Alternatively, the file 'externalprc.tex' illustrates how the
+ resulting PRC and rendered image files can be extracted and
+ processed in a separate 'LaTeX' file. However, see *note LaTeX
+ usage:: for an easier way to embed three-dimensional 'Asymptote'
+ pictures within 'LaTeX'. For specialized applications where only
+ the raw PRC file is required, specify 'settings.outformat="prc"'.
+ The PRC specification is available from
+ <https://web.archive.org/web/20081204104459/http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/API_References/PRCReference/PRC_Format_Specification/>
+
+ 5. Project the scene to a two-dimensional vector (EPS or PDF) format
+ with 'render=0'. Only limited hidden surface removal facilities
+ are currently available with this approach (*note PostScript3D::).
+
+ Automatic picture sizing in three dimensions is accomplished with
+double deferred drawing. The maximal desired dimensions of the scene in
+each of the three dimensions can optionally be specified with the
+routine
+void size3(picture pic=currentpicture, real x, real y=x, real z=y,
+ bool keepAspect=pic.keepAspect);
+A simplex linear programming problem is then solved to produce a 3D
+version of a frame (actually implemented as a 3D picture). The result
+is then fit with another application of deferred drawing to the viewport
+dimensions corresponding to the usual two-dimensional picture 'size'
+parameters. The global pair 'viewportmargin' may be used to add
+horizontal and vertical margins to the viewport dimensions.
+Alternatively, a minimum 'viewportsize' may be specified. A 3D picture
+'pic' can be explicitly fit to a 3D frame by calling
+frame pic.fit3(projection P=currentprojection);
+and then added to picture 'dest' about 'position' with
+void add(picture dest=currentpicture, frame src, triple position=(0,0,0));
+
+ For convenience, the 'three' module defines 'O=(0,0,0)', 'X=(1,0,0)',
+'Y=(0,1,0)', and 'Z=(0,0,1)', along with a unitcircle in the XY plane:
+path3 unitcircle3=X..Y..-X..-Y..cycle;
+
+ A general (approximate) circle can be drawn perpendicular to the
+direction 'normal' with the routine
+path3 circle(triple c, real r, triple normal=Z);
+
+ A circular arc centered at 'c' with radius 'r' from
+'c+r*dir(theta1,phi1)' to 'c+r*dir(theta2,phi2)', drawing
+counterclockwise relative to the normal vector
+'cross(dir(theta1,phi1),dir(theta2,phi2))' if 'theta2 > theta1' or if
+'theta2 == theta1' and 'phi2 >= phi1', can be constructed with
+path3 arc(triple c, real r, real theta1, real phi1, real theta2, real phi2,
+ triple normal=O);
+ The normal must be explicitly specified if 'c' and the endpoints are
+colinear. If 'r' < 0, the complementary arc of radius '|r|' is
+constructed. For convenience, an arc centered at 'c' from triple 'v1'
+to 'v2' (assuming '|v2-c|=|v1-c|') in the direction CCW
+(counter-clockwise) or CW (clockwise) may also be constructed with
+path3 arc(triple c, triple v1, triple v2, triple normal=O,
+ bool direction=CCW);
+When high accuracy is needed, the routines 'Circle' and 'Arc' defined in
+'graph3' may be used instead. See *note GaussianSurface:: for an
+example of a three-dimensional circular arc.
+
+ The representation 'O--O+u--O+u+v--O+v--cycle' of the plane passing
+through point 'O' with normal 'cross(u,v)' is returned by
+path3 plane(triple u, triple v, triple O=O);
+ A three-dimensional box with opposite vertices at triples 'v1' and
+'v2' may be drawn with the function
+path3[] box(triple v1, triple v2);
+For example, a unit box is predefined as
+path3[] unitbox=box(O,(1,1,1));
+ 'Asymptote' also provides optimized definitions for the
+three-dimensional paths 'unitsquare3' and 'unitcircle3', along with the
+surfaces 'unitdisk', 'unitplane', 'unitcube', 'unitcylinder',
+'unitcone', 'unitsolidcone', 'unitfrustum(real t1, real t2)',
+'unitsphere', and 'unithemisphere'.
+
+These projections to two dimensions are predefined:
+'oblique'
+'oblique(real angle)'
+ The point '(x,y,z)' is projected to '(x-0.5z,y-0.5z)'. If an
+ optional real argument is given, the negative z axis is drawn at
+ this angle in degrees. The projection 'obliqueZ' is a synonym for
+ 'oblique'.
+
+'obliqueX'
+'obliqueX(real angle)'
+ The point '(x,y,z)' is projected to '(y-0.5x,z-0.5x)'. If an
+ optional real argument is given, the negative x axis is drawn at
+ this angle in degrees.
+
+'obliqueY'
+'obliqueY(real angle)'
+ The point '(x,y,z)' is projected to '(x+0.5y,z+0.5y)'. If an
+ optional real argument is given, the positive y axis is drawn at
+ this angle in degrees.
+
+'orthographic(triple camera, triple up=Z, triple target=O,
+ real zoom=1, pair viewportshift=0, bool showtarget=true,
+ bool center=false)'
+ This projects from three to two dimensions using the view as seen
+ at a point infinitely far away in the direction 'unit(camera)',
+ orienting the camera so that, if possible, the vector 'up' points
+ upwards. Parallel lines are projected to parallel lines. The
+ bounding volume is expanded to include 'target' if
+ 'showtarget=true'. If 'center=true', the target will be adjusted
+ to the center of the bounding volume.
+
+'orthographic(real x, real y, real z, triple up=Z, triple target=O,
+ real zoom=1, pair viewportshift=0, bool showtarget=true,
+ bool center=false)'
+ This is equivalent to
+ orthographic((x,y,z),up,target,zoom,viewportshift,showtarget,center)
+
+ The routine
+ triple camera(real alpha, real beta);
+ can be used to compute the camera position with the x axis below
+ the horizontal at angle 'alpha', the y axis below the horizontal at
+ angle 'beta', and the z axis up.
+
+'perspective(triple camera, triple up=Z, triple target=O,
+ real zoom=1, real angle=0, pair viewportshift=0,
+ bool showtarget=true, bool autoadjust=true,
+ bool center=autoadjust)'
+ This projects from three to two dimensions, taking account of
+ perspective, as seen from the location 'camera' looking at
+ 'target', orienting the camera so that, if possible, the vector
+ 'up' points upwards. If 'render=0', projection of
+ three-dimensional cubic Bezier splines is implemented by
+ approximating a two-dimensional nonuniform rational B-spline
+ (NURBS) with a two-dimensional Bezier curve containing additional
+ nodes and control points. If 'autoadjust=true', the camera will
+ automatically be adjusted to lie outside the bounding volume for
+ all possible interactive rotations about 'target'. If
+ 'center=true', the target will be adjusted to the center of the
+ bounding volume.
+
+'perspective(real x, real y, real z, triple up=Z, triple target=O,
+ real zoom=1, real angle=0, pair viewportshift=0,
+ bool showtarget=true, bool autoadjust=true,
+ bool center=autoadjust)'
+ This is equivalent to
+ perspective((x,y,z),up,target,zoom,angle,viewportshift,showtarget,
+ autoadjust,center)
+
+The default projection, 'currentprojection', is initially set to
+'perspective(5,4,2)'.
+
+ We also define standard orthographic views used in technical drawing:
+projection LeftView=orthographic(-X,showtarget=true);
+projection RightView=orthographic(X,showtarget=true);
+projection FrontView=orthographic(-Y,showtarget=true);
+projection BackView=orthographic(Y,showtarget=true);
+projection BottomView=orthographic(-Z,showtarget=true);
+projection TopView=orthographic(Z,showtarget=true);
+The function
+void addViews(picture dest=currentpicture, picture src,
+ projection[][] views=SixViewsUS,
+ bool group=true, filltype filltype=NoFill);
+adds to picture 'dest' an array of views of picture 'src' using the
+layout projection[][] 'views'. The default layout 'SixViewsUS' aligns
+the projection 'FrontView' below 'TopView' and above 'BottomView', to
+the right of 'LeftView' and left of 'RightView' and 'BackView'. The
+predefined layouts are:
+projection[][] ThreeViewsUS={{TopView},
+ {FrontView,RightView}};
+
+projection[][] SixViewsUS={{null,TopView},
+ {LeftView,FrontView,RightView,BackView},
+ {null,BottomView}};
+
+projection[][] ThreeViewsFR={{RightView,FrontView},
+ {null,TopView}};
+
+projection[][] SixViewsFR={{null,BottomView},
+ {RightView,FrontView,LeftView,BackView},
+ {null,TopView}};
+
+projection[][] ThreeViews={{FrontView,TopView,RightView}};
+
+projection[][] SixViews={{FrontView,TopView,RightView},
+ {BackView,BottomView,LeftView}};
+
+
+ A triple or path3 can be projected to a pair or path, with
+'project(triple, projection P=currentprojection)' or 'project(path3,
+projection P=currentprojection)'.
+
+ It is occasionally useful to be able to invert a projection, sending
+a pair 'z' onto the plane perpendicular to 'normal' and passing through
+'point':
+triple invert(pair z, triple normal, triple point,
+ projection P=currentprojection);
+A pair 'z' on the projection plane can be inverted to a triple with the
+routine
+triple invert(pair z, projection P=currentprojection);
+A pair direction 'dir' on the projection plane can be inverted to a
+triple direction relative to a point 'v' with the routine
+triple invert(pair dir, triple v, projection P=currentprojection).
+
+ Three-dimensional objects may be transformed with one of the
+following built-in transform3 types (the identity transformation is
+'identity4'):
+
+'shift(triple v)'
+ translates by the triple 'v';
+'xscale3(real x)'
+ scales by 'x' in the x direction;
+'yscale3(real y)'
+ scales by 'y' in the y direction;
+'zscale3(real z)'
+ scales by 'z' in the z direction;
+'scale3(real s)'
+ scales by 's' in the x, y, and z directions;
+'scale(real x, real y, real z)'
+ scales by 'x' in the x direction, by 'y' in the y direction, and by
+ 'z' in the z direction;
+'rotate(real angle, triple v)'
+ rotates by 'angle' in degrees about an axis 'v' through the origin;
+'rotate(real angle, triple u, triple v)'
+ rotates by 'angle' in degrees about the axis 'u--v';
+'reflect(triple u, triple v, triple w)'
+ reflects about the plane through 'u', 'v', and 'w'.
+
+ When not multiplied on the left by a transform3, three-dimensional
+TeX Labels are drawn as Bezier surfaces directly on the projection
+plane:
+void label(picture pic=currentpicture, Label L, triple position,
+ align align=NoAlign, pen p=currentpen,
+ light light=nolight, string name="",
+ render render=defaultrender, interaction interaction=
+ settings.autobillboard ? Billboard : Embedded)
+The optional 'name' parameter is used as a prefix for naming the label
+patches in the PRC model tree. The default interaction is 'Billboard',
+which means that labels are rotated interactively so that they always
+face the camera. The interaction 'Embedded' means that the label
+interacts as a normal '3D' surface, as illustrated in the example
+'billboard.asy'. Alternatively, a label can be transformed from the
+'XY' plane by an explicit transform3 or mapped to a specified
+two-dimensional plane with the predefined transform3 types 'XY', 'YZ',
+'ZX', 'YX', 'ZY', 'ZX'. There are also modified versions of these
+transforms that take an optional argument 'projection
+P=currentprojection' that rotate and/or flip the label so that it is
+more readable from the initial viewpoint.
+
+ A transform3 that projects in the direction 'dir' onto the plane with
+normal 'n' through point 'O' is returned by
+transform3 planeproject(triple n, triple O=O, triple dir=n);
+One can use
+triple normal(path3 p);
+to find the unit normal vector to a planar three-dimensional path 'p'.
+As illustrated in the example 'planeproject.asy', a transform3 that
+projects in the direction 'dir' onto the plane defined by a planar path
+'p' is returned by
+transform3 planeproject(path3 p, triple dir=normal(p));
+
+ The functions
+surface extrude(path p, triple axis=Z);
+surface extrude(Label L, triple axis=Z);
+return the surface obtained by extruding path 'p' or Label 'L' along
+'axis'.
+
+ Three-dimensional versions of the path functions 'length', 'size',
+'point', 'dir', 'accel', 'radius', 'precontrol', 'postcontrol',
+'arclength', 'arctime', 'reverse', 'subpath', 'intersect',
+'intersections', 'intersectionpoint', 'intersectionpoints', 'min',
+'max', 'cyclic', and 'straight' are also defined.
+
+ The routine
+real[] intersect(path3 p, surface s, real fuzz=-1);
+returns a real array of length 3 containing the intersection times, if
+any, of a path 'p' with a surface 's'. The routine
+real[][] intersections(path3 p, surface s, real fuzz=-1);
+returns all (unless there are infinitely many) intersection times of a
+path 'p' with a surface 's' as a sorted array of real arrays of length
+3, and
+triple[] intersectionpoints(path3 p, surface s, real fuzz=-1);
+returns the corresponding intersection points. Here, the computations
+are performed to the absolute error specified by 'fuzz', or if 'fuzz <
+0', to machine precision. The routine
+real orient(triple a, triple b, triple c, triple d);
+is a numerically robust computation of 'dot(cross(a-d,b-d),c-d)', which
+is the determinant
+|a.x a.y a.z 1|
+|b.x b.y b.z 1|
+|c.x c.y c.z 1|
+|d.x d.y d.z 1|
+ The result is negative (positive) if 'a', 'b', 'c' appear in
+counterclockwise (clockwise) order when viewed from 'd' or zero if all
+four points are coplanar.
+
+ The routine
+real insphere(triple a, triple b, triple c, triple d, triple e);
+returns a positive (negative) value if 'e' lies inside (outside) the
+sphere passing through points 'a,b,c,d' oriented so that
+'dot(cross(a-d,b-d),c-d)' is positive, or zero if all five points are
+cospherical. The value returned is the determinant
+|a.x a.y a.z a.x^2+a.y^2+a.z^2 1|
+|b.x b.y b.z b.x^2+b.y^2+b.z^2 1|
+|c.x c.y c.z c.x^2+c.y^2+c.z^2 1|
+|d.x d.y d.z d.x^2+d.y^2+d.z^2 1|
+|e.x e.y e.z e.x^2+e.y^2+e.z^2 1|
+
+ Here is an example showing all five guide3 connectors:
+import graph3;
+
+size(200);
+
+currentprojection=orthographic(500,-500,500);
+
+triple[] z=new triple[10];
+
+z[0]=(0,100,0); z[1]=(50,0,0); z[2]=(180,0,0);
+
+for(int n=3; n <= 9; ++n)
+ z[n]=z[n-3]+(200,0,0);
+
+path3 p=z[0]..z[1]---z[2]::{Y}z[3]
+&z[3]..z[4]--z[5]::{Y}z[6]
+&z[6]::z[7]---z[8]..{Y}z[9];
+
+draw(p,grey+linewidth(4mm),currentlight);
+
+xaxis3(Label(XY()*"$x$",align=-3Y),red,above=true);
+yaxis3(Label(XY()*"$y$",align=-3X),red,above=true);
+
+ [./join3]
+
+ Three-dimensional versions of bars or arrows can be drawn with one of
+the specifiers 'None', 'Blank', 'BeginBar3', 'EndBar3' (or equivalently
+'Bar3'), 'Bars3', 'BeginArrow3', 'MidArrow3', 'EndArrow3' (or
+equivalently 'Arrow3'), 'Arrows3', 'BeginArcArrow3', 'EndArcArrow3' (or
+equivalently 'ArcArrow3'), 'MidArcArrow3', and 'ArcArrows3'.
+Three-dimensional bars accept the optional arguments '(real size=0,
+triple dir=O)'. If 'size=O', the default bar length is used; if
+'dir=O', the bar is drawn perpendicular to the path and the initial
+viewing direction. The predefined three-dimensional arrowhead styles
+are 'DefaultHead3', 'HookHead3', 'TeXHead3'. Versions of the
+two-dimensional arrowheads lifted to three-dimensional space and aligned
+according to the initial viewpoint (or an optionally specified 'normal'
+vector) are also defined: 'DefaultHead2(triple normal=O)',
+'HookHead2(triple normal=O)', 'TeXHead2(triple normal=O)'. These are
+illustrated in the example 'arrows3.asy'.
+
+ Module 'three' also defines the three-dimensional margins
+'NoMargin3', 'BeginMargin3', 'EndMargin3', 'Margin3', 'Margins3',
+'BeginPenMargin2', 'EndPenMargin2', 'PenMargin2', 'PenMargins2',
+'BeginPenMargin3', 'EndPenMargin3', 'PenMargin3', 'PenMargins3',
+'BeginDotMargin3', 'EndDotMargin3', 'DotMargin3', 'DotMargins3',
+'Margin3', and 'TrueMargin3'.
+
+ The routine
+void pixel(picture pic=currentpicture, triple v, pen p=currentpen,
+ real width=1);
+can be used to draw on picture 'pic' a pixel of width 'width' at
+position 'v' using pen 'p'.
+
+ Further three-dimensional examples are provided in the files
+'near_earth.asy', 'conicurv.asy', and (in the 'animations' subdirectory)
+'cube.asy'.
+
+ Limited support for projected vector graphics (effectively
+three-dimensional nonrendered 'PostScript') is available with the
+setting 'render=0'. This currently only works for piecewise planar
+surfaces, such as those produced by the parametric 'surface' routines in
+the 'graph3' module. Surfaces produced by the 'solids' module will also
+be properly rendered if the parameter 'nslices' is sufficiently large.
+
+ In the module 'bsp', hidden surface removal of planar pictures is
+implemented using a binary space partition and picture clipping. A
+planar path is first converted to a structure 'face' derived from
+'picture'. A 'face' may be given to a two-dimensional drawing routine
+in place of any 'picture' argument. An array of such faces may then be
+drawn, removing hidden surfaces:
+void add(picture pic=currentpicture, face[] faces,
+ projection P=currentprojection);
+ Labels may be projected to two dimensions, using projection 'P', onto
+the plane passing through point 'O' with normal 'cross(u,v)' by
+multiplying it on the left by the transform
+transform transform(triple u, triple v, triple O=O,
+ projection P=currentprojection);
+
+ Here is an example that shows how a binary space partition may be
+used to draw a two-dimensional vector graphics projection of three
+orthogonal intersecting planes:
+size(6cm,0);
+import bsp;
+
+real u=2.5;
+real v=1;
+
+currentprojection=oblique;
+
+path3 y=plane((2u,0,0),(0,2v,0),(-u,-v,0));
+path3 l=rotate(90,Z)*rotate(90,Y)*y;
+path3 g=rotate(90,X)*rotate(90,Y)*y;
+
+face[] faces;
+filldraw(faces.push(y),project(y),yellow);
+filldraw(faces.push(l),project(l),lightgrey);
+filldraw(faces.push(g),project(g),green);
+
+add(faces);
+
+ [./planes]
+
+
+File: asymptote.info, Node: obj, Next: graph3, Prev: three, Up: Base modules
+
+8.29 'obj'
+==========
+
+This module allows one to construct surfaces from simple obj files, as
+illustrated in the example files 'galleon.asy' and 'triceratops.asy'.
+
+
+File: asymptote.info, Node: graph3, Next: grid3, Prev: obj, Up: Base modules
+
+8.30 'graph3'
+=============
+
+This module implements three-dimensional versions of the functions in
+'graph.asy'. To draw an x axis in three dimensions, use the routine
+void xaxis3(picture pic=currentpicture, Label L="", axis axis=YZZero,
+ real xmin=-infinity, real xmax=infinity, pen p=currentpen,
+ ticks3 ticks=NoTicks3, arrowbar3 arrow=None, bool above=false);
+Analogous routines 'yaxis' and 'zaxis' can be used to draw y and z axes
+in three dimensions. There is also a routine for drawing all three
+axis:
+void axes3(picture pic=currentpicture,
+ Label xlabel="", Label ylabel="", Label zlabel="",
+ bool extend=false,
+ triple min=(-infinity,-infinity,-infinity),
+ triple max=(infinity,infinity,infinity),
+ pen p=currentpen, arrowbar3 arrow=None);
+
+The predefined three-dimensional axis types are
+axis YZEquals(real y, real z, triple align=O, bool extend=false);
+axis XZEquals(real x, real z, triple align=O, bool extend=false);
+axis XYEquals(real x, real y, triple align=O, bool extend=false);
+axis YZZero(triple align=O, bool extend=false);
+axis XZZero(triple align=O, bool extend=false);
+axis XYZero(triple align=O, bool extend=false);
+axis Bounds(int type=Both, int type2=Both, triple align=O, bool extend=false);
+The optional 'align' parameter to these routines can be used to specify
+the default axis and tick label alignments. The 'Bounds' axis accepts
+two type parameters, each of which must be one of 'Min', 'Max', or
+'Both'. These parameters specify which of the four possible
+three-dimensional bounding box edges should be drawn.
+
+ The three-dimensional tick options are 'NoTicks3', 'InTicks',
+'OutTicks', and 'InOutTicks'. These specify the tick directions for the
+'Bounds' axis type; other axis types inherit the direction that would be
+used for the 'Bounds(Min,Min)' axis.
+
+ Here is an example of a helix and bounding box axes with ticks and
+axis labels, using orthographic projection:
+import graph3;
+
+size(0,200);
+size3(200,IgnoreAspect);
+
+currentprojection=orthographic(4,6,3);
+
+real x(real t) {return cos(2pi*t);}
+real y(real t) {return sin(2pi*t);}
+real z(real t) {return t;}
+
+path3 p=graph(x,y,z,0,2.7,operator ..);
+
+draw(p,Arrow3);
+
+scale(true);
+
+xaxis3(XZ()*"$x$",Bounds,red,InTicks(Label,2,2));
+yaxis3(YZ()*"$y$",Bounds,red,InTicks(beginlabel=false,Label,2,2));
+zaxis3(XZ()*"$z$",Bounds,red,InTicks);
+
+ [./helix]
+
+ The next example illustrates three-dimensional x, y, and z axes,
+without autoscaling of the axis limits:
+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));
+
+ [./axis3]
+
+ One can also place ticks along a general three-dimensional axis:
+import graph3;
+
+size(0,100);
+
+path3 g=yscale3(2)*unitcircle3;
+currentprojection=perspective(10,10,10);
+
+axis(Label("C",position=0,align=15X),g,InTicks(endlabel=false,8,end=false),
+ ticklocate(0,360,new real(real v) {
+ path3 h=O--max(abs(max(g)),abs(min(g)))*dir(90,v);
+ return intersect(g,h)[0];},
+ new triple(real t) {return cross(dir(g,t),Z);}));
+
+
+ [./generalaxis3]
+
+ Surface plots of matrices and functions over the region 'box(a,b)' in
+the XY plane are also implemented:
+surface surface(real[][] f, pair a, pair b, bool[][] cond={});
+surface surface(real[][] f, pair a, pair b, splinetype xsplinetype,
+ splinetype ysplinetype=xsplinetype, bool[][] cond={});
+surface surface(real[][] f, real[] x, real[] y,
+ splinetype xsplinetype=null, splinetype ysplinetype=xsplinetype,
+ bool[][] cond={})
+surface surface(triple[][] f, bool[][] cond={});
+surface surface(real f(pair z), pair a, pair b, int nx=nmesh, int ny=nx,
+ bool cond(pair z)=null);
+surface surface(real f(pair z), pair a, pair b, int nx=nmesh, int ny=nx,
+ splinetype xsplinetype, splinetype ysplinetype=xsplinetype,
+ bool cond(pair z)=null);
+surface surface(triple f(pair z), real[] u, real[] v,
+ splinetype[] usplinetype, splinetype[] vsplinetype=Spline,
+ bool cond(pair z)=null);
+surface surface(triple f(pair z), pair a, pair b, int nu=nmesh, int nv=nu,
+ bool cond(pair z)=null);
+surface surface(triple f(pair z), pair a, pair b, int nu=nmesh, int nv=nu,
+ splinetype[] usplinetype, splinetype[] vsplinetype=Spline,
+ bool cond(pair z)=null);
+The final two versions draw parametric surfaces for a function f(u,v)
+over the parameter space 'box(a,b)', as illustrated in the example
+'parametricsurface.asy'. An optional splinetype 'Spline' may be
+specified. The boolean array or function 'cond' can be used to control
+which surface mesh cells are actually drawn (by default all mesh cells
+over 'box(a,b)' are drawn). Surface lighting is illustrated in the
+example files 'parametricsurface.asy' and 'sinc.asy'. Lighting can be
+disabled by setting 'light=nolight', as in this example of a Gaussian
+surface:
+import graph3;
+
+size(200,0);
+
+currentprojection=perspective(10,8,4);
+
+real f(pair z) {return 0.5+exp(-abs(z)^2);}
+
+draw((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle);
+
+draw(arc(0.12Z,0.2,90,60,90,25),ArcArrow3);
+
+surface s=surface(f,(-1,-1),(1,1),nx=5,Spline);
+
+xaxis3(Label("$x$"),red,Arrow3);
+yaxis3(Label("$y$"),red,Arrow3);
+zaxis3(XYZero(extend=true),red,Arrow3);
+
+draw(s,lightgray,meshpen=black+thick(),nolight,render(merge=true));
+
+label("$O$",O,-Z+Y,red);
+
+ [./GaussianSurface]
+A mesh can be drawn without surface filling by specifying 'nullpen' for
+the surfacepen.
+
+ A vector field of 'nu'\times'nv' arrows on a parametric surface 'f'
+over 'box(a,b)' can be drawn with the routine
+picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b,
+ int nu=nmesh, int nv=nu, bool truesize=false,
+ real maxlength=truesize ? 0 : maxlength(f,a,b,nu,nv),
+ bool cond(pair z)=null, pen p=currentpen,
+ arrowbar3 arrow=Arrow3, margin3 margin=PenMargin3)
+ as illustrated in the examples 'vectorfield3.asy' and
+'vectorfieldsphere.asy'.
+
+
+File: asymptote.info, Node: grid3, Next: solids, Prev: graph3, Up: Base modules
+
+8.31 'grid3'
+============
+
+This module, contributed by Philippe Ivaldi, can be used for drawing 3D
+grids. Here is an example (further examples can be found in 'grid3.asy'
+and at <http://www.piprime.fr/files/asymptote/grid3/>):
+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));
+
+
+ [./grid3xyz]
+
+
+File: asymptote.info, Node: solids, Next: tube, Prev: grid3, Up: Base modules
+
+8.32 'solids'
+=============
+
+This solid geometry module defines a structure 'revolution' that can be
+used to fill and draw surfaces of revolution. The following example
+uses it to display the outline of a circular cylinder of radius 1 with
+axis 'O--1.5unit(Y+Z)' with perspective projection:
+import solids;
+
+size(0,100);
+
+revolution r=cylinder(O,1,1.5,Y+Z);
+draw(r,heavygreen);
+
+ [./cylinderskeleton]
+
+ Further illustrations are provided in the example files
+'cylinder.asy', 'cones.asy', 'hyperboloid.asy', and 'torus.asy'.
+
+ The structure 'skeleton' contains the three-dimensional wireframe
+used to visualize a volume of revolution:
+struct skeleton {
+ struct curve {
+ path3[] front;
+ path3[] back;
+ }
+ // transverse skeleton (perpendicular to axis of revolution)
+ curve transverse;
+ // longitudinal skeleton (parallel to axis of revolution)
+ curve longitudinal;
+}
+
+
+File: asymptote.info, Node: tube, Next: flowchart, Prev: solids, Up: Base modules
+
+8.33 'tube'
+===========
+
+This module extends the 'tube' surfaces constructed in
+'three_arrows.asy' to arbitrary cross sections, colors, and spine
+transformations. The routine
+surface tube(path3 g, coloredpath section,
+ transform T(real)=new transform(real t) {return identity();},
+ real corner=1, real relstep=0);
+draws a tube along 'g' with cross section 'section', after applying the
+transformation 'T(t)' at 'point(g,t)'. The parameter 'corner' controls
+the number of elementary tubes at the angular points of 'g'. A nonzero
+value of 'relstep' specifies a fixed relative time step (in the sense of
+'relpoint(g,t)') to use in constructing elementary tubes along 'g'. The
+type 'coloredpath' is a generalization of 'path' to which a 'path' can
+be cast:
+struct coloredpath
+{
+ path p;
+ pen[] pens(real);
+ int colortype=coloredSegments;
+}
+Here 'p' defines the cross section and the method 'pens(real t)' returns
+an array of pens (interpreted as a cyclic array) used for shading the
+tube patches at 'relpoint(g,t)'. If 'colortype=coloredSegments', the
+tube patches are filled as if each segment of the section was colored
+with the pen returned by 'pens(t)', whereas if 'colortype=coloredNodes',
+the tube components are vertex shaded as if the nodes of the section
+were colored.
+
+ A 'coloredpath' can be constructed with one of the routines:
+coloredpath coloredpath(path p, pen[] pens(real),
+ int colortype=coloredSegments);
+coloredpath coloredpath(path p, pen[] pens=new pen[] {currentpen},
+ int colortype=coloredSegments);
+coloredpath coloredpath(path p, pen pen(real));
+In the second case, the pens are independent of the relative time. In
+the third case, the array of pens contains only one pen, which depends
+of the relative time.
+
+ The casting of 'path' to 'coloredpath' allows the use of a 'path'
+instead of a 'coloredpath'; in this case the shading behaviour is the
+default shading behavior for a surface.
+
+ An example of 'tube' is provided in the file 'trefoilknot.asy'.
+Further examples can be found at
+<http://www.piprime.fr/files/asymptote/tube/>.
+
+
+File: asymptote.info, Node: flowchart, Next: contour, Prev: tube, Up: Base modules
+
+8.34 'flowchart'
+================
+
+This module provides routines for drawing flowcharts. The primary
+structure is a 'block', which represents a single block on the
+flowchart. The following eight functions return a position on the
+appropriate edge of the block, given picture transform 't':
+
+pair block.top(transform t=identity());
+pair block.left(transform t=identity());
+pair block.right(transform t=identity());
+pair block.bottom(transform t=identity());
+pair block.topleft(transform t=identity());
+pair block.topright(transform t=identity());
+pair block.bottomleft(transform t=identity());
+pair block.bottomright(transform t=identity());
+
+To obtain an arbitrary position along the boundary of the block in user
+coordinates, use:
+pair block.position(real x, transform t=identity());
+
+The center of the block in user coordinates is stored in 'block.center'
+and the block size in 'PostScript' coordinates is given by 'block.size'.
+
+A frame containing the block is returned by
+frame block.draw(pen p=currentpen);
+
+ The following block generation routines accept a Label, string, or
+frame for their object argument:
+
+"rectangular block with an optional header (and padding 'dx' around header and body):"
+ block rectangle(object header, object body, pair center=(0,0),
+ pen headerpen=mediumgray, pen bodypen=invisible,
+ pen drawpen=currentpen,
+ real dx=3, real minheaderwidth=minblockwidth,
+ real minheaderheight=minblockwidth,
+ real minbodywidth=minblockheight,
+ real minbodyheight=minblockheight);
+ block rectangle(object body, pair center=(0,0),
+ pen fillpen=invisible, pen drawpen=currentpen,
+ real dx=3, real minwidth=minblockwidth,
+ real minheight=minblockheight);
+
+"parallelogram block:"
+ block parallelogram(object body, pair center=(0,0),
+ pen fillpen=invisible, pen drawpen=currentpen,
+ real dx=3, real slope=2,
+ real minwidth=minblockwidth,
+ real minheight=minblockheight);
+
+"diamond-shaped block:"
+ block diamond(object body, pair center=(0,0),
+ pen fillpen=invisible, pen drawpen=currentpen,
+ real ds=5, real dw=1,
+ real height=20, real minwidth=minblockwidth,
+ real minheight=minblockheight);
+
+"circular block:"
+ block circle(object body, pair center=(0,0), pen fillpen=invisible,
+ pen drawpen=currentpen, real dr=3,
+ real mindiameter=mincirclediameter);
+
+"rectangular block with rounded corners:"
+ block roundrectangle(object body, pair center=(0,0),
+ pen fillpen=invisible, pen drawpen=currentpen,
+ real ds=5, real dw=0, real minwidth=minblockwidth,
+ real minheight=minblockheight);
+
+"rectangular block with beveled edges:"
+ block bevel(object body, pair center=(0,0), pen fillpen=invisible,
+ pen drawpen=currentpen, real dh=5, real dw=5,
+ real minwidth=minblockwidth, real minheight=minblockheight);
+
+ To draw paths joining the pairs in 'point' with right-angled lines,
+use the routine:
+path path(pair point[] ... flowdir dir[]);
+The entries in 'dir' identify whether successive segments between the
+pairs specified by 'point' should be drawn in the 'Horizontal' or
+'Vertical' direction.
+
+ Here is a simple flowchart example (see also the example
+'controlsystem.asy'):
+
+size(0,300);
+
+import flowchart;
+
+block block1=rectangle(Label("Example",magenta),
+ pack(Label("Start:",heavygreen),"",Label("$A:=0$",blue),
+ "$B:=1$"),(-0.5,3),palegreen,paleblue,red);
+block block2=diamond(Label("Choice?",blue),(0,2),palegreen,red);
+block block3=roundrectangle("Do something",(-1,1));
+block block4=bevel("Don't do something",(1,1));
+block block5=circle("End",(0,0));
+
+draw(block1);
+draw(block2);
+draw(block3);
+draw(block4);
+draw(block5);
+
+add(new void(picture pic, transform t) {
+ blockconnector operator --=blockconnector(pic,t);
+ // draw(pic,block1.right(t)--block2.top(t));
+ block1--Right--Down--Arrow--block2;
+ block2--Label("Yes",0.5,NW)--Left--Down--Arrow--block3;
+ block2--Right--Label("No",0.5,NE)--Down--Arrow--block4;
+ block4--Down--Left--Arrow--block5;
+ block3--Down--Right--Arrow--block5;
+ });
+
+ [./flowchartdemo]
+
+
+File: asymptote.info, Node: contour, Next: contour3, Prev: flowchart, Up: Base modules
+
+8.35 'contour'
+==============
+
+This module draws contour lines. To construct contours corresponding to
+the values in a real array 'c' for a function 'f' on 'box(a,b)', use the
+routine
+guide[][] contour(real f(real, real), pair a, pair b,
+ real[] c, int nx=ngraph, int ny=nx,
+ interpolate join=operator --, int subsample=1);
+The integers 'nx' and 'ny' define the resolution. The default
+resolution, 'ngraph x ngraph' (here 'ngraph' defaults to '100') can be
+increased for greater accuracy. The default interpolation operator is
+'operator --' (linear). Spline interpolation ('operator ..') may
+produce smoother contours but it can also lead to overshooting. The
+'subsample' parameter indicates the number of interior points that
+should be used to sample contours within each '1 x 1' box; the default
+value of '1' is usually sufficient.
+
+ To construct contours for an array of data values on a uniform
+two-dimensional lattice on 'box(a,b)', use
+guide[][] contour(real[][] f, pair a, pair b, real[] c,
+ interpolate join=operator --, int subsample=1);
+
+ To construct contours for an array of data values on a nonoverlapping
+regular mesh specified by the two-dimensional array 'z',
+guide[][] contour(pair[][] z, real[][] f, real[] c,
+ interpolate join=operator --, int subsample=1);
+
+To construct contours for an array of values 'f' specified at
+irregularly positioned points 'z', use the routine
+guide[][] contour(pair[] z, real[] f, real[] c, interpolate join=operator --);
+The contours themselves can be drawn with one of the routines
+void draw(picture pic=currentpicture, Label[] L=new Label[],
+ guide[][] g, pen p=currentpen);
+
+void draw(picture pic=currentpicture, Label[] L=new Label[],
+ guide[][] g, pen[] p);
+
+ The following simple example draws the contour at value '1' for the
+function z=x^2+y^2, which is a unit circle:
+import contour;
+size(75);
+
+real f(real a, real b) {return a^2+b^2;}
+draw(contour(f,(-1,-1),(1,1),new real[] {1}));
+
+ [./onecontour]
+
+ The next example draws and labels multiple contours for the function
+z=x^2-y^2 with the resolution '100 x 100', using a dashed pen for
+negative contours and a solid pen for positive (and zero) contours:
+import contour;
+
+size(200);
+
+real f(real x, real y) {return x^2-y^2;}
+int n=10;
+real[] c=new real[n];
+for(int i=0; i < n; ++i) c[i]=(i-n/2)/n;
+
+pen[] p=sequence(new pen(int i) {
+ return (c[i] >= 0 ? solid : dashed)+fontsize(6pt);
+ },c.length);
+
+Label[] Labels=sequence(new Label(int i) {
+ return Label(c[i] != 0 ? (string) c[i] : "",Relative(unitrand()),(0,0),
+ UnFill(1bp));
+ },c.length);
+
+draw(Labels,contour(f,(-1,-1),(1,1),c),p);
+
+ [./multicontour]
+
+ The next example illustrates how contour lines can be drawn on color
+density images:
+import graph;
+import palette;
+import contour;
+
+size(10cm,10cm,IgnoreAspect);
+
+pair a=(0,0);
+pair b=(2pi,2pi);
+
+real f(real x, real y) {return cos(x)*sin(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();
+
+bounds range=image(f,Automatic,a,b,N,Palette);
+
+// Major contours
+
+real[] Cvals=uniform(range.min,range.max,Divs);
+draw(contour(f,a,b,Cvals,N,operator --),Tickpen);
+
+// Minor contours
+real[] cvals;
+for(int i=0; i < Cvals.length-1; ++i)
+ cvals.append(uniform(Cvals[i],Cvals[i+1],divs)[1:divs]);
+draw(contour(f,a,b,cvals,N,operator --),tickpen);
+
+xaxis("$x$",BottomTop,LeftTicks,above=true);
+yaxis("$y$",LeftRight,RightTicks,above=true);
+
+palette("$f(x,y)$",range,point(NW)+(0,0.5),point(NE)+(0,1),Top,Palette,
+ PaletteTicks(N=Divs,n=divs,Tickpen,tickpen));
+
+ [./imagecontour]
+
+ Finally, here is an example that illustrates the construction of
+contours from irregularly spaced data:
+import contour;
+
+size(200);
+
+int n=100;
+
+real f(real a, real b) {return a^2+b^2;}
+
+srand(1);
+
+real r() {return 1.1*(rand()/randMax*2-1);}
+
+pair[] points=new pair[n];
+real[] values=new real[n];
+
+for(int i=0; i < n; ++i) {
+ points[i]=(r(),r());
+ values[i]=f(points[i].x,points[i].y);
+}
+
+draw(contour(points,values,new real[]{0.25,0.5,1},operator ..),blue);
+
+ [./irregularcontour]
+
+ In the above example, the contours of irregularly spaced data are
+constructed by first creating a triangular mesh from an array 'z' of
+pairs:
+
+int[][] triangulate(pair[] z);
+
+size(200);
+int np=100;
+pair[] points;
+
+real r() {return 1.2*(rand()/randMax*2-1);}
+
+for(int i=0; i < np; ++i)
+ points.push((r(),r()));
+
+int[][] trn=triangulate(points);
+
+for(int i=0; i < trn.length; ++i) {
+ draw(points[trn[i][0]]--points[trn[i][1]]);
+ draw(points[trn[i][1]]--points[trn[i][2]]);
+ draw(points[trn[i][2]]--points[trn[i][0]]);
+}
+
+for(int i=0; i < np; ++i)
+ dot(points[i],red);
+
+ [./triangulate]
+
+ The example 'Gouraudcontour.asy' illustrates how to produce color
+density images over such irregular triangular meshes. 'Asymptote' uses
+a robust version of Paul Bourke's Delaunay triangulation algorithm based
+on the public-domain exact arithmetic predicates written by Jonathan
+Shewchuk.
+
+
+File: asymptote.info, Node: contour3, Next: smoothcontour3, Prev: contour, Up: Base modules
+
+8.36 'contour3'
+===============
+
+This module draws surfaces described as the null space of real-valued
+functions of (x,y,z) or 'real[][][]' matrices. Its usage is illustrated
+in the example file 'magnetic.asy'.
+
+
+File: asymptote.info, Node: smoothcontour3, Next: slopefield, Prev: contour3, Up: Base modules
+
+8.37 'smoothcontour3'
+=====================
+
+This module, written by Charles Staats, draws implicitly defined
+surfaces with smooth appearance. The purpose of this module is similar
+to that of 'contour3': given a real-valued function f(x,y,z), construct
+the surface described by the equation f(x,y,z) = 0. The
+'smoothcontour3' module generally produces nicer results than
+'contour3', but takes longer to compile. Additionally, the algorithm
+assumes that the function and the surface are both smooth; if they are
+not, then 'contour3' may be a better choice.
+
+ To construct the null surface of a function 'f(triple)' or
+'ff(real,real,real)' over 'box(a,b)', use the routine
+surface implicitsurface(real f(triple)=null,
+ real ff(real,real,real)=null,
+ triple a,
+ triple b,
+ int n=nmesh,
+ bool keyword overlapedges=false,
+ int keyword nx=n,
+ int keyword ny=n,
+ int keyword nz=n,
+ int keyword maxdepth=8,
+ bool usetriangles=true);
+The optional parameter 'overlapedges' attempts to compensate for an
+artifact that can cause the renderer to "see through" the boundary
+between patches. Although it defaults to 'false', it should usually be
+set to 'true'. The example 'genustwo.asy' illustrates the use of this
+function. Additional examples, together with a more in-depth
+explanation of the module's usage and pitfalls, are available at
+<https://github.com/charlesstaats/smoothcontour3>.
+
+
+File: asymptote.info, Node: slopefield, Next: ode, Prev: smoothcontour3, Up: Base modules
+
+8.38 'slopefield'
+=================
+
+To draw a slope field for the differential equation dy/dx=f(x,y) (or
+dy/dx=f(x)), use:
+picture slopefield(real f(real,real), pair a, pair b,
+ int nx=nmesh, int ny=nx,
+ real tickfactor=0.5, pen p=currentpen,
+ arrowbar arrow=None);
+Here, the points 'a' and 'b' are the lower left and upper right corners
+of the rectangle in which the slope field is to be drawn, 'nx' and 'ny'
+are the respective number of ticks in the x and y directions,
+'tickfactor' is the fraction of the minimum cell dimension to use for
+drawing ticks, and 'p' is the pen to use for drawing the slope fields.
+The return value is a picture that can be added to 'currentpicture' via
+the 'add(picture)' command.
+
+ The function
+path curve(pair c, real f(real,real), pair a, pair b);
+takes a point ('c') and a slope field-defining function 'f' and returns,
+as a path, the curve passing through that point. The points 'a' and 'b'
+represent the rectangular boundaries over which the curve is
+interpolated.
+
+ Both 'slopefield' and 'curve' alternatively accept a function 'real
+f(real)' that depends on x only, as seen in this example:
+
+import slopefield;
+
+size(200);
+
+real func(real x) {return 2x;}
+add(slopefield(func,(-3,-3),(3,3),20,Arrow));
+draw(curve((0,0),func,(-3,-3),(3,3)),red);
+
+
+
+ [./slopefield1]
+
+
+File: asymptote.info, Node: ode, Prev: slopefield, Up: Base modules
+
+8.39 'ode'
+==========
+
+The 'ode' module, illustrated in the example 'odetest.asy', implements a
+number of explicit numerical integration schemes for ordinary
+differential equations.
+
+
+File: asymptote.info, Node: Options, Next: Interactive mode, Prev: Base modules, Up: Top
+
+9 Command-line options
+**********************
+
+Type 'asy -h' to see the full list of command-line options supported by
+'Asymptote':
+Usage: ../asy [options] [file ...]
+
+Options (negate by replacing - with -no):
+
+-V,-View View output; command-line only
+-absolute Use absolute WebGL dimensions [false]
+-a,-align C|B|T|Z Center, Bottom, Top, or Zero page alignment [C]
+-aligndir pair Directional page alignment (overrides align) [(0,0)]
+-antialias n Antialiasing width for rasterized output [2]
+-auto3D Automatically activate 3D scene [true]
+-autobillboard 3D labels always face viewer by default [true]
+-autoimport string Module to automatically import
+-autoplain Enable automatic importing of plain [true]
+-autoplay Autoplay 3D animations [false]
+-autorotate Enable automatic PDF page rotation [false]
+-axes3 Show 3D axes in PDF output [true]
+-batchMask Mask fpu exceptions in batch mode [false]
+-batchView View output in batch mode [false]
+-bw Convert all colors to black and white [false]
+-cd directory Set current directory; command-line only
+-cmyk Convert rgb colors to cmyk [false]
+-c,-command string Command to autoexecute
+-compact Conserve memory at the expense of speed [false]
+-compress Compress images in PDF output [true]
+-d,-debug Enable debugging messages [false]
+-devicepixelratio n Ratio of physical to logical pixels [1]
+-digits n Default output file precision [7]
+-divisor n Garbage collect using purge(divisor=n) [2]
+-embed Embed rendered preview image [true]
+-envmap Enable environment map image-based lighting (Experimental) [false]
+-exitonEOF Exit interactive mode on EOF [true]
+-fitscreen Fit rendered image to screen [true]
+-framedelay ms Additional frame delay [0]
+-framerate frames/s Animation speed [30]
+-globalread Allow read from other directory [true]
+-globalwrite Allow write to other directory [false]
+-gray Convert all colors to grayscale [false]
+-h,-help Show summary of options; command-line only
+-historylines n Retain n lines of history [1000]
+-iconify Iconify rendering window [false]
+-inlineimage Generate inline embedded image [false]
+-inlinetex Generate inline TeX code [false]
+-interactiveMask Mask fpu exceptions in interactive mode [true]
+-interactiveView View output in interactive mode [true]
+-interactiveWrite Write expressions entered at the prompt to stdout [true]
+-k,-keep Keep intermediate files [false]
+-keepaux Keep intermediate LaTeX .aux files [false]
+-level n Postscript level [3]
+-l,-listvariables List available global functions and variables [false]
+-localhistory Use a local interactive history file [false]
+-loop Loop 3D animations [false]
+-m,-mask Mask fpu exceptions; command-line only
+-maxtile pair Maximum rendering tile size [(1024,768)]
+-maxviewport pair Maximum viewport size [(0,0)]
+-multiline Input code over multiple lines at the prompt [false]
+-multipleView View output from multiple batch-mode files [false]
+-multisample n Multisampling width for screen images [4]
+-offline Produce offline html files [false]
+-O,-offset pair PostScript offset [(0,0)]
+-f,-outformat format Convert each output file to specified format
+-o,-outname name Alternative output directory/filename
+-p,-parseonly Parse file [false]
+-pdfreload Automatically reload document in pdfviewer [false]
+-pdfreloaddelay usec Delay before attempting initial pdf reload [750000]
+-position pair Initial 3D rendering screen position [(0,0)]
+-prc Embed 3D PRC graphics in PDF output [true]
+-prompt string Prompt [> ]
+-prompt2 string Continuation prompt for multiline input [..]
+-q,-quiet Suppress welcome text and noninteractive stdout [false]
+-render n Render 3D graphics using n pixels per bp (-1=auto) [-1]
+-resizestep step Resize step [1.2]
+-reverse reverse 3D animations [false]
+-rgb Convert cmyk colors to rgb [false]
+-safe Disable system call [true]
+-scroll n Scroll standard output n lines at a time [0]
+-shiftHoldDistance n WebGL touch screen distance limit for shift mode [20]
+-shiftWaitTime ms WebGL touch screen shift mode delay [200]
+-spinstep deg/s Spin speed [60]
+-svgemulation Emulate unimplemented SVG shading [true]
+-tabcompletion Interactive prompt auto-completion [true]
+-tex engine latex|pdflatex|xelatex|lualatex|tex|pdftex|luatex|context|none [latex]
+-thick Render thick 3D lines [true]
+-thin Render thin 3D lines [true]
+-threads Use POSIX threads for 3D rendering [true]
+-toolbar Show 3D toolbar in PDF output [true]
+-s,-translate Show translated virtual machine code [false]
+-twice Run LaTeX twice (to resolve references) [false]
+-twosided Use two-sided 3D lighting model for rendering [true]
+-u,-user string General purpose user string
+-v,-verbose Increase verbosity level (can specify multiple times) [0]
+-version Show version; command-line only
+-vibrateTime ms WebGL shift mode vibrate duration [25]
+-viewportmargin pair Horizontal and vertical 3D viewport margin [(0.5,0.5)]
+-wait Wait for child processes to finish before exiting [false]
+-warn string Enable warning; command-line only
+-where Show where listed variables are declared [false]
+-xasy Special interactive mode for xasy [false]
+-zoomPinchCap limit WebGL maximum zoom pinch [100]
+-zoomPinchFactor n WebGL zoom pinch sensitivity [10]
+-zoomfactor factor Zoom step factor [1.05]
+-zoomstep step Mouse motion zoom step [0.1]
+
+
+ All boolean options can be negated by prepending 'no' to the option
+name.
+
+ If no arguments are given, 'Asymptote' runs in interactive mode
+(*note Interactive mode::). In this case, the default output file is
+'out.eps'.
+
+ If '-' is given as the file argument, 'Asymptote' reads from standard
+input.
+
+ If multiple files are specified, they are treated as separate
+'Asymptote' runs.
+
+ If the string 'autoimport' is nonempty, a module with this name is
+automatically imported for each run as the final step in loading module
+'plain'.
+
+ Default option values may be entered as 'Asymptote' code in a
+configuration file named 'config.asy' (or the file specified by the
+environment variable 'ASYMPTOTE_CONFIG' or '-config' option).
+'Asymptote' will look for this file in its usual search path (*note
+Search paths::). Typically the configuration file is placed in the
+'.asy' directory in the user's home directory ('%USERPROFILE%\.asy'
+under 'MSDOS'). Configuration variables are accessed using the long
+form of the option names:
+import settings;
+outformat="pdf";
+batchView=false;
+interactiveView=true;
+batchMask=false;
+interactiveMask=true;
+ Command-line options override these defaults. Most configuration
+variables may also be changed at runtime. The advanced configuration
+variables 'dvipsOptions', 'hyperrefOptions', 'convertOptions',
+'gsOptions', 'htmlviewerOptions', 'psviewerOptions', 'pdfviewerOptions',
+'pdfreloadOptions', 'glOptions', and 'dvisvgmOptions' allow specialized
+options to be passed as a string to the respective applications or
+libraries. The default value of 'hyperrefOptions' is
+'setpagesize=false,unicode,pdfborder=0 0 0'.
+
+ If you insert
+import plain;
+settings.autoplain=true;
+at the beginning of the configuration file, it can contain arbitrary
+'Asymptote' code.
+
+ The default output format is EPS for the (default) 'latex' and 'tex'
+tex engine and PDF for the 'pdflatex', 'xelatex', 'context', 'luatex',
+and 'lualatex' tex engines. Alternative output formats may be produced
+using the '-f' option (or 'outformat' setting).
+
+ To produce SVG output, you will need 'dvisvgm' (version 2.6.3 or
+later) from <https://dvisvgm.de>. You might need to adjust the
+configuration variable 'libgs' to point to the location of your
+'Ghostscript' library 'libgs.so' (or to an empty string, depending on
+how 'dvisvgm' was configured). The 2.9.1 version of 'dvisvgm' can
+display SVG output (used by the 'xasy' editor) for embedded EPS, PDF,
+PNG, and JPEG images included with the 'graphic()' function.
+
+ 'Asymptote' can also produce any output format supported by the
+'ImageMagick' 'convert' program (version 6.3.5 or later recommended; an
+'Invalid Parameter' error message indicates that the 'MSDOS' utility
+'convert' is being used instead of the one that comes with
+'ImageMagick'). The optional setting '-render n' requests an output
+resolution of 'n' pixels per 'bp'. Antialiasing is controlled by the
+parameter 'antialias', which by default specifies a sampling width of 2
+pixels. To give other options to 'convert', use the 'convertOptions'
+setting or call convert manually. This example emulates how 'Asymptote'
+produces antialiased 'tiff' output at one pixel per 'bp':
+asy -o - venn | convert -alpha Off -density 144x144 -geometry 50%x eps:- venn.tiff
+
+ If the option '-nosafe' is given, 'Asymptote' runs in unsafe mode.
+This enables the 'int system(string s)' and 'int system(string[] s)'
+calls, allowing one to execute arbitrary shell commands. The default
+mode, '-safe', disables this call.
+
+ A 'PostScript' offset may be specified as a pair (in 'bp' units) with
+the '-O' option:
+asy -O 0,0 file
+The default offset is zero. The pair 'aligndir' specifies an optional
+direction on the boundary of the page (mapped to the rectangle
+[-1,1]\times[-1,1]) to which the picture should be aligned; the default
+value '(0,0)' species center alignment.
+
+ The '-c' ('command') option may be used to execute arbitrary
+'Asymptote' code on the command line as a string. It is not necessary
+to terminate the string with a semicolon. Multiple '-c' options are
+executed in the order they are given. For example
+asy -c 2+2 -c "sin(1)" -c "size(100); draw(unitsquare)"
+produces the output
+4
+0.841470984807897
+and draws a unitsquare of size '100'.
+
+ The '-u' ('user') option may be used to specify arbitrary 'Asymptote'
+settings on the command line as a string. It is not necessary to
+terminate the string with a semicolon. Multiple '-u' options are
+executed in the order they are given. Command-line code like '-u
+x=sqrt(2)' can be executed within a module like this:
+real x;
+usersetting();
+write(x);
+
+ When the '-l' ('listvariables') option is used with file arguments,
+only global functions and variables defined in the specified file(s) are
+listed.
+
+ Additional debugging output is produced with each additional '-v'
+option:
+'-v'
+ Display top-level module and final output file names.
+'-vv'
+ Also display imported and included module names and final 'LaTeX'
+ and 'dvips' processing information.
+'-vvv'
+ Also output 'LaTeX' bidirectional pipe diagnostics.
+'-vvvv'
+ Also output knot guide solver diagnostics.
+'-vvvvv'
+ Also output 'Asymptote' traceback diagnostics.
+
+
+File: asymptote.info, Node: Interactive mode, Next: GUI, Prev: Options, Up: Top
+
+10 Interactive mode
+*******************
+
+Interactive mode is entered by executing the command 'asy' with no file
+arguments. When the '-multiline' option is disabled (the default), each
+line must be a complete 'Asymptote' statement (unless explicitly
+continued by a final backslash character '\'); it is not necessary to
+terminate input lines with a semicolon. If one assigns
+'settings.multiline=true', interactive code can be entered over multiple
+lines; in this mode, the automatic termination of interactive input
+lines by a semicolon is inhibited. Multiline mode is useful for cutting
+and pasting 'Asymptote' code directly into the interactive input buffer.
+
+ Interactive mode can be conveniently used as a calculator:
+expressions entered at the interactive prompt (for which a corresponding
+'write' function exists) are automatically evaluated and written to
+'stdout'. If the expression is non-writable, its type signature will be
+printed out instead. In either case, the expression can be referred to
+using the symbol '%' in the next line input at the prompt. For example:
+> 2+3
+5
+> %*4
+20
+> 1/%
+0.05
+> sin(%)
+0.0499791692706783
+> currentpicture
+<picture currentpicture>
+> %.size(200,0)
+>
+
+ The '%' symbol, when used as a variable, is shorthand for the
+identifier 'operator answer', which is set by the prompt after each
+written expression evaluation.
+
+ The following special commands are supported only in interactive mode
+and must be entered immediately after the prompt:
+
+'help'
+ view the manual;
+'erase'
+ erase 'currentpicture';
+'reset'
+ reset the 'Asymptote' environment to its initial state, except for
+ changes to the settings module (*note settings::), the current
+ directory (*note cd::), and breakpoints (*note Debugger::);
+'input FILE'
+ does an interactive reset, followed by the command 'include FILE'.
+ If the file name 'FILE' contains nonalphanumeric characters,
+ enclose it with quotation marks. A trailing semi-colon followed by
+ optional 'Asymptote' commands may be entered on the same line.
+'quit'
+ exit interactive mode ('exit' is a synonym; the abbreviation 'q' is
+ also accepted unless there exists a top-level variable named 'q').
+ A history of the most recent 1000 (this number can be changed with
+ the 'historylines' configuration variable) previous commands will
+ be retained in the file '.asy/history' in the user's home directory
+ (unless the command-line option '-localhistory' was specified, in
+ which case the history will be stored in the file '.asy_history' in
+ the current directory).
+
+ Typing 'ctrl-C' interrupts the execution of 'Asymptote' code and
+returns control to the interactive prompt.
+
+ Interactive mode is implemented with the GNU 'readline' library, with
+command history and auto-completion. To customize the key bindings,
+see: <https://tiswww.case.edu/php/chet/readline/readline.html>
+
+ The file 'asymptote.py' in the 'Asymptote' system directory provides
+an alternative way of entering 'Asymptote' commands interactively,
+coupled with the full power of 'Python'. Copy this file to your 'Python
+path' and then execute from within 'Python 3' the commands
+from asymptote import *
+g=asy()
+g.size(200)
+g.draw("unitcircle")
+g.send("draw(unitsquare)")
+g.fill("unitsquare, blue")
+g.clip("unitcircle")
+g.label("\"$O$\", (0,0), SW")
+
+
+File: asymptote.info, Node: GUI, Next: PostScript to Asymptote, Prev: Interactive mode, Up: Top
+
+11 Graphical User Interface
+***************************
+
+* Menu:
+
+* GUI installation:: Installing 'xasy'
+* GUI usage:: Using 'xasy' to edit objects
+
+In the event that adjustments to the final figure are required, the
+preliminary Graphical User Interface (GUI) 'xasy' included with
+'Asymptote' allows you to move graphical objects and draw new ones. The
+modified figure can then be saved as a normal 'Asymptote' file.
+
+
+File: asymptote.info, Node: GUI installation, Next: GUI usage, Prev: GUI, Up: GUI
+
+11.1 GUI installation
+=====================
+
+As 'xasy' is written in the interactive scripting language 'Python/Qt',
+it requires 'Python' (<https://www.python.org>), along with the 'Python'
+packages 'pyqt5', 'cson', and 'numpy':
+
+pip3 install cson numpy pyqt5 PyQt5.sip
+
+ Pictures are deconstructed into the SVG image format. Since 'Qt5'
+does not support 'SVG' clipping, you will need the 'rsvg-convert'
+utility, which is part of the 'librsvg2-tools' package on 'UNIX' systems
+and the 'librsvg' package on 'MacOS X'; under 'Microsoft Windows', it is
+available as
+
+ <https://sourceforge.net/projects/tumagcc/files/rsvg-convert-2.40.20.7z>
+
+
+File: asymptote.info, Node: GUI usage, Prev: GUI installation, Up: GUI
+
+11.2 GUI usage
+==============
+
+The arrow keys (or mouse wheel) are convenient for temporarily raising
+and lowering objects within 'xasy', allowing an object to be selected.
+Pressing the arrow keys will pan while the shift key is held and zoom
+while the control key is held. The mouse wheel will pan while the alt
+or shift keys is held and zoom while the control key is held. In
+translate mode, an object can be dragged coarsely with the mouse or
+positioned finely with the arrow keys while holding down the mouse
+button.
+
+ Deconstruction of compound objects (such as arrows) can be prevented
+by enclosing them within the commands
+void begingroup(picture pic=currentpicture);
+void endgroup(picture pic=currentpicture);
+ By default, the elements of a picture or frame will be grouped
+together on adding them to a picture. However, the elements of a frame
+added to another frame are not grouped together by default: their
+elements will be individually deconstructed (*note add::).
+
+
+File: asymptote.info, Node: PostScript to Asymptote, Next: Help, Prev: GUI, Up: Top
+
+12 'PostScript' to 'Asymptote'
+******************************
+
+The excellent 'PostScript' editor 'pstoedit' (version 3.50 or later;
+available from <https://sourceforge.net/projects/pstoedit/>) includes an
+'Asymptote' backend. Unlike virtually all other 'pstoedit' backends,
+this driver includes native clipping, even-odd fill rule, 'PostScript'
+subpath, and full image support. Here is an example: 'asy -V
+/usr/local/share/doc/asymptote/examples/venn.asy'
+pstoedit -f asy venn.eps test.asy
+asy -V test
+
+If the line widths aren't quite correct, try giving 'pstoedit' the
+'-dis' option. If the fonts aren't typeset correctly, try giving
+'pstoedit' the '-dt' option.
+
+
+File: asymptote.info, Node: Help, Next: Debugger, Prev: PostScript to Asymptote, Up: Top
+
+13 Help
+*******
+
+A list of frequently asked questions (FAQ) is maintained at
+ <https://asymptote.sourceforge.io/FAQ>
+Questions on installing and using 'Asymptote' that are not addressed in
+the FAQ should be sent to the 'Asymptote' forum:
+ <https://sourceforge.net/p/asymptote/discussion/409349>
+Including an example that illustrates what you are trying to do will
+help you get useful feedback. 'LaTeX' problems can often be diagnosed
+with the '-vv' or '-vvv' command-line options. Contributions in the
+form of patches or 'Asymptote' modules can be posted here:
+ <https://sourceforge.net/p/asymptote/patches>
+To receive announcements of upcoming releases, please subscribe to
+'Asymptote' at
+ <https://sourceforge.net/projects/asymptote/>
+If you find a bug in 'Asymptote', please check (if possible) whether the
+bug is still present in the latest 'git' developmental code (*note
+Git::) before submitting a bug report. New bugs can be reported at
+ <https://github.com/vectorgraphics/asymptote/issues>
+To see if the bug has already been fixed, check bugs with Status
+'Closed' and recent lines in
+ <https://asymptote.sourceforge.io/ChangeLog>
+
+ 'Asymptote' can be configured with the optional GNU library
+'libsigsegv', available from <https://www.gnu.org/software/libsigsegv/>,
+which allows one to distinguish user-generated 'Asymptote' stack
+overflows (*note stack overflow::) from true segmentation faults (due to
+internal C++ programming errors; please submit the 'Asymptote' code that
+generates such segmentation faults along with your bug report).
+
+
+File: asymptote.info, Node: Debugger, Next: Credits, Prev: Help, Up: Top
+
+14 Debugger
+***********
+
+Asymptote now includes a line-based (as opposed to code-based) debugger
+that can assist the user in following flow control. To set a break
+point in file 'file' at line 'line', use the command
+
+void stop(string file, int line, code s=quote{});
+The optional argument 's' may be used to conditionally set the variable
+'ignore' in 'plain_debugger.asy' to 'true'. For example, the first 10
+instances of this breakpoint will be ignored (the variable 'int count=0'
+is defined in 'plain_debugger.asy'):
+stop("test",2,quote{ignore=(++count <= 10);});
+
+ To set a break point in file 'file' at the first line containing the
+string 'text', use
+
+void stop(string file, string text, code s=quote{});
+To list all breakpoints, use:
+void breakpoints();
+To clear a breakpoint, use:
+void clear(string file, int line);
+To clear all breakpoints, use:
+void clear();
+
+ The following commands may be entered at the debugging prompt:
+
+'h'
+ help;
+'c'
+ continue execution;
+
+'i'
+ step to the next instruction;
+
+'s'
+ step to the next executable line;
+
+'n'
+ step to the next executable line in the current file;
+
+'f'
+ step to the next file;
+
+'r'
+ return to the file associated with the most recent breakpoint;
+
+'t'
+ toggle tracing ('-vvvvv') mode;
+
+'q'
+ quit debugging and end execution;
+
+'x'
+ exit the debugger and run to completion.
+
+Arbitrary 'Asymptote' code may also be entered at the debugging prompt;
+however, since the debugger is implemented with 'eval', currently only
+top-level (global) variables can be displayed or modified.
+
+ The debugging prompt may be entered manually with the call
+void breakpoint(code s=quote{});
+
+
+File: asymptote.info, Node: Credits, Next: Index, Prev: Debugger, Up: Top
+
+15 Acknowledgments
+******************
+
+Financial support for the development of 'Asymptote' was generously
+provided by the Natural Sciences and Engineering Research Council of
+Canada, the Pacific Institute for Mathematical Sciences, and the
+University of Alberta Faculty of Science.
+
+ We also would like to acknowledge the previous work of John D. Hobby,
+author of the program 'MetaPost' that inspired the development of
+'Asymptote', and Donald E. Knuth, author of TeX and 'MetaFont' (on which
+'MetaPost' is based).
+
+ The authors of 'Asymptote' are Andy Hammerlindl, John Bowman, and Tom
+Prince. Sean Healy designed the 'Asymptote' logo. Other contributors
+include Orest Shardt, Jesse Frohlich, Michail Vidiassov, Charles Staats,
+Philippe Ivaldi, Olivier Guibe', Radoslav Marinov, Jeff Samuelson, Chris
+Savage, Jacques Pienaar, Mark Henning, Steve Melenchuk, Martin Wiebusch,
+Stefan Knorr, and Supakorn "Jamie" Rassameemasmuang. Pedram Emami
+developed the 'Asymptote Web Application' at
+<http://asymptote.ualberta.ca>.
+
+
+File: asymptote.info, Node: Index, Prev: Credits, Up: Top
+
+Index
+*****
+
+
+* Menu:
+
+* !: Arithmetic & logical.
+ (line 57)
+* !=: Structures. (line 62)
+* != <1>: Arithmetic & logical.
+ (line 37)
+* #: Arithmetic & logical.
+ (line 20)
+* %: Arithmetic & logical.
+ (line 25)
+* % <1>: Interactive mode. (line 16)
+* %=: Self & prefix operators.
+ (line 6)
+* &: Bezier curves. (line 84)
+* & <1>: Arithmetic & logical.
+ (line 49)
+* &&: Arithmetic & logical.
+ (line 47)
+* *: Pens. (line 15)
+* * <1>: Arithmetic & logical.
+ (line 16)
+* **: Arithmetic & logical.
+ (line 31)
+* *=: Self & prefix operators.
+ (line 6)
+* +: Pens. (line 15)
+* + <1>: Arithmetic & logical.
+ (line 13)
+* ++: Self & prefix operators.
+ (line 6)
+* +=: Self & prefix operators.
+ (line 6)
+* -: Arithmetic & logical.
+ (line 14)
+* --: Paths. (line 16)
+* -- <1>: Self & prefix operators.
+ (line 6)
+* ---: Bezier curves. (line 84)
+* -=: Self & prefix operators.
+ (line 6)
+* -c: Options. (line 195)
+* -l: Options. (line 214)
+* -u: Options. (line 205)
+* -V: Configuring. (line 6)
+* -V <1>: Drawing in batch mode.
+ (line 16)
+* ..: Paths. (line 16)
+* .asy: Search paths. (line 12)
+* /: Arithmetic & logical.
+ (line 18)
+* /=: Self & prefix operators.
+ (line 6)
+* 2D graphs: graph. (line 6)
+* 3D graphs: graph3. (line 6)
+* 3D grids: grid3. (line 6)
+* 3D PostScript: three. (line 639)
+* :: Arithmetic & logical.
+ (line 61)
+* ::: Bezier curves. (line 70)
+* <: Arithmetic & logical.
+ (line 39)
+* <=: Arithmetic & logical.
+ (line 41)
+* ==: Structures. (line 62)
+* == <1>: Arithmetic & logical.
+ (line 36)
+* >: Arithmetic & logical.
+ (line 45)
+* >=: Arithmetic & logical.
+ (line 43)
+* ?: Arithmetic & logical.
+ (line 61)
+* ^: Arithmetic & logical.
+ (line 29)
+* ^ <1>: Arithmetic & logical.
+ (line 55)
+* ^=: Self & prefix operators.
+ (line 6)
+* ^^: Paths. (line 23)
+* |: Arithmetic & logical.
+ (line 53)
+* ||: Arithmetic & logical.
+ (line 51)
+* a4: Configuring. (line 68)
+* abort: Data types. (line 364)
+* abs: Data types. (line 65)
+* abs <1>: Data types. (line 144)
+* abs <2>: Mathematical functions.
+ (line 35)
+* abs2: Data types. (line 65)
+* abs2 <1>: Data types. (line 144)
+* absolute: Configuring. (line 43)
+* accel: Paths and guides. (line 126)
+* accel <1>: Paths and guides. (line 132)
+* accel <2>: three. (line 540)
+* access: Import. (line 6)
+* access <1>: Import. (line 45)
+* acknowledgments: Credits. (line 6)
+* acos: Mathematical functions.
+ (line 6)
+* aCos: Mathematical functions.
+ (line 20)
+* acosh: Mathematical functions.
+ (line 6)
+* add: Frames and pictures.
+ (line 217)
+* add <1>: Frames and pictures.
+ (line 231)
+* add <2>: three. (line 312)
+* addViews: three. (line 433)
+* adjust: Pens. (line 123)
+* Ai: Mathematical functions.
+ (line 48)
+* Airy: Mathematical functions.
+ (line 48)
+* Ai_deriv: Mathematical functions.
+ (line 48)
+* alias: Structures. (line 62)
+* alias <1>: Arrays. (line 179)
+* Align: label. (line 12)
+* aligndir: Options. (line 187)
+* all: Arrays. (line 338)
+* Allow: Pens. (line 363)
+* and: Bezier curves. (line 56)
+* AND: Arithmetic & logical.
+ (line 68)
+* angle: Data types. (line 73)
+* animate: Configuring. (line 20)
+* animate <1>: Files. (line 159)
+* animate <2>: animation. (line 12)
+* animation: animation. (line 6)
+* animation <1>: animation. (line 6)
+* annotate: annotate. (line 6)
+* antialias: three. (line 254)
+* antialias <1>: Options. (line 157)
+* append: Files. (line 38)
+* append <1>: Arrays. (line 39)
+* arc: Paths and guides. (line 24)
+* Arc: Paths and guides. (line 37)
+* arc <1>: three. (line 323)
+* ArcArrow: draw. (line 26)
+* ArcArrow3: three. (line 606)
+* ArcArrows: draw. (line 26)
+* ArcArrows3: three. (line 606)
+* arclength: Paths and guides. (line 153)
+* arclength <1>: three. (line 540)
+* arcpoint: Paths and guides. (line 163)
+* arctime: Paths and guides. (line 157)
+* arctime <1>: three. (line 540)
+* arguments: Default arguments. (line 6)
+* arithmetic operators: Arithmetic & logical.
+ (line 6)
+* array: Data types. (line 284)
+* array <1>: Arrays. (line 112)
+* array iteration: Programming. (line 52)
+* arrays: Arrays. (line 6)
+* arrow: Drawing commands. (line 34)
+* Arrow: draw. (line 26)
+* arrow <1>: label. (line 70)
+* arrow keys: Drawing in interactive mode.
+ (line 11)
+* arrow keys <1>: GUI usage. (line 6)
+* Arrow3: three. (line 606)
+* arrows: draw. (line 26)
+* Arrows: draw. (line 26)
+* Arrows3: three. (line 606)
+* as: Import. (line 67)
+* ascii: Data types. (line 309)
+* ascii <1>: Data types. (line 309)
+* asin: Mathematical functions.
+ (line 6)
+* aSin: Mathematical functions.
+ (line 20)
+* asinh: Mathematical functions.
+ (line 6)
+* Aspect: Frames and pictures.
+ (line 59)
+* assert: Data types. (line 369)
+* assignment: Programming. (line 26)
+* asy: Data types. (line 359)
+* asy <1>: Import. (line 106)
+* asy-mode: Editing modes. (line 6)
+* asy.vim: Editing modes. (line 32)
+* asygl: Configuring. (line 74)
+* asyinclude: LaTeX usage. (line 45)
+* Asymptote Web Application: Description. (line 6)
+* asymptote.sty: LaTeX usage. (line 6)
+* asymptote.xml: Editing modes. (line 48)
+* ASYMPTOTE_CONFIG: Options. (line 128)
+* atan: Mathematical functions.
+ (line 6)
+* aTan: Mathematical functions.
+ (line 20)
+* atan2: Mathematical functions.
+ (line 6)
+* atanh: Mathematical functions.
+ (line 6)
+* atleast: Bezier curves. (line 56)
+* attach: Frames and pictures.
+ (line 276)
+* attach <1>: LaTeX usage. (line 50)
+* attach <2>: graph. (line 406)
+* autoadjust: three. (line 398)
+* autoimport: Options. (line 124)
+* automatic scaling: graph. (line 690)
+* automatic scaling <1>: graph. (line 690)
+* axialshade: fill. (line 43)
+* axis: graph. (line 905)
+* axis <1>: graph. (line 988)
+* axis <2>: graph3. (line 66)
+* axis <3>: graph3. (line 82)
+* azimuth: Data types. (line 154)
+* babel: babel. (line 6)
+* background: three. (line 76)
+* background <1>: three. (line 97)
+* background color: Frames and pictures.
+ (line 180)
+* BackView: three. (line 426)
+* Bar: draw. (line 19)
+* Bar3: three. (line 606)
+* Bars: draw. (line 19)
+* Bars3: three. (line 606)
+* barsize: draw. (line 19)
+* base modules: Base modules. (line 6)
+* basealign: Pens. (line 181)
+* baseline: label. (line 90)
+* batch mode: Drawing in batch mode.
+ (line 6)
+* beep: Data types. (line 382)
+* BeginArcArrow: draw. (line 26)
+* BeginArcArrow3: three. (line 606)
+* BeginArrow: draw. (line 26)
+* BeginArrow3: three. (line 606)
+* BeginBar: draw. (line 19)
+* BeginBar3: three. (line 606)
+* BeginDotMargin: draw. (line 42)
+* BeginDotMargin3: three. (line 622)
+* BeginMargin: draw. (line 42)
+* BeginMargin3: three. (line 622)
+* BeginPenMargin: draw. (line 42)
+* BeginPenMargin2: three. (line 622)
+* BeginPenMargin3: three. (line 622)
+* BeginPoint: label. (line 55)
+* Bessel: Mathematical functions.
+ (line 48)
+* bevel: flowchart. (line 72)
+* beveljoin: Pens. (line 149)
+* Bezier curves: Bezier curves. (line 6)
+* Bezier patch: three. (line 118)
+* Bezier triangle: three. (line 118)
+* bezulate: three. (line 136)
+* Bi: Mathematical functions.
+ (line 48)
+* Billboard: three. (line 510)
+* binary: Files. (line 80)
+* binary format: Files. (line 80)
+* binary operators: Arithmetic & logical.
+ (line 6)
+* binarytree: binarytree. (line 6)
+* Bi_deriv: Mathematical functions.
+ (line 48)
+* black stripes: three. (line 254)
+* Blank: draw. (line 26)
+* block.bottom: flowchart. (line 19)
+* block.bottomleft: flowchart. (line 19)
+* block.bottomright: flowchart. (line 19)
+* block.center: flowchart. (line 24)
+* block.draw: flowchart. (line 29)
+* block.left: flowchart. (line 19)
+* block.position: flowchart. (line 23)
+* block.right: flowchart. (line 19)
+* block.top: flowchart. (line 19)
+* block.topleft: flowchart. (line 19)
+* block.topright: flowchart. (line 19)
+* bool: Data types. (line 14)
+* bool3: Data types. (line 25)
+* boolean operators: Arithmetic & logical.
+ (line 6)
+* Bottom: graph. (line 132)
+* BottomTop: graph. (line 138)
+* BottomView: three. (line 426)
+* bounding box: Frames and pictures.
+ (line 180)
+* Bounds: graph3. (line 21)
+* box: Frames and pictures.
+ (line 25)
+* box <1>: Frames and pictures.
+ (line 130)
+* box <2>: three. (line 345)
+* box <3>: three. (line 347)
+* bp: Drawing in batch mode.
+ (line 23)
+* brace: Paths and guides. (line 51)
+* break: Programming. (line 48)
+* breakpoints: Debugger. (line 21)
+* brick: Pens. (line 285)
+* broken axis: graph. (line 801)
+* bug reports: Help. (line 19)
+* buildcycle: Paths and guides. (line 270)
+* Button-1: GUI. (line 6)
+* Button-2: GUI. (line 6)
+* BWRainbow: palette. (line 15)
+* BWRainbow2: palette. (line 18)
+* C string: Data types. (line 217)
+* CAD: CAD. (line 6)
+* calculateTransform: Frames and pictures.
+ (line 118)
+* camera: three. (line 392)
+* casts: Casts. (line 6)
+* cbrt: Mathematical functions.
+ (line 6)
+* cd: Files. (line 26)
+* ceil: Mathematical functions.
+ (line 26)
+* Center: label. (line 60)
+* center: three. (line 375)
+* checker: Pens. (line 285)
+* Chinese: Pens. (line 244)
+* choose: Mathematical functions.
+ (line 39)
+* Ci: Mathematical functions.
+ (line 48)
+* circle: Paths and guides. (line 10)
+* Circle: Paths and guides. (line 18)
+* circle <1>: three. (line 319)
+* circle <2>: flowchart. (line 61)
+* circlebarframe: markers. (line 18)
+* CJK: Pens. (line 244)
+* clamped: graph. (line 36)
+* clang: Compiling from UNIX source.
+ (line 48)
+* clear: Files. (line 97)
+* clear <1>: Debugger. (line 23)
+* clip: clip. (line 6)
+* CLZ: Arithmetic & logical.
+ (line 68)
+* cm: Figure size. (line 18)
+* cmd: Configuring. (line 35)
+* cmyk: Pens. (line 38)
+* colatitude: Data types. (line 159)
+* color: Pens. (line 23)
+* coloredNodes: tube. (line 25)
+* coloredpath: tube. (line 18)
+* coloredSegments: tube. (line 25)
+* colorless: Pens. (line 57)
+* colors: Pens. (line 54)
+* comma: Files. (line 65)
+* comma-separated-value mode: Arrays. (line 370)
+* command-line options: Configuring. (line 91)
+* command-line options <1>: Options. (line 6)
+* comment character: Files. (line 16)
+* compass directions: Labels. (line 18)
+* Compiling from UNIX source: Compiling from UNIX source.
+ (line 6)
+* complement: Arrays. (line 145)
+* concat: Arrays. (line 175)
+* conditional: Programming. (line 26)
+* conditional <1>: Arithmetic & logical.
+ (line 61)
+* config: Configuring. (line 74)
+* config <1>: Options. (line 128)
+* configuration file: Configuring. (line 20)
+* configuration file <1>: Options. (line 128)
+* configuring: Configuring. (line 6)
+* conj: Data types. (line 62)
+* constructors: Structures. (line 91)
+* context: Options. (line 157)
+* continue: Programming. (line 48)
+* continue <1>: Debugger. (line 31)
+* contour: contour. (line 6)
+* contour3: contour3. (line 6)
+* controls: Bezier curves. (line 45)
+* controls <1>: three. (line 6)
+* controlSpecifier: Paths and guides. (line 396)
+* convert: Configuring. (line 74)
+* convert <1>: Files. (line 159)
+* convert <2>: animation. (line 6)
+* convert <3>: Options. (line 157)
+* convertOptions: Options. (line 143)
+* Coons shading: fill. (line 78)
+* copy: Arrays. (line 172)
+* cos: Mathematical functions.
+ (line 6)
+* Cos: Mathematical functions.
+ (line 20)
+* cosh: Mathematical functions.
+ (line 6)
+* cputime: Structures. (line 169)
+* crop: graph. (line 639)
+* cropping graphs: graph. (line 639)
+* cross: Data types. (line 106)
+* cross <1>: Data types. (line 197)
+* cross <2>: graph. (line 480)
+* crossframe: markers. (line 22)
+* crosshatch: Pens. (line 302)
+* csv: Arrays. (line 370)
+* CTZ: Arithmetic & logical.
+ (line 68)
+* cubicroots: Arrays. (line 327)
+* curl: Bezier curves. (line 66)
+* curl <1>: three. (line 6)
+* curlSpecifier: Paths and guides. (line 408)
+* currentlight: three. (line 76)
+* currentpen: Pens. (line 6)
+* currentprojection: three. (line 423)
+* curve: slopefield. (line 20)
+* custom axis types: graph. (line 141)
+* custom mark routine: graph. (line 577)
+* custom tick locations: graph. (line 233)
+* cut: Paths and guides. (line 251)
+* cycle: Figure size. (line 29)
+* cycle <1>: Paths. (line 16)
+* cycle <2>: three. (line 6)
+* cyclic: Paths and guides. (line 85)
+* cyclic <1>: Paths and guides. (line 376)
+* cyclic <2>: Arrays. (line 39)
+* cyclic <3>: three. (line 540)
+* Cyrillic: Pens. (line 237)
+* dashdotted: Pens. (line 102)
+* dashed: Pens. (line 102)
+* data types: Data types. (line 6)
+* date: Data types. (line 321)
+* Debian: UNIX binary distributions.
+ (line 19)
+* debugger: Debugger. (line 6)
+* declaration: Programming. (line 26)
+* deconstruct: GUI usage. (line 6)
+* default arguments: Default arguments. (line 6)
+* defaultformat: graph. (line 175)
+* DefaultHead: draw. (line 26)
+* DefaultHead3: three. (line 606)
+* defaultpen: Pens. (line 49)
+* defaultpen <1>: Pens. (line 122)
+* defaultpen <2>: Pens. (line 127)
+* defaultpen <3>: Pens. (line 139)
+* defaultpen <4>: Pens. (line 192)
+* defaultpen <5>: Pens. (line 363)
+* defaultpen <6>: Pens. (line 387)
+* defaultrender: three. (line 46)
+* deferred drawing: simplex. (line 6)
+* degrees: Data types. (line 78)
+* degrees <1>: Mathematical functions.
+ (line 17)
+* Degrees: Mathematical functions.
+ (line 17)
+* delete: Files. (line 154)
+* delete <1>: Arrays. (line 39)
+* description: Description. (line 6)
+* devicepixelratio: three. (line 174)
+* diagonal: Arrays. (line 312)
+* diamond: flowchart. (line 54)
+* diffuse: three. (line 76)
+* diffusepen: three. (line 66)
+* dimension: Arrays. (line 375)
+* dir: Search paths. (line 9)
+* dir <1>: Data types. (line 90)
+* dir <2>: Data types. (line 181)
+* dir <3>: Paths and guides. (line 109)
+* dir <4>: three. (line 540)
+* direction specifier: Bezier curves. (line 6)
+* directory: Files. (line 26)
+* dirSpecifier: Paths and guides. (line 390)
+* dirtime: Paths and guides. (line 166)
+* display: Configuring. (line 20)
+* do: Programming. (line 48)
+* DOSendl: Files. (line 65)
+* DOSnewl: Files. (line 65)
+* dot: draw. (line 83)
+* dot <1>: Data types. (line 103)
+* dot <2>: Data types. (line 194)
+* dot <3>: Arrays. (line 267)
+* dot <4>: Arrays. (line 270)
+* DotMargin: draw. (line 42)
+* DotMargin3: three. (line 622)
+* DotMargins: draw. (line 42)
+* DotMargins3: three. (line 622)
+* dotted: Pens. (line 102)
+* double deferred drawing: three. (line 297)
+* double precision: Files. (line 80)
+* draw: Drawing commands. (line 34)
+* draw <1>: draw. (line 6)
+* Draw: draw. (line 26)
+* draw <2>: draw. (line 113)
+* Draw <1>: Frames and pictures.
+ (line 160)
+* draw <3>: three. (line 144)
+* drawing commands: Drawing commands. (line 6)
+* drawline: math. (line 9)
+* drawtree: drawtree. (line 6)
+* dvips: Configuring. (line 74)
+* dvipsOptions: Options. (line 143)
+* dvisvgm: Configuring. (line 74)
+* dvisvgm <1>: Options. (line 162)
+* dvisvgmOptions: Options. (line 143)
+* E: Labels. (line 18)
+* E <1>: Mathematical functions.
+ (line 48)
+* Editing modes: Editing modes. (line 6)
+* Ei: Mathematical functions.
+ (line 48)
+* ellipse: Paths and guides. (line 45)
+* ellipse <1>: Frames and pictures.
+ (line 25)
+* elliptic functions: Mathematical functions.
+ (line 48)
+* else: Programming. (line 26)
+* emacs: Editing modes. (line 6)
+* embed: embed. (line 6)
+* Embedded: three. (line 510)
+* emissivepen: three. (line 66)
+* empty: Frames and pictures.
+ (line 7)
+* EndArcArrow: draw. (line 26)
+* EndArcArrow3: three. (line 606)
+* EndArrow: draw. (line 26)
+* EndArrow3: three. (line 606)
+* EndBar: draw. (line 19)
+* EndBar3: three. (line 606)
+* EndDotMargin: draw. (line 42)
+* EndDotMargin3: three. (line 622)
+* endl: Files. (line 65)
+* EndMargin: draw. (line 42)
+* EndMargin3: three. (line 622)
+* EndPenMargin: draw. (line 42)
+* EndPenMargin2: three. (line 622)
+* EndPenMargin3: three. (line 622)
+* EndPoint: label. (line 55)
+* envelope: Frames and pictures.
+ (line 25)
+* environment variables: Configuring. (line 95)
+* eof: Files. (line 97)
+* eof <1>: Arrays. (line 352)
+* eol: Files. (line 97)
+* eol <1>: Arrays. (line 352)
+* EPS: label. (line 78)
+* EPS <1>: Options. (line 157)
+* erase: Drawing in interactive mode.
+ (line 11)
+* erase <1>: Data types. (line 257)
+* erase <2>: Frames and pictures.
+ (line 7)
+* erase <3>: Frames and pictures.
+ (line 284)
+* erf: Mathematical functions.
+ (line 6)
+* erfc: Mathematical functions.
+ (line 6)
+* error: Files. (line 16)
+* error <1>: Files. (line 97)
+* error bars: graph. (line 531)
+* errorbars: graph. (line 480)
+* eval: Import. (line 102)
+* eval <1>: Import. (line 112)
+* evenodd: Paths. (line 37)
+* evenodd <1>: Pens. (line 164)
+* exit: Data types. (line 373)
+* exit <1>: Interactive mode. (line 54)
+* exit <2>: Debugger. (line 56)
+* exp: Mathematical functions.
+ (line 6)
+* expi: Data types. (line 86)
+* expi <1>: Data types. (line 177)
+* explicit: Casts. (line 6)
+* explicit casts: Casts. (line 21)
+* expm1: Mathematical functions.
+ (line 6)
+* exponential integral: Mathematical functions.
+ (line 48)
+* extendcap: Pens. (line 139)
+* extension: Paths and guides. (line 246)
+* extension <1>: MetaPost. (line 10)
+* external: embed. (line 11)
+* extrude: three. (line 534)
+* F: Mathematical functions.
+ (line 48)
+* fabs: Mathematical functions.
+ (line 6)
+* face: three. (line 646)
+* factorial: Mathematical functions.
+ (line 39)
+* Fedora: UNIX binary distributions.
+ (line 15)
+* feynman: feynman. (line 6)
+* fft: Arrays. (line 245)
+* fft <1>: Arrays. (line 259)
+* fft <2>: Arrays. (line 263)
+* FFTW: Compiling from UNIX source.
+ (line 62)
+* file: Files. (line 6)
+* file <1>: Debugger. (line 44)
+* Fill: draw. (line 26)
+* fill: draw. (line 118)
+* fill <1>: fill. (line 6)
+* fill <2>: fill. (line 17)
+* Fill <1>: Frames and pictures.
+ (line 146)
+* FillDraw: draw. (line 26)
+* filldraw: fill. (line 11)
+* FillDraw <1>: Frames and pictures.
+ (line 136)
+* filloutside: fill. (line 27)
+* fillrule: Pens. (line 164)
+* find: Data types. (line 242)
+* find <1>: Arrays. (line 154)
+* findall: Arrays. (line 159)
+* firstcut: Paths and guides. (line 262)
+* fit: Frames and pictures.
+ (line 113)
+* fit3: three. (line 310)
+* fixedscaling: Frames and pictures.
+ (line 81)
+* floor: Mathematical functions.
+ (line 26)
+* flowchart: flowchart. (line 6)
+* flush: Files. (line 65)
+* flush <1>: Files. (line 97)
+* fmod: Mathematical functions.
+ (line 6)
+* font: Pens. (line 206)
+* font <1>: Pens. (line 206)
+* font <2>: Pens. (line 235)
+* font encoding: Pens. (line 235)
+* fontcommand: Pens. (line 219)
+* fontsize: Pens. (line 192)
+* for: Programming. (line 26)
+* format: Data types. (line 290)
+* format <1>: Options. (line 157)
+* forum: Help. (line 6)
+* frame: Frames and pictures.
+ (line 7)
+* freshnel0: three. (line 66)
+* from: Import. (line 16)
+* FrontView: three. (line 426)
+* function declarations: Functions. (line 79)
+* Function shading: fill. (line 100)
+* function shading: fill. (line 100)
+* functions: Functions. (line 6)
+* functions <1>: Mathematical functions.
+ (line 6)
+* functionshade: fill. (line 100)
+* gamma: Mathematical functions.
+ (line 6)
+* Gaussrand: Mathematical functions.
+ (line 39)
+* geometry: geometry. (line 6)
+* getc: Files. (line 32)
+* getpair: Files. (line 122)
+* getreal: Files. (line 122)
+* getstring: Files. (line 122)
+* gettriple: Files. (line 122)
+* git: Git. (line 6)
+* globalwrite: Files. (line 40)
+* globalwrite <1>: Files. (line 154)
+* glOptions: three. (line 254)
+* glOptions <1>: Options. (line 143)
+* GNU Scientific Library: Mathematical functions.
+ (line 48)
+* gouraudshade: fill. (line 63)
+* Gradient: palette. (line 25)
+* gradient shading: fill. (line 32)
+* graph: graph. (line 6)
+* graph3: graph3. (line 6)
+* graphic: label. (line 78)
+* graphic <1>: Options. (line 162)
+* graphical user interface: GUI. (line 6)
+* gray: Pens. (line 25)
+* grayscale: Pens. (line 25)
+* Grayscale: palette. (line 9)
+* grid: Pens. (line 285)
+* grid <1>: graph. (line 746)
+* grid3: grid3. (line 6)
+* gs: Configuring. (line 20)
+* GSL: Compiling from UNIX source.
+ (line 62)
+* gsl: Mathematical functions.
+ (line 48)
+* gsOptions: Options. (line 143)
+* GUI: GUI. (line 6)
+* GUI installation: GUI installation. (line 6)
+* GUI usage: GUI usage. (line 6)
+* guide: Paths and guides. (line 314)
+* guide3: three. (line 6)
+* hatch: Pens. (line 302)
+* Headlamp: three. (line 76)
+* height: LaTeX usage. (line 50)
+* help: Interactive mode. (line 42)
+* help <1>: Help. (line 6)
+* help <2>: Debugger. (line 30)
+* Hermite: graph. (line 36)
+* Hermite(splinetype splinetype: graph. (line 36)
+* hex: Data types. (line 306)
+* hex <1>: Pens. (line 64)
+* hexadecimal: Data types. (line 306)
+* hexadecimal <1>: Pens. (line 62)
+* hidden surface removal: three. (line 646)
+* histogram: Mathematical functions.
+ (line 39)
+* history: Files. (line 147)
+* history <1>: Interactive mode. (line 54)
+* historylines: Interactive mode. (line 57)
+* HookHead: draw. (line 26)
+* HookHead3: three. (line 606)
+* Horizontal: flowchart. (line 77)
+* HTML5: three. (line 223)
+* htmlviewer: Configuring. (line 20)
+* htmlviewer <1>: Configuring. (line 43)
+* htmlviewerOptions: Options. (line 143)
+* hyperrefOptions: Options. (line 143)
+* hypot: Mathematical functions.
+ (line 6)
+* I: Mathematical functions.
+ (line 48)
+* iconify: three. (line 254)
+* identity: Transforms. (line 24)
+* identity <1>: Mathematical functions.
+ (line 6)
+* identity <2>: Arrays. (line 309)
+* identity4: three. (line 478)
+* if: Programming. (line 26)
+* IgnoreAspect: Frames and pictures.
+ (line 63)
+* image: palette. (line 33)
+* image <1>: palette. (line 58)
+* ImageMagick: Configuring. (line 74)
+* ImageMagick <1>: animation. (line 6)
+* ImageMagick <2>: Options. (line 157)
+* images: palette. (line 6)
+* implicit casts: Casts. (line 6)
+* implicit linear solver: MetaPost. (line 10)
+* implicit scaling: Implicit scaling. (line 6)
+* implicitsurface: smoothcontour3. (line 16)
+* import: Import. (line 45)
+* inches: Figure size. (line 18)
+* incircle: Data types. (line 120)
+* include: Import. (line 134)
+* including images: label. (line 78)
+* increasing: math. (line 55)
+* inf: Data types. (line 35)
+* inheritance: Structures. (line 182)
+* initialized: Arrays. (line 39)
+* initializers: Variable initializers.
+ (line 6)
+* inline: LaTeX usage. (line 50)
+* InOutTicks: graph3. (line 35)
+* input: Files. (line 10)
+* input <1>: Files. (line 12)
+* input <2>: Interactive mode. (line 45)
+* input <3>: Interactive mode. (line 49)
+* input encoding: Pens. (line 235)
+* insert: Data types. (line 253)
+* insert <1>: Arrays. (line 39)
+* inside: Paths and guides. (line 294)
+* inside <1>: Paths and guides. (line 299)
+* inside <2>: Paths and guides. (line 305)
+* insphere: three. (line 569)
+* inst: Debugger. (line 35)
+* installation: Installation. (line 6)
+* int: Data types. (line 30)
+* integer division: Arithmetic & logical.
+ (line 20)
+* integral: Mathematical functions.
+ (line 82)
+* integrate: Mathematical functions.
+ (line 82)
+* interactive mode: Drawing in interactive mode.
+ (line 6)
+* interactive mode <1>: Interactive mode. (line 6)
+* interior: Paths and guides. (line 290)
+* interp: Arithmetic & logical.
+ (line 64)
+* interpolate: interpolate. (line 6)
+* intersect: Paths and guides. (line 195)
+* intersect <1>: math. (line 13)
+* intersect <2>: three. (line 540)
+* intersectionpoint: Paths and guides. (line 238)
+* intersectionpoint <1>: math. (line 17)
+* intersectionpoint <2>: three. (line 540)
+* intersectionpoints: Paths and guides. (line 242)
+* intersectionpoints <1>: three. (line 540)
+* intersectionpoints <2>: three. (line 553)
+* intersections: Paths and guides. (line 206)
+* intersections <1>: Paths and guides. (line 213)
+* intersections <2>: three. (line 540)
+* intersections <3>: three. (line 546)
+* InTicks: graph3. (line 35)
+* intMax: Data types. (line 30)
+* intMin: Data types. (line 30)
+* inverse: Transforms. (line 16)
+* inverse <1>: Arrays. (line 315)
+* invert: three. (line 468)
+* invisible: Pens. (line 43)
+* isnan: Data types. (line 35)
+* i_scaled: Mathematical functions.
+ (line 48)
+* J: Mathematical functions.
+ (line 6)
+* J <1>: Mathematical functions.
+ (line 48)
+* Japanese: Pens. (line 244)
+* K: Mathematical functions.
+ (line 48)
+* Kate: Editing modes. (line 48)
+* KDE editor: Editing modes. (line 48)
+* keepAspect: Frames and pictures.
+ (line 59)
+* keepAspect <1>: Frames and pictures.
+ (line 63)
+* keepAspect <2>: LaTeX usage. (line 50)
+* keyboard bindings:: three. (line 201)
+* keys: Arrays. (line 39)
+* keyword: Named arguments. (line 37)
+* keyword-only: Named arguments. (line 37)
+* keywords: Named arguments. (line 6)
+* Korean: Pens. (line 244)
+* k_scaled: Mathematical functions.
+ (line 48)
+* label: Labels. (line 6)
+* Label: draw. (line 101)
+* label <1>: label. (line 6)
+* Label <1>: label. (line 14)
+* Label <2>: graph. (line 330)
+* label <2>: three. (line 504)
+* labelpath: labelpath. (line 6)
+* labelpath3: labelpath3. (line 6)
+* labelx: graph. (line 330)
+* labely: graph. (line 330)
+* Landscape: Frames and pictures.
+ (line 104)
+* language context: Pens. (line 235)
+* lastcut: Paths and guides. (line 266)
+* lasy-mode: Editing modes. (line 6)
+* latex: Options. (line 157)
+* LaTeX NFSS fonts: Pens. (line 206)
+* LaTeX usage: LaTeX usage. (line 6)
+* latexmk: LaTeX usage. (line 30)
+* latitude: Data types. (line 164)
+* latticeshade: fill. (line 32)
+* layer: Drawing commands. (line 16)
+* leastsquares: stats. (line 6)
+* leastsquares <1>: graph. (line 929)
+* Left: graph. (line 269)
+* LeftRight: graph. (line 275)
+* LeftSide: label. (line 60)
+* LeftTicks: graph. (line 160)
+* LeftTicks <1>: graph. (line 233)
+* LeftView: three. (line 426)
+* legend: Drawing commands. (line 34)
+* legend <1>: draw. (line 65)
+* legend <2>: graph. (line 424)
+* Legendre: Mathematical functions.
+ (line 48)
+* length: Data types. (line 65)
+* length <1>: Data types. (line 144)
+* length <2>: Data types. (line 239)
+* length <3>: Paths and guides. (line 76)
+* length <4>: Paths and guides. (line 373)
+* length <5>: Arrays. (line 39)
+* length <6>: three. (line 540)
+* letter: Configuring. (line 68)
+* lexorder: math. (line 63)
+* lexorder <1>: math. (line 66)
+* libcurl: Import. (line 94)
+* libgs: Options. (line 162)
+* libm routines: Mathematical functions.
+ (line 6)
+* libsigsegv: Functions. (line 100)
+* libsigsegv <1>: Help. (line 27)
+* light: three. (line 76)
+* limits: graph. (line 639)
+* line: Arrays. (line 352)
+* line <1>: Arrays. (line 356)
+* line mode: Arrays. (line 352)
+* Linear: graph. (line 690)
+* linecap: Pens. (line 139)
+* linejoin: Pens. (line 149)
+* lineskip: Pens. (line 192)
+* linetype: Pens. (line 123)
+* linewidth: Pens. (line 127)
+* locale: Data types. (line 316)
+* log: Mathematical functions.
+ (line 6)
+* Log: graph. (line 690)
+* log-log graph: graph. (line 724)
+* log10: Mathematical functions.
+ (line 6)
+* log1p: Mathematical functions.
+ (line 6)
+* log2 graph: graph. (line 780)
+* logarithmic graph: graph. (line 724)
+* logical operators: Arithmetic & logical.
+ (line 6)
+* longdashdotted: Pens. (line 102)
+* longdashed: Pens. (line 102)
+* longitude: Data types. (line 169)
+* loop: Programming. (line 26)
+* lualatex: Options. (line 157)
+* luatex: Options. (line 157)
+* MacOS X binary distributions: MacOS X binary distributions.
+ (line 6)
+* MacOS X configuration: Compiling from UNIX source.
+ (line 48)
+* makepen: Pens. (line 338)
+* map: Arrays. (line 131)
+* map <1>: Arrays. (line 136)
+* map <2>: map. (line 6)
+* Margin: draw. (line 42)
+* Margin <1>: draw. (line 42)
+* Margin3: three. (line 622)
+* Margin3 <1>: three. (line 622)
+* Margins: draw. (line 42)
+* margins: three. (line 303)
+* Margins3: three. (line 622)
+* mark: graph. (line 480)
+* markangle: markers. (line 35)
+* marker: graph. (line 480)
+* markers: markers. (line 6)
+* marknodes: graph. (line 480)
+* markuniform: graph. (line 480)
+* mask: Data types. (line 35)
+* material: three. (line 66)
+* math: math. (line 6)
+* mathematical functions: Mathematical functions.
+ (line 6)
+* max: Paths and guides. (line 279)
+* max <1>: Frames and pictures.
+ (line 7)
+* max <2>: Arrays. (line 226)
+* max <3>: Arrays. (line 236)
+* max <4>: three. (line 540)
+* maxbound: Data types. (line 134)
+* maxbound <1>: Data types. (line 205)
+* maxtile: three. (line 254)
+* maxtimes: Paths and guides. (line 233)
+* maxviewport: three. (line 254)
+* metallic: three. (line 66)
+* MetaPost: MetaPost. (line 6)
+* MetaPost ... : Bezier curves. (line 70)
+* MetaPost cutafter: Paths and guides. (line 267)
+* MetaPost cutbefore: Paths and guides. (line 263)
+* MetaPost pickup: Pens. (line 6)
+* MetaPost whatever: MetaPost. (line 10)
+* Microsoft Windows: Microsoft Windows. (line 6)
+* MidArcArrow: draw. (line 26)
+* MidArcArrow3: three. (line 606)
+* MidArrow: draw. (line 26)
+* MidArrow3: three. (line 606)
+* MidPoint: label. (line 55)
+* midpoint: Paths and guides. (line 180)
+* min: Paths and guides. (line 275)
+* min <1>: Frames and pictures.
+ (line 7)
+* min <2>: Arrays. (line 221)
+* min <3>: Arrays. (line 231)
+* min <4>: three. (line 540)
+* minbound: Data types. (line 131)
+* minbound <1>: Data types. (line 202)
+* minipage: label. (line 116)
+* mintimes: Paths and guides. (line 228)
+* miterjoin: Pens. (line 149)
+* miterlimit: Pens. (line 159)
+* mktemp: Files. (line 48)
+* mm: Figure size. (line 18)
+* mobile browser: three. (line 223)
+* mode: Files. (line 80)
+* mode <1>: Files. (line 93)
+* monotonic: graph. (line 36)
+* mouse: GUI. (line 6)
+* mouse bindings: three. (line 182)
+* mouse wheel: GUI usage. (line 6)
+* Move: Pens. (line 375)
+* MoveQuiet: Pens. (line 381)
+* multisample: three. (line 174)
+* N: Labels. (line 18)
+* name: Files. (line 93)
+* named arguments: Named arguments. (line 6)
+* nan: Data types. (line 35)
+* natural: graph. (line 36)
+* new: Structures. (line 6)
+* new <1>: Arrays. (line 100)
+* new <2>: Arrays. (line 103)
+* newframe: Frames and pictures.
+ (line 7)
+* newl: Files. (line 65)
+* newpage: Drawing commands. (line 27)
+* newton: Mathematical functions.
+ (line 66)
+* newton <1>: Mathematical functions.
+ (line 73)
+* next: Debugger. (line 41)
+* nobasealign: Pens. (line 181)
+* NoFill: draw. (line 26)
+* NoFill <1>: Frames and pictures.
+ (line 154)
+* noglobalread: Files. (line 26)
+* noglobalread <1>: Files. (line 40)
+* nolight: three. (line 76)
+* NoMargin: draw. (line 42)
+* NoMargin3: three. (line 622)
+* None: draw. (line 19)
+* None <1>: draw. (line 26)
+* none: Files. (line 65)
+* normal: three. (line 526)
+* nosafe: Options. (line 182)
+* NOT: Arithmetic & logical.
+ (line 68)
+* notaknot: graph. (line 36)
+* NoTicks: graph. (line 160)
+* NoTicks3: graph3. (line 35)
+* null: Structures. (line 6)
+* nullpen: label. (line 14)
+* nullpen <1>: Frames and pictures.
+ (line 140)
+* nullpen <2>: Frames and pictures.
+ (line 149)
+* NURBS: three. (line 402)
+* O: three. (line 315)
+* obj: obj. (line 6)
+* oblique: three. (line 358)
+* obliqueX: three. (line 365)
+* obliqueY: three. (line 371)
+* obliqueZ: three. (line 358)
+* ode: ode. (line 6)
+* offset: Pens. (line 123)
+* offset <1>: Options. (line 187)
+* OmitTick: graph. (line 223)
+* OmitTickInterval: graph. (line 223)
+* OmitTickIntervals: graph. (line 223)
+* opacity: Pens. (line 254)
+* opacity <1>: three. (line 66)
+* open: Files. (line 12)
+* OpenGL: three. (line 174)
+* operator: User-defined operators.
+ (line 6)
+* operator +(...string[] a).: Data types. (line 284)
+* operator --: graph. (line 30)
+* operator ..: graph. (line 33)
+* operator answer: Interactive mode. (line 35)
+* operator cast: Casts. (line 38)
+* operator ecast: Casts. (line 65)
+* operator init: Variable initializers.
+ (line 6)
+* operator init <1>: Structures. (line 134)
+* operators: Operators. (line 6)
+* options: Options. (line 6)
+* OR: Arithmetic & logical.
+ (line 68)
+* orient: Data types. (line 108)
+* orient <1>: three. (line 557)
+* orientation: Frames and pictures.
+ (line 104)
+* orthographic: three. (line 375)
+* outformat: three. (line 174)
+* outprefix: Frames and pictures.
+ (line 91)
+* output: Files. (line 38)
+* output <1>: Options. (line 157)
+* OutTicks: graph3. (line 35)
+* overloading functions: Functions. (line 55)
+* overwrite: Pens. (line 360)
+* P: Mathematical functions.
+ (line 48)
+* pack: label. (line 100)
+* packing: Rest arguments. (line 30)
+* pad: Frames and pictures.
+ (line 186)
+* pair: Figure size. (line 6)
+* pair <1>: Data types. (line 46)
+* pairs: Arrays. (line 241)
+* paperheight: Configuring. (line 68)
+* papertype: Configuring. (line 68)
+* paperwidth: Configuring. (line 68)
+* parallelogram: flowchart. (line 47)
+* parametric surface: graph3. (line 99)
+* parametrized curve: graph. (line 639)
+* partialsum: math. (line 49)
+* partialsum <1>: math. (line 52)
+* patch-dependent colors: three. (line 109)
+* path: Paths. (line 6)
+* path <1>: Paths and guides. (line 7)
+* path <2>: three. (line 42)
+* path <3>: flowchart. (line 77)
+* path markers: graph. (line 480)
+* path3: three. (line 6)
+* path3 <1>: three. (line 42)
+* path[]: Paths. (line 23)
+* patterns: Pens. (line 271)
+* patterns <1>: patterns. (line 6)
+* PBR: three. (line 74)
+* PDF: Options. (line 157)
+* pdflatex: Options. (line 157)
+* pdfreloadOptions: Options. (line 143)
+* pdfviewer: Configuring. (line 20)
+* pdfviewerOptions: Options. (line 143)
+* pen: Pens. (line 6)
+* PenMargin: draw. (line 42)
+* PenMargin2: three. (line 622)
+* PenMargin3: three. (line 622)
+* PenMargins: draw. (line 42)
+* PenMargins2: three. (line 622)
+* PenMargins3: three. (line 622)
+* periodic: graph. (line 36)
+* perl: LaTeX usage. (line 30)
+* perpendicular: geometry. (line 6)
+* perspective: three. (line 402)
+* physically based rendering: three. (line 74)
+* picture: Frames and pictures.
+ (line 39)
+* picture alignment: Frames and pictures.
+ (line 231)
+* piecewisestraight: Paths and guides. (line 92)
+* pixel: three. (line 629)
+* Pl: Mathematical functions.
+ (line 48)
+* plain: plain. (line 6)
+* planar: three. (line 118)
+* plane: three. (line 341)
+* planeproject: three. (line 523)
+* point: Paths and guides. (line 95)
+* point <1>: Paths and guides. (line 379)
+* point <2>: three. (line 540)
+* polar: Data types. (line 149)
+* polargraph: graph. (line 88)
+* polygon: graph. (line 480)
+* pop: Arrays. (line 39)
+* Portrait: Frames and pictures.
+ (line 104)
+* position: three. (line 76)
+* position <1>: three. (line 174)
+* postcontrol: Paths and guides. (line 146)
+* postcontrol <1>: three. (line 540)
+* postfix operators: Self & prefix operators.
+ (line 19)
+* postscript: Frames and pictures.
+ (line 297)
+* PostScript fonts: Pens. (line 222)
+* PostScript subpath: Paths. (line 23)
+* pow10: Mathematical functions.
+ (line 6)
+* prc: three. (line 272)
+* precision: Files. (line 97)
+* precontrol: Paths and guides. (line 139)
+* precontrol <1>: three. (line 540)
+* prefix operators: Self & prefix operators.
+ (line 6)
+* private: Structures. (line 6)
+* programming: Programming. (line 6)
+* pstoedit: PostScript to Asymptote.
+ (line 6)
+* psviewer: Configuring. (line 20)
+* psviewerOptions: Options. (line 143)
+* pt: Figure size. (line 18)
+* public: Structures. (line 6)
+* push: Arrays. (line 39)
+* Python usage: Interactive mode. (line 72)
+* quadraticroots: Arrays. (line 318)
+* quadraticroots <1>: Arrays. (line 323)
+* quarticroots: math. (line 22)
+* quick reference: Description. (line 88)
+* quit: Drawing in interactive mode.
+ (line 11)
+* quit <1>: Interactive mode. (line 54)
+* quit <2>: Debugger. (line 53)
+* quote: Import. (line 120)
+* quotient: Arithmetic & logical.
+ (line 6)
+* radialshade: fill. (line 52)
+* RadialShade: Frames and pictures.
+ (line 172)
+* RadialShadeDraw: Frames and pictures.
+ (line 176)
+* radians: Mathematical functions.
+ (line 17)
+* radius: Paths and guides. (line 135)
+* radius <1>: three. (line 540)
+* Rainbow: palette. (line 12)
+* rand: Mathematical functions.
+ (line 39)
+* randMax: Mathematical functions.
+ (line 39)
+* read: Arrays. (line 392)
+* reading: Files. (line 12)
+* reading string arrays: Arrays. (line 362)
+* readline: Files. (line 139)
+* real: Data types. (line 35)
+* realDigits: Data types. (line 35)
+* realEpsilon: Data types. (line 35)
+* realMax: Data types. (line 35)
+* realMin: Data types. (line 35)
+* realmult: Data types. (line 100)
+* rectangle: flowchart. (line 34)
+* recursion: Functions. (line 100)
+* reference: Description. (line 88)
+* reflect: Transforms. (line 42)
+* Relative: label. (line 50)
+* Relative <1>: label. (line 60)
+* relpoint: Paths and guides. (line 176)
+* reltime: Paths and guides. (line 172)
+* remainder: Mathematical functions.
+ (line 6)
+* rename: Files. (line 156)
+* render: three. (line 46)
+* render <1>: three. (line 174)
+* render <2>: Options. (line 157)
+* replace: Data types. (line 270)
+* resetdefaultpen: Pens. (line 387)
+* rest arguments: Rest arguments. (line 6)
+* restore: Frames and pictures.
+ (line 291)
+* restricted: Structures. (line 6)
+* return: Debugger. (line 47)
+* reverse: Data types. (line 266)
+* reverse <1>: Paths and guides. (line 183)
+* reverse <2>: Paths and guides. (line 382)
+* reverse <3>: Arrays. (line 141)
+* reverse <4>: three. (line 540)
+* rewind: Files. (line 97)
+* rfind: Data types. (line 247)
+* rgb: Pens. (line 30)
+* rgb <1>: Pens. (line 34)
+* rgb <2>: Pens. (line 62)
+* Riemann zeta function: Mathematical functions.
+ (line 48)
+* Right: graph. (line 272)
+* RightSide: label. (line 60)
+* RightTicks: graph. (line 160)
+* RightTicks <1>: graph. (line 233)
+* RightView: three. (line 426)
+* Rotate: label. (line 36)
+* rotate: three. (line 494)
+* Rotate(pair z): label. (line 39)
+* round: Mathematical functions.
+ (line 26)
+* roundcap: Pens. (line 139)
+* roundedpath: roundedpath. (line 6)
+* roundjoin: Pens. (line 149)
+* roundrectangle: flowchart. (line 66)
+* RPM: UNIX binary distributions.
+ (line 6)
+* runtime imports: Import. (line 102)
+* Russian: Pens. (line 237)
+* S: Labels. (line 18)
+* safe: Options. (line 182)
+* save: Frames and pictures.
+ (line 288)
+* saveline: Files. (line 139)
+* Scale: label. (line 45)
+* scale: Pens. (line 123)
+* scale <1>: Transforms. (line 34)
+* scale <2>: Transforms. (line 36)
+* scale <3>: graph. (line 690)
+* Scale <1>: graph. (line 707)
+* scale <4>: three. (line 493)
+* scale3: three. (line 491)
+* scaled graph: graph. (line 670)
+* scientific graph: graph. (line 387)
+* scroll: Files. (line 113)
+* search: Arrays. (line 162)
+* search <1>: Arrays. (line 168)
+* search paths: Search paths. (line 6)
+* Seascape: Frames and pictures.
+ (line 110)
+* secondary axis: graph. (line 833)
+* secondaryX: graph. (line 833)
+* secondaryY: graph. (line 833)
+* seconds: Data types. (line 330)
+* seek: Files. (line 97)
+* seekeof: Files. (line 97)
+* segment: math. (line 46)
+* segmentation fault: Help. (line 27)
+* self operators: Self & prefix operators.
+ (line 6)
+* sequence: Arrays. (line 118)
+* settings: Configuring. (line 20)
+* settings <1>: Options. (line 128)
+* sgn: Mathematical functions.
+ (line 26)
+* shading: fill. (line 32)
+* Shift: label. (line 33)
+* shift: Transforms. (line 26)
+* shift <1>: Transforms. (line 28)
+* shift <2>: Transforms. (line 46)
+* shift <3>: three. (line 483)
+* shiftless: Transforms. (line 46)
+* shininess: three. (line 66)
+* shipout: Frames and pictures.
+ (line 91)
+* showtarget: three. (line 375)
+* Si: Mathematical functions.
+ (line 48)
+* signedint: Files. (line 80)
+* signedint <1>: Files. (line 93)
+* SimpleHead: draw. (line 26)
+* simplex: simplex. (line 6)
+* simpson: Mathematical functions.
+ (line 82)
+* sin: Mathematical functions.
+ (line 6)
+* Sin: Mathematical functions.
+ (line 20)
+* single precision: Files. (line 80)
+* singleint: Files. (line 80)
+* singleint <1>: Files. (line 93)
+* singlereal: Files. (line 80)
+* singlereal <1>: Files. (line 93)
+* sinh: Mathematical functions.
+ (line 6)
+* SixViews: three. (line 441)
+* SixViewsFR: three. (line 441)
+* SixViewsUS: three. (line 441)
+* size: Figure size. (line 6)
+* size <1>: Paths and guides. (line 81)
+* size <2>: Paths and guides. (line 370)
+* size <3>: Frames and pictures.
+ (line 48)
+* size <4>: Frames and pictures.
+ (line 74)
+* size <5>: three. (line 540)
+* size <6>: Options. (line 157)
+* size3: three. (line 300)
+* Slant: label. (line 42)
+* slant: Transforms. (line 38)
+* sleep: Data types. (line 376)
+* slice: Paths and guides. (line 251)
+* slice <1>: Paths and guides. (line 262)
+* slices: Slices. (line 6)
+* slide: slide. (line 6)
+* slope: math. (line 40)
+* slope <1>: math. (line 43)
+* slopefield: slopefield. (line 6)
+* smoothcontour3: smoothcontour3. (line 6)
+* sncndn: Mathematical functions.
+ (line 48)
+* solid: Pens. (line 102)
+* solids: solids. (line 6)
+* solve: Arrays. (line 287)
+* solve <1>: Arrays. (line 303)
+* sort: Arrays. (line 182)
+* sort <1>: Arrays. (line 186)
+* sort <2>: Arrays. (line 201)
+* specular: three. (line 76)
+* specularfactor: three. (line 76)
+* specularpen: three. (line 66)
+* Spline: graph. (line 33)
+* Spline <1>: graph3. (line 99)
+* split: Data types. (line 279)
+* sqrt: Mathematical functions.
+ (line 6)
+* squarecap: Pens. (line 139)
+* srand: Mathematical functions.
+ (line 39)
+* stack overflow: Functions. (line 100)
+* stack overflow <1>: Functions. (line 100)
+* stack overflow <2>: Help. (line 27)
+* static: Static. (line 6)
+* stats: stats. (line 6)
+* stdin: Files. (line 52)
+* stdout: Files. (line 52)
+* step: Debugger. (line 38)
+* stickframe: markers. (line 16)
+* stop: Debugger. (line 10)
+* straight: Paths and guides. (line 88)
+* Straight: graph. (line 30)
+* straight <1>: three. (line 540)
+* strftime: Data types. (line 321)
+* strftime <1>: Data types. (line 346)
+* string: Data types. (line 208)
+* string <1>: Data types. (line 312)
+* stroke: fill. (line 36)
+* stroke <1>: clip. (line 6)
+* strokepath: Paths and guides. (line 309)
+* strptime: Data types. (line 330)
+* struct: Structures. (line 6)
+* structures: Structures. (line 6)
+* subpath: Paths and guides. (line 186)
+* subpath <1>: three. (line 540)
+* subpictures: Frames and pictures.
+ (line 113)
+* substr: Data types. (line 262)
+* sum: Arrays. (line 216)
+* superpath: Paths. (line 23)
+* Suppress: Pens. (line 367)
+* SuppressQuiet: Pens. (line 371)
+* surface: three. (line 46)
+* surface <1>: three. (line 118)
+* surface <2>: three. (line 132)
+* surface <3>: graph3. (line 99)
+* SVG: Options. (line 162)
+* system: Data types. (line 354)
+* system <1>: Options. (line 182)
+* syzygy: syzygy. (line 6)
+* tab: Files. (line 65)
+* tab completion: Drawing in interactive mode.
+ (line 11)
+* tan: Mathematical functions.
+ (line 6)
+* Tan: Mathematical functions.
+ (line 20)
+* tanh: Mathematical functions.
+ (line 6)
+* target: three. (line 375)
+* tell: Files. (line 97)
+* tension: Bezier curves. (line 56)
+* tension <1>: three. (line 6)
+* tensionSpecifier: Paths and guides. (line 402)
+* tensor product shading: fill. (line 78)
+* tensorshade: fill. (line 78)
+* tessellation: three. (line 144)
+* tex: Frames and pictures.
+ (line 305)
+* tex <1>: Options. (line 157)
+* TeX fonts: Pens. (line 213)
+* TeX string: Data types. (line 208)
+* texcommand: Configuring. (line 74)
+* TeXHead: draw. (line 26)
+* TeXHead3: three. (line 606)
+* texpath: Configuring. (line 74)
+* texpath <1>: label. (line 113)
+* texpreamble: Frames and pictures.
+ (line 314)
+* texreset: Frames and pictures.
+ (line 318)
+* textbook graph: graph. (line 360)
+* tgz: UNIX binary distributions.
+ (line 6)
+* thick: three. (line 156)
+* thin: three. (line 156)
+* this: Structures. (line 6)
+* three: three. (line 6)
+* ThreeViews: three. (line 441)
+* ThreeViewsFR: three. (line 441)
+* ThreeViewsUS: three. (line 441)
+* tick: graph. (line 330)
+* ticks: graph. (line 160)
+* Ticks: graph. (line 160)
+* Ticks <1>: graph. (line 233)
+* tildeframe: markers. (line 24)
+* tile: Pens. (line 285)
+* tilings: Pens. (line 271)
+* time: Data types. (line 321)
+* time <1>: Data types. (line 346)
+* time <2>: math. (line 26)
+* time <3>: math. (line 30)
+* times: Paths and guides. (line 220)
+* times <1>: Paths and guides. (line 224)
+* Top: graph. (line 135)
+* TopView: three. (line 426)
+* trace: Debugger. (line 50)
+* trailingzero: graph. (line 175)
+* transform: Transforms. (line 6)
+* transform <1>: three. (line 515)
+* transform3: three. (line 478)
+* transparency: Pens. (line 254)
+* transparent: three. (line 97)
+* transpose: Arrays. (line 208)
+* transpose <1>: Arrays. (line 211)
+* tree: tree. (line 6)
+* trembling: trembling. (line 6)
+* triangle: geometry. (line 6)
+* triangles: three. (line 144)
+* triangulate: contour. (line 149)
+* tridiagonal: Arrays. (line 274)
+* trigonometric integrals: Mathematical functions.
+ (line 48)
+* triple: Data types. (line 137)
+* TrueMargin: draw. (line 42)
+* TrueMargin3: three. (line 622)
+* tube: three. (line 156)
+* tube <1>: tube. (line 6)
+* tutorial: Tutorial. (line 6)
+* type1cm: Pens. (line 192)
+* typedef: Data types. (line 385)
+* typedef <1>: Functions. (line 46)
+* U3D: embed. (line 22)
+* undefined: Paths and guides. (line 283)
+* UnFill: draw. (line 26)
+* unfill: fill. (line 110)
+* UnFill <1>: Frames and pictures.
+ (line 165)
+* UnFill <2>: Frames and pictures.
+ (line 168)
+* uniform: Arrays. (line 150)
+* uninstall: Uninstall. (line 6)
+* unique: math. (line 59)
+* unit: Data types. (line 83)
+* unit <1>: Data types. (line 174)
+* unitbox: Paths. (line 44)
+* unitbox <1>: three. (line 347)
+* unitcircle: Paths. (line 17)
+* unitcircle <1>: Paths. (line 17)
+* unitcircle <2>: three. (line 315)
+* unitrand: Mathematical functions.
+ (line 39)
+* unitsize: Figure size. (line 39)
+* unitsize <1>: Frames and pictures.
+ (line 69)
+* UNIX binary distributions: UNIX binary distributions.
+ (line 6)
+* unpacking: Rest arguments. (line 39)
+* unravel: Import. (line 29)
+* up: three. (line 375)
+* update: Files. (line 38)
+* UpsideDown: Frames and pictures.
+ (line 104)
+* UpsideDown <1>: Frames and pictures.
+ (line 110)
+* URL: Import. (line 94)
+* usepackage: Frames and pictures.
+ (line 321)
+* user coordinates: Figure size. (line 39)
+* user-defined operators: User-defined operators.
+ (line 6)
+* usleep: Data types. (line 379)
+* value: math. (line 34)
+* value <1>: math. (line 37)
+* var: Variable initializers.
+ (line 55)
+* variable initializers: Variable initializers.
+ (line 6)
+* vectorfield: graph. (line 1004)
+* vectorfield <1>: graph. (line 1043)
+* vectorfield3: graph3. (line 157)
+* vectorization: Arrays. (line 331)
+* verbatim: Frames and pictures.
+ (line 297)
+* vertex-dependent colors: three. (line 109)
+* Vertical: flowchart. (line 77)
+* Viewport: three. (line 76)
+* viewportheight: LaTeX usage. (line 50)
+* viewportmargin: three. (line 303)
+* viewportsize: three. (line 303)
+* viewportwidth: LaTeX usage. (line 50)
+* views: three. (line 272)
+* vim: Editing modes. (line 32)
+* virtual functions: Structures. (line 182)
+* void: Data types. (line 10)
+* W: Labels. (line 18)
+* WebGL: three. (line 223)
+* whatever: Paths and guides. (line 246)
+* Wheel: palette. (line 22)
+* wheel mouse: GUI. (line 6)
+* while: Programming. (line 48)
+* White: three. (line 76)
+* white-space string delimiter mode: Arrays. (line 362)
+* width: LaTeX usage. (line 50)
+* windingnumber: Paths and guides. (line 283)
+* word: Arrays. (line 362)
+* write: Files. (line 57)
+* write <1>: Arrays. (line 401)
+* X: three. (line 315)
+* xasy: GUI. (line 6)
+* xaxis3: graph3. (line 7)
+* xdr: Files. (line 80)
+* xelatex: Options. (line 157)
+* XEquals: graph. (line 265)
+* xequals: graph. (line 278)
+* xlimits: graph. (line 639)
+* XOR: Arithmetic & logical.
+ (line 68)
+* xpart: Data types. (line 94)
+* xpart <1>: Data types. (line 185)
+* xscale: Transforms. (line 30)
+* xscale3: three. (line 485)
+* xtick: graph. (line 330)
+* XY: three. (line 500)
+* XY <1>: three. (line 515)
+* XYEquals: graph3. (line 21)
+* XYZero: graph3. (line 21)
+* XZEquals: graph3. (line 21)
+* XZero: graph. (line 260)
+* XZZero: graph3. (line 21)
+* Y: Mathematical functions.
+ (line 6)
+* Y <1>: Mathematical functions.
+ (line 48)
+* Y <2>: three. (line 315)
+* yaxis3: graph3. (line 7)
+* YEquals: graph. (line 128)
+* yequals: graph. (line 278)
+* ylimits: graph. (line 639)
+* ypart: Data types. (line 97)
+* ypart <1>: Data types. (line 188)
+* yscale: Transforms. (line 32)
+* yscale3: three. (line 487)
+* ytick: graph. (line 330)
+* YX: three. (line 515)
+* YZ: three. (line 515)
+* YZEquals: graph3. (line 21)
+* YZero: graph. (line 123)
+* YZZero: graph3. (line 21)
+* Z: three. (line 315)
+* zaxis3: graph3. (line 7)
+* zeroTransform: Transforms. (line 44)
+* zerowinding: Pens. (line 164)
+* zero_Ai: Mathematical functions.
+ (line 48)
+* zero_Ai_deriv: Mathematical functions.
+ (line 48)
+* zero_Bi: Mathematical functions.
+ (line 48)
+* zero_Bi_deriv: Mathematical functions.
+ (line 48)
+* zero_J: Mathematical functions.
+ (line 48)
+* zeta: Mathematical functions.
+ (line 48)
+* zpart: Data types. (line 191)
+* zscale3: three. (line 489)
+* ZX: three. (line 515)
+* ZX <1>: three. (line 515)
+* ZY: three. (line 515)
+
+
+
+Tag Table:
+Node: Top570
+Node: Description7200
+Node: Installation11286
+Node: UNIX binary distributions12332
+Node: MacOS X binary distributions13455
+Node: Microsoft Windows14010
+Node: Configuring15217
+Node: Search paths19829
+Node: Compiling from UNIX source20837
+Node: Editing modes23988
+Node: Git26410
+Node: Uninstall26917
+Node: Tutorial27263
+Node: Drawing in batch mode28110
+Node: Drawing in interactive mode28986
+Node: Figure size30018
+Node: Labels31613
+Node: Paths32441
+Ref: unitcircle33057
+Node: Drawing commands34955
+Node: draw36763
+Ref: arrows37945
+Node: fill43461
+Ref: gradient shading44507
+Node: clip49121
+Node: label49870
+Ref: Label50470
+Node: Bezier curves56328
+Node: Programming60228
+Ref: array iteration61981
+Node: Data types62148
+Ref: format72916
+Node: Paths and guides77362
+Ref: circle77616
+Ref: extension87316
+Node: Pens94126
+Ref: fillrule101817
+Ref: basealign102721
+Ref: transparency106403
+Ref: makepen109997
+Ref: overwrite110881
+Node: Transforms112095
+Node: Frames and pictures114034
+Ref: envelope115192
+Ref: size116285
+Ref: unitsize117272
+Ref: shipout118345
+Ref: filltype120696
+Ref: add124109
+Ref: add about125051
+Ref: tex128081
+Node: Files128977
+Ref: cd130034
+Ref: scroll134936
+Node: Variable initializers137854
+Node: Structures140571
+Node: Operators148149
+Node: Arithmetic & logical148463
+Node: Self & prefix operators150833
+Node: User-defined operators151627
+Node: Implicit scaling152540
+Node: Functions153103
+Ref: stack overflow156245
+Node: Default arguments156527
+Node: Named arguments157283
+Node: Rest arguments159853
+Node: Mathematical functions162975
+Node: Arrays167632
+Ref: sort174921
+Ref: tridiagonal177832
+Ref: solve179063
+Node: Slices183203
+Node: Casts187111
+Node: Import189381
+Node: Static194962
+Node: LaTeX usage197848
+Node: Base modules204343
+Node: plain206820
+Node: simplex207494
+Node: math207767
+Node: interpolate210350
+Node: geometry210629
+Node: trembling211223
+Node: stats211492
+Node: patterns211751
+Node: markers211986
+Node: map213845
+Node: tree214269
+Node: binarytree214453
+Node: drawtree215120
+Node: syzygy215321
+Node: feynman215595
+Node: roundedpath215869
+Node: animation216151
+Ref: animate216572
+Node: embed217684
+Node: slide218638
+Node: MetaPost218969
+Node: babel219685
+Node: labelpath219917
+Node: labelpath3220737
+Node: annotate221048
+Node: CAD221518
+Node: graph221828
+Ref: ticks228988
+Ref: pathmarkers242713
+Ref: marker243184
+Ref: markuniform243538
+Ref: errorbars245346
+Ref: automatic scaling249825
+Node: palette261540
+Ref: images261658
+Ref: image265832
+Ref: logimage266353
+Ref: penimage267459
+Ref: penfunctionimage267722
+Node: three268494
+Ref: PostScript3D298021
+Node: obj299759
+Node: graph3300008
+Ref: GaussianSurface305291
+Node: grid3306441
+Node: solids307226
+Node: tube308218
+Node: flowchart310448
+Node: contour315091
+Node: contour3320406
+Node: smoothcontour3320718
+Node: slopefield322439
+Node: ode323929
+Node: Options324186
+Ref: configuration file331094
+Ref: settings331094
+Ref: texengines332358
+Ref: convert332358
+Node: Interactive mode335792
+Ref: history337942
+Node: GUI339245
+Node: GUI installation339796
+Node: GUI usage340529
+Node: PostScript to Asymptote341592
+Node: Help342351
+Node: Debugger344025
+Node: Credits345781
+Node: Index346889
+
+End Tag Table
diff --git a/Build/source/utils/asymptote/doc/quartercircle.asy b/Build/source/utils/asymptote/doc/quartercircle.asy
new file mode 100644
index 00000000000..6565daa046e
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/quartercircle.asy
@@ -0,0 +1,2 @@
+size(100,0);
+draw((1,0){up}..{left}(0,1),Arrow);
diff --git a/Build/source/utils/asymptote/doc/reloadpdf.tex b/Build/source/utils/asymptote/doc/reloadpdf.tex
new file mode 100644
index 00000000000..f203af1699b
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/reloadpdf.tex
@@ -0,0 +1,11 @@
+% Tex file for generating the reloadpdf.pdf utility to force Adobe Reader
+% to reload all currently loaded documents. Usage:
+%
+% pdflatex reloadpdf
+% acroread reloadpdf.pdf
+%
+\documentclass{article}
+\begin{document}
+\ \pdfannot width 0pt height 0pt { /AA << /PO << /S /JavaScript /JS
+ (try{reload();} catch(e) {} closeDoc(this);) >> >> }
+\end{document}
diff --git a/Build/source/utils/asymptote/doc/saddle.asy b/Build/source/utils/asymptote/doc/saddle.asy
new file mode 100644
index 00000000000..0180bf125a6
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/saddle.asy
@@ -0,0 +1,7 @@
+import three;
+
+size(100,0);
+path3 g=(1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle;
+draw(g);
+draw(((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle));
+dot(g,red);
diff --git a/Build/source/utils/asymptote/doc/scaledgraph.asy b/Build/source/utils/asymptote/doc/scaledgraph.asy
new file mode 100644
index 00000000000..408c10cc582
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/scaledgraph.asy
@@ -0,0 +1,15 @@
+import graph;
+
+axiscoverage=0.9;
+size(200,IgnoreAspect);
+
+real[] x={-1e-11,1e-11};
+real[] y={0,1e6};
+
+real xscale=round(log10(max(x)));
+real yscale=round(log10(max(y)))-1;
+
+draw(graph(x*10^(-xscale),y*10^(-yscale)),red);
+
+xaxis("$x/10^{"+(string) xscale+"}$",BottomTop,LeftTicks);
+yaxis("$y/10^{"+(string) yscale+"}$",LeftRight,RightTicks(trailingzero));
diff --git a/Build/source/utils/asymptote/doc/secondaryaxis.asy b/Build/source/utils/asymptote/doc/secondaryaxis.asy
new file mode 100644
index 00000000000..85143f7acec
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/secondaryaxis.asy
@@ -0,0 +1,32 @@
+import graph;
+
+size(9cm,6cm,IgnoreAspect);
+string data="secondaryaxis.csv";
+
+file in=input(data).line().csv();
+
+string[] titlelabel=in;
+string[] columnlabel=in;
+
+real[][] a=in;
+a=transpose(a);
+real[] t=a[0], susceptible=a[1], infectious=a[2], dead=a[3], larvae=a[4];
+real[] susceptibleM=a[5], exposed=a[6],infectiousM=a[7];
+
+scale(true);
+
+draw(graph(t,susceptible,t >= 10 & t <= 15));
+draw(graph(t,dead,t >= 10 & t <= 15),dashed);
+
+xaxis("Time ($\tau$)",BottomTop,LeftTicks);
+yaxis(Left,RightTicks);
+
+picture secondary=secondaryY(new void(picture pic) {
+ scale(pic,Linear(true),Log(true));
+ draw(pic,graph(pic,t,infectious,t >= 10 & t <= 15),red);
+ yaxis(pic,Right,red,LeftTicks(begin=false,end=false));
+ });
+
+add(secondary);
+label(shift(5mm*N)*"Proportion of crows",point(NW),E);
+
diff --git a/Build/source/utils/asymptote/doc/secondaryaxis.csv b/Build/source/utils/asymptote/doc/secondaryaxis.csv
new file mode 100644
index 00000000000..082d45a0e71
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/secondaryaxis.csv
@@ -0,0 +1,1003 @@
+,"Proportion of crows",,,"Mosquitoes per crow",,,
+Time,Susceptible,Infectious,Dead,Larvae,Susceptible,Exposed,Infectious
+0,1,0,0,,30,0.000,0.001
+0.1,1.000,0.000,0.000,12.794,30.000,0.000,0.001
+0.2,1.000,0.000,0.000,12.794,30.000,0.000,0.001
+0.3,1.000,0.000,0.000,12.795,30.000,0.000,0.001
+0.4,1.000,0.000,0.000,12.795,30.000,0.000,0.001
+0.5,1.000,0.000,0.000,12.795,30.000,0.000,0.001
+0.6,1.000,0.000,0.000,12.795,30.000,0.000,0.001
+0.7,1.000,0.000,0.000,12.795,30.000,0.000,0.001
+0.8,0.999,0.000,0.000,12.795,30.000,0.000,0.001
+0.9,0.999,0.000,0.000,12.795,29.999,0.001,0.001
+1,0.999,0.000,0.000,12.795,29.999,0.001,0.001
+1.1,0.999,0.000,0.000,12.795,29.999,0.001,0.001
+1.2,0.999,0.000,0.000,12.795,29.999,0.001,0.001
+1.3,0.999,0.000,0.000,12.795,29.999,0.001,0.001
+1.4,0.999,0.000,0.001,12.795,29.999,0.001,0.001
+1.5,0.999,0.001,0.001,12.795,29.999,0.001,0.001
+1.6,0.999,0.001,0.001,12.795,29.999,0.001,0.001
+1.7,0.999,0.001,0.001,12.795,29.998,0.001,0.001
+1.8,0.999,0.001,0.001,12.795,29.998,0.001,0.001
+1.9,0.998,0.001,0.001,12.795,29.998,0.001,0.002
+2,0.998,0.001,0.001,12.795,29.998,0.001,0.002
+2.1,0.998,0.001,0.001,12.795,29.998,0.002,0.002
+2.2,0.998,0.001,0.001,12.795,29.998,0.002,0.002
+2.3,0.998,0.001,0.001,12.795,29.997,0.002,0.002
+2.4,0.998,0.001,0.001,12.795,29.997,0.002,0.002
+2.5,0.998,0.001,0.002,12.795,29.997,0.002,0.002
+2.6,0.997,0.001,0.002,12.795,29.997,0.002,0.002
+2.7,0.997,0.001,0.002,12.795,29.996,0.002,0.003
+2.8,0.997,0.001,0.002,12.795,29.996,0.002,0.003
+2.9,0.997,0.001,0.002,12.795,29.996,0.002,0.003
+3,0.997,0.001,0.002,12.795,29.995,0.003,0.003
+3.1,0.996,0.001,0.002,12.795,29.995,0.003,0.003
+3.2,0.996,0.001,0.003,12.795,29.995,0.003,0.003
+3.3,0.996,0.001,0.003,12.795,29.994,0.003,0.004
+3.4,0.996,0.001,0.003,12.795,29.994,0.003,0.004
+3.5,0.995,0.002,0.003,12.795,29.994,0.003,0.004
+3.6,0.995,0.002,0.003,12.795,29.993,0.004,0.004
+3.7,0.995,0.002,0.004,12.795,29.993,0.004,0.004
+3.8,0.994,0.002,0.004,12.795,29.992,0.004,0.005
+3.9,0.994,0.002,0.004,12.795,29.992,0.004,0.005
+4,0.994,0.002,0.004,12.795,29.991,0.005,0.005
+4.1,0.993,0.002,0.005,12.795,29.991,0.005,0.006
+4.2,0.993,0.002,0.005,12.795,29.990,0.005,0.006
+4.3,0.992,0.002,0.005,12.795,29.989,0.005,0.006
+4.4,0.992,0.003,0.006,12.795,29.989,0.006,0.007
+4.5,0.991,0.003,0.006,12.795,29.988,0.006,0.007
+4.6,0.991,0.003,0.006,12.795,29.987,0.006,0.008
+4.7,0.990,0.003,0.007,12.795,29.986,0.007,0.008
+4.8,0.990,0.003,0.007,12.795,29.985,0.007,0.008
+4.9,0.989,0.003,0.008,12.795,29.984,0.008,0.009
+5,0.988,0.004,0.008,12.795,29.984,0.008,0.009
+5.1,0.988,0.004,0.009,12.795,29.982,0.008,0.010
+5.2,0.987,0.004,0.009,12.795,29.981,0.009,0.011
+5.3,0.986,0.004,0.010,12.795,29.980,0.010,0.011
+5.4,0.985,0.005,0.010,12.795,29.979,0.010,0.012
+5.5,0.984,0.005,0.011,12.795,29.978,0.011,0.013
+5.6,0.983,0.005,0.012,12.795,29.976,0.011,0.013
+5.7,0.982,0.005,0.012,12.795,29.975,0.012,0.014
+5.8,0.981,0.006,0.013,12.795,29.973,0.013,0.015
+5.9,0.980,0.006,0.014,12.795,29.972,0.013,0.016
+6,0.979,0.006,0.015,12.795,29.970,0.014,0.017
+6.1,0.978,0.007,0.016,12.795,29.968,0.015,0.018
+6.2,0.976,0.007,0.016,12.795,29.966,0.016,0.019
+6.3,0.975,0.008,0.017,12.795,29.964,0.017,0.020
+6.4,0.973,0.008,0.019,12.795,29.962,0.018,0.021
+6.5,0.972,0.008,0.020,12.795,29.960,0.019,0.022
+6.6,0.970,0.009,0.021,12.795,29.957,0.020,0.024
+6.7,0.968,0.009,0.022,12.795,29.955,0.021,0.025
+6.8,0.967,0.010,0.023,12.795,29.952,0.022,0.026
+6.9,0.965,0.011,0.025,12.795,29.949,0.024,0.028
+7,0.963,0.011,0.026,12.795,29.946,0.025,0.030
+7.1,0.960,0.012,0.028,12.795,29.943,0.026,0.031
+7.2,0.958,0.013,0.029,12.795,29.940,0.028,0.033
+7.3,0.956,0.013,0.031,12.795,29.936,0.029,0.035
+7.4,0.953,0.014,0.033,12.795,29.933,0.031,0.037
+7.5,0.950,0.015,0.035,12.795,29.929,0.033,0.039
+7.6,0.947,0.016,0.037,12.795,29.925,0.035,0.042
+7.7,0.944,0.016,0.039,12.795,29.920,0.037,0.044
+7.8,0.941,0.017,0.041,12.795,29.916,0.039,0.046
+7.9,0.938,0.018,0.044,12.795,29.911,0.041,0.049
+8,0.934,0.019,0.046,12.795,29.906,0.043,0.052
+8.1,0.931,0.020,0.049,12.795,29.900,0.046,0.055
+8.2,0.927,0.021,0.052,12.795,29.895,0.048,0.058
+8.3,0.923,0.023,0.055,12.795,29.889,0.051,0.061
+8.4,0.918,0.024,0.058,12.795,29.883,0.054,0.065
+8.5,0.914,0.025,0.061,12.795,29.876,0.056,0.069
+8.6,0.909,0.026,0.065,12.795,29.869,0.059,0.072
+8.7,0.904,0.028,0.068,12.795,29.862,0.063,0.076
+8.8,0.899,0.029,0.072,12.795,29.854,0.066,0.081
+8.9,0.893,0.031,0.076,12.795,29.846,0.070,0.085
+9,0.887,0.032,0.080,12.795,29.838,0.073,0.090
+9.1,0.881,0.034,0.085,12.795,29.829,0.077,0.095
+9.2,0.875,0.036,0.090,12.795,29.820,0.081,0.100
+9.3,0.868,0.037,0.095,12.795,29.810,0.085,0.106
+9.4,0.861,0.039,0.100,12.795,29.800,0.090,0.112
+9.5,0.854,0.041,0.105,12.795,29.789,0.094,0.118
+9.6,0.846,0.043,0.111,12.795,29.778,0.099,0.124
+9.7,0.838,0.045,0.117,12.795,29.766,0.104,0.131
+9.8,0.830,0.047,0.123,12.795,29.754,0.109,0.138
+9.9,0.821,0.049,0.130,12.795,29.742,0.114,0.145
+10,0.812,0.052,0.136,12.795,29.729,0.120,0.153
+10.1,0.802,0.054,0.144,12.795,29.715,0.126,0.161
+10.2,0.793,0.056,0.151,12.795,29.701,0.132,0.169
+10.3,0.782,0.059,0.159,12.795,29.686,0.138,0.178
+10.4,0.772,0.061,0.167,12.795,29.670,0.144,0.187
+10.5,0.761,0.064,0.175,12.795,29.654,0.150,0.196
+10.6,0.750,0.066,0.184,12.795,29.638,0.157,0.206
+10.7,0.738,0.069,0.193,12.795,29.621,0.164,0.216
+10.8,0.726,0.072,0.203,12.795,29.603,0.171,0.227
+10.9,0.713,0.074,0.212,12.795,29.585,0.178,0.238
+11,0.700,0.077,0.223,12.795,29.566,0.185,0.250
+11.1,0.687,0.080,0.233,12.795,29.547,0.193,0.261
+11.2,0.674,0.082,0.244,12.795,29.527,0.200,0.274
+11.3,0.660,0.085,0.255,12.795,29.507,0.208,0.286
+11.4,0.645,0.088,0.267,12.795,29.486,0.215,0.300
+11.5,0.631,0.090,0.279,12.795,29.465,0.223,0.313
+11.6,0.616,0.093,0.291,12.795,29.443,0.231,0.327
+11.7,0.601,0.095,0.304,12.795,29.421,0.238,0.341
+11.8,0.585,0.098,0.317,12.795,29.399,0.246,0.356
+11.9,0.570,0.100,0.330,12.795,29.376,0.254,0.371
+12,0.554,0.102,0.344,12.795,29.353,0.261,0.386
+12.1,0.538,0.104,0.358,12.795,29.330,0.269,0.402
+12.2,0.521,0.106,0.372,12.795,29.307,0.276,0.418
+12.3,0.505,0.108,0.387,12.795,29.283,0.283,0.434
+12.4,0.489,0.110,0.401,12.795,29.260,0.290,0.451
+12.5,0.472,0.112,0.416,12.795,29.236,0.297,0.468
+12.6,0.456,0.113,0.432,12.795,29.213,0.303,0.485
+12.7,0.439,0.114,0.447,12.795,29.190,0.309,0.502
+12.8,0.423,0.115,0.462,12.795,29.167,0.315,0.519
+12.9,0.406,0.116,0.478,12.795,29.144,0.320,0.536
+13,0.390,0.116,0.494,12.795,29.122,0.325,0.554
+13.1,0.374,0.117,0.509,12.795,29.100,0.329,0.571
+13.2,0.358,0.117,0.525,12.795,29.079,0.333,0.588
+13.3,0.343,0.117,0.541,12.795,29.059,0.337,0.606
+13.4,0.327,0.116,0.557,12.795,29.039,0.340,0.623
+13.5,0.312,0.116,0.572,12.795,29.020,0.342,0.639
+13.6,0.297,0.115,0.588,12.795,29.001,0.344,0.656
+13.7,0.283,0.114,0.603,12.795,28.984,0.345,0.672
+13.8,0.269,0.113,0.618,12.795,28.967,0.346,0.688
+13.9,0.255,0.111,0.634,12.795,28.952,0.346,0.704
+14,0.242,0.109,0.648,12.795,28.937,0.345,0.719
+14.1,0.229,0.108,0.663,12.795,28.924,0.344,0.733
+14.2,0.217,0.106,0.677,12.795,28.912,0.342,0.747
+14.3,0.205,0.103,0.692,12.795,28.900,0.340,0.761
+14.4,0.194,0.101,0.705,12.795,28.891,0.337,0.774
+14.5,0.183,0.099,0.719,12.795,28.882,0.333,0.786
+14.6,0.172,0.096,0.732,12.795,28.874,0.329,0.797
+14.7,0.162,0.093,0.745,12.795,28.868,0.325,0.808
+14.8,0.153,0.090,0.757,12.795,28.863,0.320,0.818
+14.9,0.143,0.087,0.769,12.795,28.860,0.314,0.827
+15,0.135,0.084,0.781,12.795,28.857,0.308,0.836
+15.1,0.127,0.081,0.792,12.795,28.856,0.302,0.843
+15.2,0.119,0.078,0.803,12.795,28.856,0.295,0.850
+15.3,0.112,0.075,0.813,12.795,28.857,0.288,0.856
+15.4,0.105,0.072,0.823,12.795,28.859,0.281,0.861
+15.5,0.098,0.069,0.833,12.795,28.863,0.273,0.865
+15.6,0.092,0.066,0.842,12.795,28.867,0.266,0.868
+15.7,0.086,0.063,0.850,12.795,28.873,0.258,0.870
+15.8,0.081,0.060,0.859,12.795,28.879,0.250,0.872
+15.9,0.076,0.058,0.867,12.795,28.887,0.242,0.873
+16,0.071,0.055,0.874,12.795,28.895,0.233,0.873
+16.1,0.066,0.052,0.882,12.795,28.904,0.225,0.872
+16.2,0.062,0.049,0.888,12.795,28.914,0.217,0.870
+16.3,0.058,0.047,0.895,12.795,28.925,0.209,0.867
+16.4,0.055,0.044,0.901,12.795,28.936,0.201,0.864
+16.5,0.051,0.042,0.907,12.795,28.948,0.192,0.860
+16.6,0.048,0.040,0.912,12.795,28.961,0.185,0.856
+16.7,0.045,0.037,0.918,12.795,28.974,0.177,0.850
+16.8,0.042,0.035,0.922,12.795,28.988,0.169,0.844
+16.9,0.040,0.033,0.927,12.795,29.002,0.161,0.838
+17,0.037,0.031,0.931,12.795,29.016,0.154,0.831
+17.1,0.035,0.029,0.936,12.795,29.031,0.147,0.823
+17.2,0.033,0.028,0.939,12.795,29.046,0.140,0.815
+17.3,0.031,0.026,0.943,12.795,29.061,0.133,0.807
+17.4,0.029,0.024,0.946,12.795,29.077,0.126,0.798
+17.5,0.028,0.023,0.950,12.795,29.093,0.120,0.788
+17.6,0.026,0.021,0.953,12.795,29.108,0.114,0.779
+17.7,0.025,0.020,0.955,12.795,29.124,0.108,0.769
+17.8,0.023,0.019,0.958,12.795,29.141,0.102,0.758
+17.9,0.022,0.018,0.960,12.795,29.157,0.097,0.748
+18,0.021,0.017,0.963,12.795,29.173,0.092,0.737
+18.1,0.020,0.015,0.965,12.795,29.189,0.087,0.726
+18.2,0.019,0.014,0.967,12.795,29.205,0.082,0.714
+18.3,0.018,0.014,0.969,12.795,29.221,0.077,0.703
+18.4,0.017,0.013,0.971,12.795,29.237,0.073,0.691
+18.5,0.016,0.012,0.972,12.795,29.253,0.069,0.680
+18.6,0.015,0.011,0.974,12.795,29.268,0.065,0.668
+18.7,0.014,0.010,0.975,12.795,29.284,0.061,0.656
+18.8,0.014,0.010,0.977,12.795,29.299,0.057,0.644
+18.9,0.013,0.009,0.978,12.795,29.315,0.054,0.632
+19,0.012,0.008,0.979,12.795,29.330,0.051,0.620
+19.1,0.012,0.008,0.980,12.795,29.345,0.048,0.609
+19.2,0.011,0.007,0.981,12.795,29.359,0.045,0.597
+19.3,0.011,0.007,0.982,12.795,29.374,0.042,0.585
+19.4,0.010,0.007,0.983,12.795,29.388,0.040,0.573
+19.5,0.010,0.006,0.984,12.795,29.402,0.037,0.562
+19.6,0.010,0.006,0.985,12.795,29.416,0.035,0.550
+19.7,0.009,0.005,0.985,12.795,29.430,0.033,0.538
+19.8,0.009,0.005,0.986,12.795,29.443,0.031,0.527
+19.9,0.009,0.005,0.987,12.795,29.456,0.029,0.516
+20,0.008,0.004,0.987,12.795,29.469,0.027,0.505
+20.1,0.008,0.004,0.988,12.795,29.482,0.026,0.494
+20.2,0.008,0.004,0.989,12.795,29.494,0.024,0.483
+20.3,0.007,0.004,0.989,12.795,29.506,0.023,0.472
+20.4,0.007,0.003,0.990,12.795,29.518,0.021,0.461
+20.5,0.007,0.003,0.990,12.795,29.530,0.020,0.451
+20.6,0.007,0.003,0.990,12.795,29.541,0.019,0.441
+20.7,0.006,0.003,0.991,12.795,29.553,0.018,0.431
+20.8,0.006,0.003,0.991,12.795,29.564,0.017,0.421
+20.9,0.006,0.002,0.991,12.795,29.575,0.016,0.411
+21,0.006,0.002,0.992,12.795,29.585,0.015,0.401
+21.1,0.006,0.002,0.992,12.795,29.595,0.014,0.392
+21.2,0.006,0.002,0.992,12.795,29.605,0.013,0.383
+21.3,0.005,0.002,0.993,12.795,29.615,0.012,0.374
+21.4,0.005,0.002,0.993,12.795,29.625,0.011,0.365
+21.5,0.005,0.002,0.993,12.795,29.634,0.011,0.356
+21.6,0.005,0.002,0.993,12.795,29.644,0.010,0.347
+21.7,0.005,0.002,0.994,12.795,29.653,0.009,0.339
+21.8,0.005,0.001,0.994,12.795,29.661,0.009,0.331
+21.9,0.005,0.001,0.994,12.795,29.670,0.008,0.323
+22,0.004,0.001,0.994,12.795,29.678,0.008,0.315
+22.1,0.004,0.001,0.994,12.795,29.687,0.007,0.307
+22.2,0.004,0.001,0.995,12.795,29.695,0.007,0.299
+22.3,0.004,0.001,0.995,12.795,29.702,0.007,0.292
+22.4,0.004,0.001,0.995,12.795,29.710,0.006,0.285
+22.5,0.004,0.001,0.995,12.795,29.718,0.006,0.278
+22.6,0.004,0.001,0.995,12.795,29.725,0.006,0.271
+22.7,0.004,0.001,0.995,12.795,29.732,0.005,0.264
+22.8,0.004,0.001,0.995,12.795,29.739,0.005,0.257
+22.9,0.004,0.001,0.995,12.795,29.746,0.005,0.251
+23,0.004,0.001,0.996,12.795,29.752,0.004,0.244
+23.1,0.004,0.001,0.996,12.795,29.758,0.004,0.238
+23.2,0.004,0.001,0.996,12.795,29.765,0.004,0.232
+23.3,0.003,0.001,0.996,12.795,29.771,0.004,0.226
+23.4,0.003,0.001,0.996,12.795,29.777,0.004,0.221
+23.5,0.003,0.001,0.996,12.795,29.783,0.003,0.215
+23.6,0.003,0.001,0.996,12.795,29.788,0.003,0.210
+23.7,0.003,0.001,0.996,12.795,29.794,0.003,0.204
+23.8,0.003,0.001,0.996,12.795,29.799,0.003,0.199
+23.9,0.003,0.001,0.996,12.795,29.804,0.003,0.194
+24,0.003,0.000,0.996,12.795,29.809,0.003,0.189
+24.1,0.003,0.000,0.996,12.795,29.814,0.002,0.184
+24.2,0.003,0.000,0.997,12.795,29.819,0.002,0.179
+24.3,0.003,0.000,0.997,12.795,29.824,0.002,0.175
+24.4,0.003,0.000,0.997,12.795,29.829,0.002,0.170
+24.5,0.003,0.000,0.997,12.795,29.833,0.002,0.166
+24.6,0.003,0.000,0.997,12.795,29.838,0.002,0.162
+24.7,0.003,0.000,0.997,12.795,29.842,0.002,0.157
+24.8,0.003,0.000,0.997,12.795,29.846,0.002,0.153
+24.9,0.003,0.000,0.997,12.795,29.850,0.002,0.149
+25,0.003,0.000,0.997,12.795,29.854,0.002,0.145
+25.1,0.003,0.000,0.997,12.795,29.858,0.002,0.142
+25.2,0.003,0.000,0.997,12.795,29.862,0.001,0.138
+25.3,0.003,0.000,0.997,12.795,29.865,0.001,0.134
+25.4,0.003,0.000,0.997,12.795,29.869,0.001,0.131
+25.5,0.003,0.000,0.997,12.795,29.872,0.001,0.128
+25.6,0.003,0.000,0.997,12.795,29.876,0.001,0.124
+25.7,0.003,0.000,0.997,12.795,29.879,0.001,0.121
+25.8,0.003,0.000,0.997,12.795,29.882,0.001,0.118
+25.9,0.003,0.000,0.997,12.795,29.885,0.001,0.115
+26,0.002,0.000,0.997,12.795,29.888,0.001,0.112
+26.1,0.002,0.000,0.997,12.795,29.891,0.001,0.109
+26.2,0.002,0.000,0.997,12.795,29.894,0.001,0.106
+26.3,0.002,0.000,0.997,12.795,29.897,0.001,0.103
+26.4,0.002,0.000,0.997,12.795,29.900,0.001,0.101
+26.5,0.002,0.000,0.997,12.795,29.902,0.001,0.098
+26.6,0.002,0.000,0.997,12.795,29.905,0.001,0.095
+26.7,0.002,0.000,0.997,12.795,29.907,0.001,0.093
+26.8,0.002,0.000,0.997,12.795,29.910,0.001,0.090
+26.9,0.002,0.000,0.998,12.795,29.912,0.001,0.088
+27,0.002,0.000,0.998,12.795,29.915,0.001,0.086
+27.1,0.002,0.000,0.998,12.795,29.917,0.001,0.083
+27.2,0.002,0.000,0.998,12.795,29.919,0.001,0.081
+27.3,0.002,0.000,0.998,12.795,29.921,0.001,0.079
+27.4,0.002,0.000,0.998,12.795,29.923,0.001,0.077
+27.5,0.002,0.000,0.998,12.795,29.925,0.001,0.075
+27.6,0.002,0.000,0.998,12.795,29.927,0.001,0.073
+27.7,0.002,0.000,0.998,12.795,29.929,0.001,0.071
+27.8,0.002,0.000,0.998,12.795,29.931,0.001,0.069
+27.9,0.002,0.000,0.998,12.795,29.933,0.000,0.067
+28,0.002,0.000,0.998,12.795,29.935,0.000,0.066
+28.1,0.002,0.000,0.998,12.795,29.937,0.000,0.064
+28.2,0.002,0.000,0.998,12.795,29.938,0.000,0.062
+28.3,0.002,0.000,0.998,12.795,29.940,0.000,0.061
+28.4,0.002,0.000,0.998,12.795,29.942,0.000,0.059
+28.5,0.002,0.000,0.998,12.795,29.943,0.000,0.057
+28.6,0.002,0.000,0.998,12.795,29.945,0.000,0.056
+28.7,0.002,0.000,0.998,12.795,29.946,0.000,0.054
+28.8,0.002,0.000,0.998,12.795,29.948,0.000,0.053
+28.9,0.002,0.000,0.998,12.795,29.949,0.000,0.052
+29,0.002,0.000,0.998,12.795,29.950,0.000,0.050
+29.1,0.002,0.000,0.998,12.795,29.952,0.000,0.049
+29.2,0.002,0.000,0.998,12.795,29.953,0.000,0.048
+29.3,0.002,0.000,0.998,12.795,29.954,0.000,0.046
+29.4,0.002,0.000,0.998,12.795,29.955,0.000,0.045
+29.5,0.002,0.000,0.998,12.795,29.957,0.000,0.044
+29.6,0.002,0.000,0.998,12.795,29.958,0.000,0.043
+29.7,0.002,0.000,0.998,12.795,29.959,0.000,0.042
+29.8,0.002,0.000,0.998,12.795,29.960,0.000,0.041
+29.9,0.002,0.000,0.998,12.795,29.961,0.000,0.040
+30,0.002,0.000,0.998,12.795,29.962,0.000,0.039
+30.1,0.002,0.000,0.998,12.795,29.963,0.000,0.037
+30.2,0.002,0.000,0.998,12.795,29.964,0.000,0.037
+30.3,0.002,0.000,0.998,12.795,29.965,0.000,0.036
+30.4,0.002,0.000,0.998,12.795,29.966,0.000,0.035
+30.5,0.002,0.000,0.998,12.795,29.967,0.000,0.034
+30.6,0.002,0.000,0.998,12.795,29.968,0.000,0.033
+30.7,0.002,0.000,0.998,12.795,29.969,0.000,0.032
+30.8,0.002,0.000,0.998,12.795,29.970,0.000,0.031
+30.9,0.002,0.000,0.998,12.795,29.971,0.000,0.030
+31,0.002,0.000,0.998,12.795,29.971,0.000,0.029
+31.1,0.002,0.000,0.998,12.795,29.972,0.000,0.029
+31.2,0.002,0.000,0.998,12.795,29.973,0.000,0.028
+31.3,0.002,0.000,0.998,12.795,29.974,0.000,0.027
+31.4,0.002,0.000,0.998,12.795,29.974,0.000,0.026
+31.5,0.002,0.000,0.998,12.795,29.975,0.000,0.026
+31.6,0.002,0.000,0.998,12.795,29.976,0.000,0.025
+31.7,0.002,0.000,0.998,12.795,29.976,0.000,0.024
+31.8,0.002,0.000,0.998,12.795,29.977,0.000,0.024
+31.9,0.002,0.000,0.998,12.795,29.978,0.000,0.023
+32,0.002,0.000,0.998,12.795,29.978,0.000,0.023
+32.1,0.002,0.000,0.998,12.795,29.979,0.000,0.022
+32.2,0.002,0.000,0.998,12.795,29.979,0.000,0.021
+32.3,0.002,0.000,0.998,12.795,29.980,0.000,0.021
+32.4,0.002,0.000,0.998,12.795,29.981,0.000,0.020
+32.5,0.002,0.000,0.998,12.795,29.981,0.000,0.020
+32.6,0.002,0.000,0.998,12.795,29.982,0.000,0.019
+32.7,0.002,0.000,0.998,12.795,29.982,0.000,0.019
+32.8,0.002,0.000,0.998,12.795,29.983,0.000,0.018
+32.9,0.002,0.000,0.998,12.795,29.983,0.000,0.018
+33,0.002,0.000,0.998,12.795,29.984,0.000,0.017
+33.1,0.002,0.000,0.998,12.795,29.984,0.000,0.017
+33.2,0.002,0.000,0.998,12.795,29.985,0.000,0.016
+33.3,0.002,0.000,0.998,12.795,29.985,0.000,0.016
+33.4,0.002,0.000,0.998,12.795,29.985,0.000,0.015
+33.5,0.002,0.000,0.998,12.795,29.986,0.000,0.015
+33.6,0.002,0.000,0.998,12.795,29.986,0.000,0.015
+33.7,0.002,0.000,0.998,12.795,29.987,0.000,0.014
+33.8,0.002,0.000,0.998,12.795,29.987,0.000,0.014
+33.9,0.002,0.000,0.998,12.795,29.987,0.000,0.014
+34,0.002,0.000,0.998,12.795,29.988,0.000,0.013
+34.1,0.002,0.000,0.998,12.795,29.988,0.000,0.013
+34.2,0.002,0.000,0.998,12.795,29.988,0.000,0.012
+34.3,0.002,0.000,0.998,12.795,29.989,0.000,0.012
+34.4,0.002,0.000,0.998,12.795,29.989,0.000,0.012
+34.5,0.002,0.000,0.998,12.795,29.989,0.000,0.012
+34.6,0.002,0.000,0.998,12.795,29.990,0.000,0.011
+34.7,0.002,0.000,0.998,12.795,29.990,0.000,0.011
+34.8,0.002,0.000,0.998,12.795,29.990,0.000,0.011
+34.9,0.002,0.000,0.998,12.795,29.991,0.000,0.010
+35,0.002,0.000,0.998,12.795,29.991,0.000,0.010
+35.1,0.002,0.000,0.998,12.795,29.991,0.000,0.010
+35.2,0.002,0.000,0.998,12.795,29.991,0.000,0.010
+35.3,0.002,0.000,0.998,12.795,29.992,0.000,0.009
+35.4,0.002,0.000,0.998,12.795,29.992,0.000,0.009
+35.5,0.002,0.000,0.998,12.795,29.992,0.000,0.009
+35.6,0.002,0.000,0.998,12.795,29.992,0.000,0.009
+35.7,0.002,0.000,0.998,12.795,29.993,0.000,0.008
+35.8,0.002,0.000,0.998,12.795,29.993,0.000,0.008
+35.9,0.002,0.000,0.998,12.795,29.993,0.000,0.008
+36,0.002,0.000,0.998,12.795,29.993,0.000,0.008
+36.1,0.002,0.000,0.998,12.795,29.993,0.000,0.008
+36.2,0.002,0.000,0.998,12.795,29.994,0.000,0.007
+36.3,0.002,0.000,0.998,12.795,29.994,0.000,0.007
+36.4,0.002,0.000,0.998,12.795,29.994,0.000,0.007
+36.5,0.002,0.000,0.998,12.795,29.994,0.000,0.007
+36.6,0.002,0.000,0.998,12.795,29.994,0.000,0.007
+36.7,0.002,0.000,0.998,12.795,29.995,0.000,0.006
+36.8,0.002,0.000,0.998,12.795,29.995,0.000,0.006
+36.9,0.002,0.000,0.998,12.795,29.995,0.000,0.006
+37,0.002,0.000,0.998,12.795,29.995,0.000,0.006
+37.1,0.002,0.000,0.998,12.795,29.995,0.000,0.006
+37.2,0.002,0.000,0.998,12.795,29.995,0.000,0.006
+37.3,0.002,0.000,0.998,12.795,29.996,0.000,0.005
+37.4,0.002,0.000,0.998,12.795,29.996,0.000,0.005
+37.5,0.002,0.000,0.998,12.795,29.996,0.000,0.005
+37.6,0.002,0.000,0.998,12.795,29.996,0.000,0.005
+37.7,0.002,0.000,0.998,12.795,29.996,0.000,0.005
+37.8,0.002,0.000,0.998,12.795,29.996,0.000,0.005
+37.9,0.002,0.000,0.998,12.795,29.996,0.000,0.005
+38,0.002,0.000,0.998,12.795,29.996,0.000,0.005
+38.1,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+38.2,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+38.3,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+38.4,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+38.5,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+38.6,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+38.7,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+38.8,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+38.9,0.002,0.000,0.998,12.795,29.997,0.000,0.004
+39,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.1,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.2,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.3,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.4,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.5,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.6,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.7,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.8,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+39.9,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+40,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+40.1,0.002,0.000,0.998,12.795,29.998,0.000,0.003
+40.2,0.002,0.000,0.998,12.795,29.998,0.000,0.002
+40.3,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+40.4,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+40.5,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+40.6,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+40.7,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+40.8,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+40.9,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.1,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.2,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.3,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.4,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.5,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.6,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.7,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.8,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+41.9,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+42,0.002,0.000,0.998,12.795,29.999,0.000,0.002
+42.1,0.002,0.000,0.998,12.795,29.999,0.000,0.001
+42.2,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+42.3,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+42.4,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+42.5,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+42.6,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+42.7,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+42.8,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+42.9,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.1,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.2,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.3,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.4,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.5,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.6,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.7,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.8,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+43.9,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.1,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.2,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.3,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.4,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.5,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.6,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.7,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.8,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+44.9,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.1,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.2,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.3,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.4,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.5,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.6,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.7,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.8,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+45.9,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+46,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+46.1,0.002,0.000,0.998,12.795,30.000,0.000,0.001
+46.2,0.002,0.000,0.998,12.795,30.000,0.000,0.000
+46.3,0.002,0.000,0.998,12.795,30.000,0.000,0.000
+46.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+46.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+46.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+46.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+46.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+46.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+47.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+48.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+49.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+50.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+51.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+52.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+53.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+54.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+55.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+56.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+57.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+58.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+59.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+60.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+61.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+62.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+63.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+64.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+65.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+66.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+67.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+68.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+69.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+70.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+71.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+72.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+73.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+74.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+75.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+76.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+77.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+78.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+79.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+80.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+81.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+82.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+83.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+84.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+85.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+86.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+87.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+88.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+89.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+90.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+91.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+92.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+93.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+94.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+95.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+96.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+97.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+98.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.1,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.2,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.3,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.4,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.5,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.6,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.7,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.8,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+99.9,0.002,0.000,0.998,12.795,30.001,0.000,0.000
+100,0.002,0.000,0.998,12.795,30.001,0.000,0.000
diff --git a/Build/source/utils/asymptote/doc/shadedtiling.asy b/Build/source/utils/asymptote/doc/shadedtiling.asy
new file mode 100644
index 00000000000..4d3b8ae894b
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/shadedtiling.asy
@@ -0,0 +1,12 @@
+size(0,100);
+import patterns;
+
+real d=4mm;
+picture tiling;
+path square=scale(d)*unitsquare;
+axialshade(tiling,square,white,(0,0),black,(d,d));
+fill(tiling,shift(d,d)*square,blue);
+add("shadedtiling",tiling);
+
+filldraw(unitcircle,pattern("shadedtiling"));
+
diff --git a/Build/source/utils/asymptote/doc/slopefield1.asy b/Build/source/utils/asymptote/doc/slopefield1.asy
new file mode 100644
index 00000000000..fd60de4f632
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/slopefield1.asy
@@ -0,0 +1,9 @@
+import slopefield;
+
+size(200);
+
+real func(real x) {return 2x;}
+add(slopefield(func,(-3,-3),(3,3),20,Arrow));
+draw(curve((0,0),func,(-3,-3),(3,3)),red);
+
+
diff --git a/Build/source/utils/asymptote/doc/square.asy b/Build/source/utils/asymptote/doc/square.asy
new file mode 100644
index 00000000000..6fd9d2314d7
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/square.asy
@@ -0,0 +1,2 @@
+size(3cm);
+draw((0,0)--(1,0)--(1,1)--(0,1)--cycle);
diff --git a/Build/source/utils/asymptote/doc/subpictures.asy b/Build/source/utils/asymptote/doc/subpictures.asy
new file mode 100644
index 00000000000..1ace23f5678
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/subpictures.asy
@@ -0,0 +1,20 @@
+picture pic1;
+real size=50;
+size(pic1,size);
+fill(pic1,(0,0)--(50,100)--(100,0)--cycle,red);
+
+picture pic2;
+size(pic2,size);
+fill(pic2,unitcircle,green);
+
+picture pic3;
+size(pic3,size);
+fill(pic3,unitsquare,blue);
+
+picture pic;
+add(pic,pic1.fit(),(0,0),N);
+add(pic,pic2.fit(),(0,0),10S);
+
+add(pic.fit(),(0,0),N);
+add(pic3.fit(),(0,0),10S);
+
diff --git a/Build/source/utils/asymptote/doc/superpath.asy b/Build/source/utils/asymptote/doc/superpath.asy
new file mode 100644
index 00000000000..ec2787a9ce0
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/superpath.asy
@@ -0,0 +1,5 @@
+size(0,100);
+path unitcircle=E..N..W..S..cycle;
+path g=scale(2)*unitcircle;
+filldraw(unitcircle^^g,evenodd+yellow,black);
+
diff --git a/Build/source/utils/asymptote/doc/tile.asy b/Build/source/utils/asymptote/doc/tile.asy
new file mode 100644
index 00000000000..fe9cbc523c7
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/tile.asy
@@ -0,0 +1,13 @@
+size(0,90);
+import patterns;
+
+add("tile",tile());
+add("filledtilewithmargin",tile(6mm,4mm,red,Fill),(1mm,1mm),(1mm,1mm));
+add("checker",checker());
+add("brick",brick());
+
+real s=2.5;
+filldraw(unitcircle,pattern("tile"));
+filldraw(shift(s,0)*unitcircle,pattern("filledtilewithmargin"));
+filldraw(shift(2s,0)*unitcircle,pattern("checker"));
+filldraw(shift(3s,0)*unitcircle,pattern("brick"));
diff --git a/Build/source/utils/asymptote/doc/triangulate.asy b/Build/source/utils/asymptote/doc/triangulate.asy
new file mode 100644
index 00000000000..56ad347b53d
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/triangulate.asy
@@ -0,0 +1,19 @@
+size(200);
+int np=100;
+pair[] points;
+
+real r() {return 1.2*(rand()/randMax*2-1);}
+
+for(int i=0; i < np; ++i)
+ points.push((r(),r()));
+
+int[][] trn=triangulate(points);
+
+for(int i=0; i < trn.length; ++i) {
+ draw(points[trn[i][0]]--points[trn[i][1]]);
+ draw(points[trn[i][1]]--points[trn[i][2]]);
+ draw(points[trn[i][2]]--points[trn[i][0]]);
+}
+
+for(int i=0; i < np; ++i)
+ dot(points[i],red);
diff --git a/Build/source/utils/asymptote/doc/unitcircle3.asy b/Build/source/utils/asymptote/doc/unitcircle3.asy
new file mode 100644
index 00000000000..be282011dca
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/unitcircle3.asy
@@ -0,0 +1,9 @@
+import three;
+
+size(100);
+
+path3 g=(1,0,0)..(0,1,0)..(-1,0,0)..(0,-1,0)..cycle;
+draw(g);
+draw(O--Z,red+dashed,Arrow3);
+draw(((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle));
+dot(g,red);
diff --git a/Build/source/utils/asymptote/doc/vectorfield.asy b/Build/source/utils/asymptote/doc/vectorfield.asy
new file mode 100644
index 00000000000..12de66e49c5
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/vectorfield.asy
@@ -0,0 +1,9 @@
+import graph;
+size(100);
+
+pair a=(0,0);
+pair b=(2pi,2pi);
+
+path vector(pair z) {return (0,0)--(sin(z.x),cos(z.y));}
+
+add(vectorfield(vector,a,b));
diff --git a/Build/source/utils/asymptote/doc/westnile.asy b/Build/source/utils/asymptote/doc/westnile.asy
new file mode 100644
index 00000000000..222bb38e05e
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/westnile.asy
@@ -0,0 +1,64 @@
+import graph;
+
+size(9cm,8cm,IgnoreAspect);
+string data="westnile.csv";
+
+file in=input(data).line().csv();
+
+string[] columnlabel=in;
+
+real[][] A=in;
+A=transpose(A);
+real[] number=A[0], survival=A[1];
+
+path g=graph(number,survival);
+draw(g);
+
+scale(true);
+
+xaxis("Initial no.\ of mosquitoes per bird ($S_{M_0}/N_{B_0}$)",
+ Bottom,LeftTicks);
+xaxis(Top);
+yaxis("Susceptible bird survival",Left,RightTicks(trailingzero));
+yaxis(Right);
+
+real a=number[0];
+real b=number[number.length-1];
+
+real S1=0.475;
+path h1=(a,S1)--(b,S1);
+real M1=interp(a,b,intersect(h1,g)[0]);
+
+real S2=0.9;
+path h2=(a,S2)--(b,S2);
+real M2=interp(a,b,intersect(h2,g)[0]);
+
+labelx("$M_1$",M1);
+labelx("$M_2$",M2);
+
+draw((a,S2)--(M2,S2)--(M2,0),Dotted);
+draw((a,S1)--(M1,S1)--(M1,0),dashed);
+
+pen p=fontsize(10pt);
+
+real y3=0.043;
+path reduction=(M1,y3)--(M2,y3);
+draw(reduction,Arrow,TrueMargin(0,0.5*(linewidth(Dotted)+linewidth())));
+
+arrow(shift(-20,5)*Label(minipage("\flushleft{\begin{itemize}\item[1.]
+Estimate proportion of birds surviving at end of season\end{itemize}}",100),
+ align=NNE),
+ (M1,S1),NNE,1cm,p,Arrow(NoFill));
+
+arrow(shift(-24,5)*Label(minipage("\flushleft{\begin{itemize}\item[2.]
+Read off initial mosquito abundance\end{itemize}}",80),align=NNE),
+ (M1,0),NE,2cm,p,Arrow(NoFill));
+
+arrow(shift(20,0)*Label(minipage("\flushleft{\begin{itemize}\item[3.]
+Determine desired bird survival for next season\end{itemize}}",90),align=SW),
+ (M2,S2),SW,arrowlength,p,Arrow(NoFill));
+
+arrow(shift(8,-15)*Label(minipage("\flushleft{\begin{itemize}\item[4.]
+Calculate required proportional reduction in mosquitoes\end{itemize}}",90),
+ align=NW),
+ point(reduction,0.5),NW,1.5cm,p,Arrow(NoFill));
diff --git a/Build/source/utils/asymptote/doc/westnile.csv b/Build/source/utils/asymptote/doc/westnile.csv
new file mode 100644
index 00000000000..cfc8493ed22
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/westnile.csv
@@ -0,0 +1,402 @@
+sm0,0.001(T14)
+0.0,0.9973
+0.1,0.9973
+0.2,0.9972
+0.3,0.9972
+0.4,0.9971
+0.5,0.9971
+0.6,0.9970
+0.7,0.9970
+0.8,0.9969
+0.9,0.9968
+1.0,0.9968
+1.1,0.9967
+1.2,0.9966
+1.3,0.9966
+1.4,0.9965
+1.5,0.9964
+1.6,0.9963
+1.7,0.9963
+1.8,0.9962
+1.9,0.9961
+2.0,0.9960
+2.1,0.9959
+2.2,0.9958
+2.3,0.9957
+2.4,0.9957
+2.5,0.9956
+2.6,0.9955
+2.7,0.9954
+2.8,0.9952
+2.9,0.9951
+3.0,0.9950
+3.1,0.9949
+3.2,0.9948
+3.3,0.9947
+3.4,0.9945
+3.5,0.9944
+3.6,0.9943
+3.7,0.9941
+3.8,0.9940
+3.9,0.9939
+4.0,0.9937
+4.1,0.9936
+4.2,0.9934
+4.3,0.9932
+4.4,0.9931
+4.5,0.9929
+4.6,0.9927
+4.7,0.9926
+4.8,0.9924
+4.9,0.9922
+5.0,0.9920
+5.1,0.9918
+5.2,0.9916
+5.3,0.9914
+5.4,0.9912
+5.5,0.9909
+5.6,0.9907
+5.7,0.9905
+5.8,0.9902
+5.9,0.9900
+6.0,0.9897
+6.1,0.9895
+6.2,0.9892
+6.3,0.9889
+6.4,0.9887
+6.5,0.9884
+6.6,0.9881
+6.7,0.9878
+6.8,0.9875
+6.9,0.9872
+7.0,0.9868
+7.1,0.9865
+7.2,0.9861
+7.3,0.9858
+7.4,0.9854
+7.5,0.9851
+7.6,0.9847
+7.7,0.9843
+7.8,0.9839
+7.9,0.9835
+8.0,0.9831
+8.1,0.9826
+8.2,0.9822
+8.3,0.9818
+8.4,0.9813
+8.5,0.9808
+8.6,0.9803
+8.7,0.9798
+8.8,0.9793
+8.9,0.9788
+9.0,0.9783
+9.1,0.9777
+9.2,0.9772
+9.3,0.9766
+9.4,0.9760
+9.5,0.9754
+9.6,0.9748
+9.7,0.9742
+9.8,0.9735
+9.9,0.9729
+10.0,0.9722
+10.1,0.9715
+10.2,0.9708
+10.3,0.9701
+10.4,0.9694
+10.5,0.9686
+10.6,0.9679
+10.7,0.9671
+10.8,0.9663
+10.9,0.9654
+11.0,0.9646
+11.1,0.9637
+11.2,0.9629
+11.3,0.9620
+11.4,0.9611
+11.5,0.9601
+11.6,0.9592
+11.7,0.9582
+11.8,0.9572
+11.9,0.9562
+12.0,0.9551
+12.1,0.9541
+12.2,0.9530
+12.3,0.9519
+12.4,0.9507
+12.5,0.9496
+12.6,0.9484
+12.7,0.9472
+12.8,0.9460
+12.9,0.9447
+13.0,0.9434
+13.1,0.9421
+13.2,0.9408
+13.3,0.9394
+13.4,0.9380
+13.5,0.9366
+13.6,0.9352
+13.7,0.9337
+13.8,0.9322
+13.9,0.9307
+14.0,0.9291
+14.1,0.9275
+14.2,0.9259
+14.3,0.9243
+14.4,0.9226
+14.5,0.9209
+14.6,0.9191
+14.7,0.9174
+14.8,0.9156
+14.9,0.9137
+15.0,0.9118
+15.1,0.9099
+15.2,0.9080
+15.3,0.9060
+15.4,0.9041
+15.5,0.9020
+15.6,0.8999
+15.7,0.8978
+15.8,0.8956
+15.9,0.8934
+16.0,0.8912
+16.1,0.8889
+16.2,0.8866
+16.3,0.8843
+16.4,0.8819
+16.5,0.8795
+16.6,0.8770
+16.7,0.8745
+16.8,0.8720
+16.9,0.8694
+17.0,0.8668
+17.1,0.8641
+17.2,0.8614
+17.3,0.8587
+17.4,0.8559
+17.5,0.8531
+17.6,0.8502
+17.7,0.8473
+17.8,0.8444
+17.9,0.8414
+18.0,0.8383
+18.1,0.8353
+18.2,0.8323
+18.3,0.8291
+18.4,0.8259
+18.5,0.8227
+18.6,0.8194
+18.7,0.8160
+18.8,0.8127
+18.9,0.8092
+19.0,0.8058
+19.1,0.8022
+19.2,0.7987
+19.3,0.7951
+19.4,0.7914
+19.5,0.7878
+19.6,0.7840
+19.7,0.7803
+19.8,0.7764
+19.9,0.7726
+20.0,0.7687
+20.1,0.7647
+20.2,0.7607
+20.3,0.7567
+20.4,0.7526
+20.5,0.7485
+20.6,0.7443
+20.7,0.7401
+20.8,0.7359
+20.9,0.7316
+21.0,0.7272
+21.1,0.7229
+21.2,0.7185
+21.3,0.7140
+21.4,0.7096
+21.5,0.7050
+21.6,0.7005
+21.7,0.6959
+21.8,0.6912
+21.9,0.6866
+22.0,0.6819
+22.1,0.6771
+22.2,0.6723
+22.3,0.6675
+22.4,0.6627
+22.5,0.6578
+22.6,0.6530
+22.7,0.6480
+22.8,0.6430
+22.9,0.6380
+23.0,0.6330
+23.1,0.6280
+23.2,0.6229
+23.3,0.6178
+23.4,0.6126
+23.5,0.6075
+23.6,0.6023
+23.7,0.5971
+23.8,0.5918
+23.9,0.5866
+24.0,0.5813
+24.1,0.5760
+24.2,0.5706
+24.3,0.5653
+24.4,0.5600
+24.5,0.5547
+24.6,0.5493
+24.7,0.5440
+24.8,0.5385
+24.9,0.5332
+25.0,0.5278
+25.1,0.5224
+25.2,0.5170
+25.3,0.5115
+25.4,0.5061
+25.5,0.5007
+25.6,0.4952
+25.7,0.4898
+25.8,0.4844
+25.9,0.4789
+26.0,0.4735
+26.1,0.4681
+26.2,0.4627
+26.3,0.4572
+26.4,0.4518
+26.5,0.4464
+26.6,0.4410
+26.7,0.4356
+26.8,0.4303
+26.9,0.4249
+27.0,0.4194
+27.1,0.4143
+27.2,0.4089
+27.3,0.4036
+27.4,0.3983
+27.5,0.3931
+27.6,0.3878
+27.7,0.3826
+27.8,0.3774
+27.9,0.3724
+28.0,0.3672
+28.1,0.3621
+28.2,0.3571
+28.3,0.3520
+28.4,0.3470
+28.5,0.3420
+28.6,0.3370
+28.7,0.3320
+28.8,0.3271
+28.9,0.3223
+29.0,0.3174
+29.1,0.3126
+29.2,0.3078
+29.3,0.3031
+29.4,0.2983
+29.5,0.2936
+29.6,0.2890
+29.7,0.2845
+29.8,0.2801
+29.9,0.2756
+30.0,0.2711
+30.1,0.2667
+30.2,0.2623
+30.3,0.2580
+30.4,0.2537
+30.5,0.2495
+30.6,0.2453
+30.7,0.2411
+30.8,0.2370
+30.9,0.2329
+31.0,0.2289
+31.1,0.2250
+31.2,0.2210
+31.3,0.2171
+31.4,0.2133
+31.5,0.2095
+31.6,0.2057
+31.7,0.2019
+31.8,0.1983
+31.9,0.1947
+32.0,0.1912
+32.1,0.1876
+32.2,0.1842
+32.3,0.1807
+32.4,0.1773
+32.5,0.1740
+32.6,0.1707
+32.7,0.1674
+32.8,0.1642
+32.9,0.1611
+33.0,0.1580
+33.1,0.1549
+33.2,0.1520
+33.3,0.1490
+33.4,0.1461
+33.5,0.1432
+33.6,0.1404
+33.7,0.1376
+33.8,0.1348
+33.9,0.1321
+34.0,0.1294
+34.1,0.1268
+34.2,0.1242
+34.3,0.1217
+34.4,0.1193
+34.5,0.1168
+34.6,0.1144
+34.7,0.1120
+34.8,0.1097
+34.9,0.1074
+35.0,0.1052
+35.1,0.1029
+35.2,0.1008
+35.3,0.0987
+35.4,0.0966
+35.5,0.0946
+35.6,0.0925
+35.7,0.0905
+35.8,0.0886
+35.9,0.0867
+36.0,0.0848
+36.1,0.0830
+36.2,0.0812
+36.3,0.0794
+36.4,0.0777
+36.5,0.0760
+36.6,0.0743
+36.7,0.0727
+36.8,0.0711
+36.9,0.0696
+37.0,0.0680
+37.1,0.0665
+37.2,0.0651
+37.3,0.0636
+37.4,0.0622
+37.5,0.0608
+37.6,0.0595
+37.7,0.0581
+37.8,0.0568
+37.9,0.0555
+38.0,0.0543
+38.1,0.0531
+38.2,0.0519
+38.3,0.0507
+38.4,0.0495
+38.5,0.0484
+38.6,0.0473
+38.7,0.0462
+38.8,0.0452
+38.9,0.0441
+39.0,0.0431
+39.1,0.0421
+39.2,0.0412
+39.3,0.0402
+39.4,0.0393
+39.5,0.0384
+39.6,0.0375
+39.7,0.0366
+39.8,0.0358
+39.9,0.0350
+40.0,0.0342
diff --git a/Build/source/utils/asymptote/doc/xasy.1x b/Build/source/utils/asymptote/doc/xasy.1x
new file mode 100644
index 00000000000..e882db25212
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/xasy.1x
@@ -0,0 +1,27 @@
+.\" Hey, EMACS: -*- nroff -*-
+.TH XASY 1x "27 Nov 2007"
+.SH NAME
+asy \- script-based vector graphics language
+.SH SYNOPSIS
+.B xasy
+.RI " [-x magnification] [filename]"
+.SH DESCRIPTION
+\fBAsymptote\fP is a powerful descriptive vector graphics language for
+technical drawing, inspired by MetaPost but with an improved C++\-like syntax.
+Asymptote provides for figures the same high\-quality level of typesetting that
+LaTeX does for scientific text.
+.PP
+\fBxasy\fP is a GUI for Asymptote that allows for final figure adjustments.
+
+.SH OPTIONS
+.TP
+.B \-x magnification
+Initial zoom.
+
+.SH SEE ALSO
+Asymptote and xasy are documented fully in the Asymptote Info page.
+.SH AUTHOR
+Asymptote was written by Andy Hammerlindl, John Bowman, and Tom Prince.
+.PP
+This manual page was written by Hubert Chan for the Debian project (but may
+be used by others).