Asymptote (vector graphics language)
Paradigm | imperative, typesetting |
---|---|
Designed by | Andy Hammerlindl, John C. Bowman, Tom Prince |
First appeared | 2004 |
Stable release | 2.89[1]
/ 25 March 2024 |
Cross-platform | |
License | LGPL |
Website | asymptote |
Influenced by | |
MetaPost |
Asymptote is a descriptive
Syntax and notable features
Asymptote typesets labels and equations with
Asymptote fully generalizes MetaPost path construction algorithms to three dimensions,[3] and compiles commands into virtual machine code for speed without sacrificing portability. High-level graphics commands are implemented in the Asymptote language itself, allowing them to be easily tailored to specific applications. It also appears to be the first software package to lift TeX into three dimensions.[4][5] This allows Asymptote to be used as a
Asymptote is also notable for having a graphical interface coded in Python (and the Tk widget set), xasy.py – this allows an inexperienced user to quickly draw up objects and save them as .asy source code which can then be examined or edited by hand.
The program's syntax was originally described by using a Yacc compatible grammar.
Application examples
The following source code allows you to draw a graph of the
import graph;
import settings;
outformat="pdf";
size(300,300);
// Function.
real[] x1 = {-1.5,0};
real[] y1 = {0,0};
real[] x2 = {0,1.5};
real[] y2 = {1,1};
draw(graph(x1,y1),red+2);
draw(graph(x2,y2),red+2);
draw((0,0)--(0,1),red+1.5+linetype("4 4"));
fill( circle((0,1),0.035), red);
filldraw( circle((0,0),0.03), white, red+1.5);
// Axes.
xaxis( Label("$x$"), Ticks(new real[]{-1,-0.5,0.5,1}), Arrow);
yaxis( Label("$y$"), Ticks(new real[]{0.5,1}), Arrow, ymin=-0.18, ymax=1.25);
// Origin.
labelx("$O$",0,SW);
The code above yields the following pdf output.
See also
References
- ^ "Release 2.89". 25 March 2024. Retrieved 19 April 2024.
- ^ Asymptote: A vector graphics language, J. C. Bowman and A. Hammerlindl, TUGBOAT: The Communications of the TeX Users Group, 29:2, 288-294 (2008).
- ^ The 3D Asymptote Generalization of MetaPost Bézier Interpolation, J. C. Bowman, Proceedings in Applied Mathematics and Mechanics, 7:1, 2010021-2010022 (2007).
- ^ Asymptote: Lifting TeX to three dimensions, J. C. Bowman and Orest Shardt, TUGBOAT: The Communications of the TeX Users Group, 30:1, 58-63 (2009).
- ^ Surface Parametrization of Nonsimply Connected Planar Bézier Regions, O. Shardt and J. C. Bowman, Computer-Aided Design, 44:5 (2012).
External links
- Asymptote (vector graphics language) on SourceForge
- Asymptote official website
- Philippe Ivaldi's extensive Asymptote gallery
- Asymptote: Art of Problem Solving Wiki
- Art of Problem Solving Forum[permanent dead link]
- Programming with Asymptote (in Dutch) Archived 2014-05-02 at the Wayback Machine
- An Asymptote Tutorial by Charles Staats