diff options
Diffstat (limited to 'Build/source/utils/asymptote/doc/asymptote.texi')
-rw-r--r-- | Build/source/utils/asymptote/doc/asymptote.texi | 98 |
1 files changed, 62 insertions, 36 deletions
diff --git a/Build/source/utils/asymptote/doc/asymptote.texi b/Build/source/utils/asymptote/doc/asymptote.texi index ff038453b10..9fabe5d813d 100644 --- a/Build/source/utils/asymptote/doc/asymptote.texi +++ b/Build/source/utils/asymptote/doc/asymptote.texi @@ -9,7 +9,7 @@ This file documents @code{Asymptote}, version @value{VERSION}. @url{http://asymptote.sourceforge.net} -Copyright @copyright{} 2004-13 Andy Hammerlindl, John Bowman, and Tom Prince. +Copyright @copyright{} 2004-14 Andy Hammerlindl, John Bowman, and Tom Prince. @quotation Permission is granted to copy, distribute and/or modify this document @@ -89,7 +89,7 @@ Drawing commands Programming * Data types:: void, bool, int, real, pair, triple, string -* Paths and guides:: +* 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 @@ -289,7 +289,7 @@ We recommend subscribing to new release announcements at @noindent Users may also wish to monitor the @code{Asymptote} forum: @quotation -@url{http://sourceforge.net/projects/asymptote/forums/forum/409349} +@url{http://sourceforge.net/p/asymptote/discussion/409349} @end quotation @noindent @@ -491,6 +491,7 @@ configuration variables @code{paperwidth} and @code{paperheight}. @cindex @code{texcommand} @cindex @code{dvips} @cindex @code{dvisvgm} +@cindex @code{libgs} @cindex @code{convert} @cindex @code{display} @cindex @code{animate} @@ -501,6 +502,7 @@ texpath texcommand dvips dvisvgm +libgs convert display animate @@ -584,7 +586,8 @@ 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{http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2d.tar.gz} +@url{http://hboehm.info/gc/gc_source/gc-7.4.0.tar.gz} +@url{http://hboehm.info/gc/gc_source/libatomic_ops-7.4.0.tar.gz} in the @code{Asymptote} source directory. On @code{UNIX} platforms (other than @code{MacOS X}), we recommend @@ -739,7 +742,7 @@ can be enabled by running @code{asy-kate.sh} in the The following commands are needed to install the latest development version of @code{Asymptote} using @code{Subversion}: @verbatim -svn co http://asymptote.svn.sourceforge.net/svnroot/asymptote/trunk/asymptote +svn co http://svn.code.sf.net/p/asymptote/code/trunk/asymptote cd asymptote ./autogen.sh ./configure @@ -974,10 +977,11 @@ external links posted at @url{http://asymptote.sourceforge.net}) 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}. -A user-written @code{Asymptote} tutorial is available at -@verbatim -http://www.artofproblemsolving.com/Wiki/index.php/Asymptote:_Basics -@end verbatim +Excellent user-written @code{Asymptote} tutorials are also available: + +@url{http://www.artofproblemsolving.com/Wiki/index.php/Asymptote:_Basics} + +@url{http://math.uchicago.edu/~cstaats/Charles_Staats_III/Notes_and_papers_files/asymptote_tutorial.pdf} @node Drawing commands @chapter Drawing commands @@ -1329,7 +1333,7 @@ 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, +void tensorshade(picture pic=currentpicture, path[] g, bool stroke=false, pen fillrule=currentpen, pen[][] p, path[] b=g, pair[][] z=new pair[][]); @end verbatim @@ -1737,7 +1741,7 @@ In addition, it supports many features beyond the ones found in those languages. @menu * Data types:: void, bool, int, real, pair, triple, string -* Paths and guides:: +* 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 @@ -2283,6 +2287,12 @@ path ellipse(pair c, real a, real b) } @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 @@ -2565,6 +2575,16 @@ otherwise. returns an arbitrary point strictly inside a cyclic path @code{p} according to the fill rule @code{fillrule} (@pxref{fillrule}). +@cindex @code{side} +@item real side(pair a, pair b, pair c); +determines the side of @code{a--b} that c lies on (negative=left, +zero=on @code{a--b}, positive=right). + +@cindex @code{incircle} +@item real incircle(pair a, pair b, pair c, pair d); +determines the side of the counterclockwise circle through @code{a,b,c} that +@code{d} lies on (negative=inside, 0=on circle, positive=right). + @cindex @code{strokepath} @item path[] strokepath(path g, pen p=currentpen); returns the path array that @code{PostScript} would fill in drawing path @@ -4023,7 +4043,7 @@ struct T { int x; } -T foo=new T; +T foo; T bar=foo; bar.x=5; @end verbatim @@ -4044,7 +4064,7 @@ struct T { ++Tcount; } -T foo=new T; +T foo; @end verbatim Here, the expression @code{new T} will produce a new instance of the class, but @@ -4111,7 +4131,7 @@ struct Person { string lastname; } -Person joe=new Person; +Person joe; joe.firstname="Joe"; joe.lastname="Jones"; @end verbatim @@ -4128,7 +4148,7 @@ struct Person { string lastname; static Person Person(string firstname, string lastname) { - Person p=new Person; + Person p; p.firstname=firstname; p.lastname=lastname; return p; @@ -4164,7 +4184,7 @@ structure is called @code{Foo}): @example static Foo Foo(@var{args}) @{ - Foo instance=new Foo; + Foo instance; instance.operator init(@var{args}); return instance; @} @@ -5441,7 +5461,7 @@ 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 +reading will stop once the end of the line is reached instead: @verbatim file fin=input("test.txt"); real[] A=fin.line(); @@ -6468,7 +6488,6 @@ This module provides an interface to the @code{LaTeX} package @end quotation @noindent for embedding movies, sounds, and 3D objects into a @acronym{PDF} document. -Version 0.13 (2012/09/12) of @code{media9} or later is required. @cindex @code{external} A more portable method for embedding movie files, which should work on any @@ -7861,7 +7880,7 @@ 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 -@code{three.asy} (or @code{graph3.asy}) is imported. +@code{three.asy} (or @code{graph3.asy}) is imported. The @code{media9} LaTeX package is also required (@pxref{embed}). The example @code{pdb.asy} illustrates how one can generate a list of predefined views (see @code{100d.views}). @@ -7872,6 +7891,8 @@ 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 open-source @acronym{PRC} specification is available from @url{http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/API_References/PRCReference/PRC_Format_Specification/}. @@ -8288,7 +8309,7 @@ real[][] intersections(path3 p, surface s, real fuzz=-1); @end verbatim @noindent returns the intersection times of a path @code{p} with a surface -@code{s} as a sorted array of real arrays of length 2, and +@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); @@ -9008,13 +9029,13 @@ variables may also be changed at runtime. @cindex @code{gsOptions} @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{psviewerOptions}, @code{pdfviewerOptions}, and @code{glOptions} -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}. +@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 @@ -9039,16 +9060,17 @@ at the beginning of the configuration file, it can contain arbitrary @cindex @code{context} @cindex @code{EPS} @cindex @code{PDF} -@cindex @code{SVG} @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}, and @code{context} tex engines. Alternative output formats may be produced using the @code{-f} option -(or @code{outformat} setting). To produce @acronym{SVG} output, -first install @code{dvisvgm} (version 0.8.7 or later) from -@url{http://dvisvgm.sourceforge.net/down.html} and be sure to use the -@code{latex} or @code{tex} tex engine. +(or @code{outformat} setting). + +@cindex @code{SVG} +@cindex @code{dvisvgm} +@cindex @code{libgs} +To produce @acronym{SVG} output, you will need @code{dvisvgm} (version 0.8.7 or later) from @url{http://dvisvgm.sourceforge.net} and must use the @code{latex} or @code{tex} tex engine. You might need to adjust the configuration variable @code{libgs} to point to the location of your ghostscript library @code{libgs.so} (or to an empty string, depending on how @code{dvisvgm} was configured). @code{Asymptote} can also produce any output format supported by the @code{ImageMagick} @code{convert} program (version 6.3.5 or @@ -9358,7 +9380,7 @@ 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{http://sourceforge.net/projects/asymptote/forums/forum/409349} +@url{http://sourceforge.net/p/asymptote/discussion/409349} @end quotation @noindent Including an example that illustrates what you are trying to do will help @@ -9700,16 +9722,20 @@ Mark Henning, Steve Melenchuk, Martin Wiebusch, and Stefan Knorr. @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 -@c LocalWords: zscale3 scale3 join3 BeginBar3 EndBar3 Bar3 Bars3 +@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: 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 +@c LocalWords: EndDotMargin3 DotMargin3 DotMargins3 TrueMargin3 3D @c LocalWords: yaxis3 zaxis3 ticks3 NoTicks3 arrowbar3 type2 axis3 -@c LocalWords: generalaxis3 vectorfield3 margin3 grid3xyz 5unit -@c LocalWords: slopefield1 144x144 +@c LocalWords: generalaxis3 vectorfield3 margin3 grid3xyz 5unit 2D +@c LocalWords: slopefield1 144x144 1filll 'load 'asy 'lasy 'auto 4g +@c LocalWords: 5bp 1cm 2S 100pt 3t bracedefaultratio incircle 12pt +@c LocalWords: 5mm 25cm 3x 5x 3y 602e 2x 2y 3sin 10cm 204e 10x Ai +@c LocalWords: Ai Ai Ai Ai Ai Ai Ai 5E 5cm 2N 2E 2n 100d 5z 5y +@c LocalWords: 5unit 144x144 |