From Surf Wiki (app.surf) — the open knowledge base
Asymptote (vector graphics language)
Descriptive vector graphics language
Descriptive vector graphics language
| Field | Value |
|---|---|
| name | Asymptote |
| logo | AsymptoteLogo.svg |
| logo caption | The Asymptote logo (SVG file created with Asymptote) |
| paradigm | imperative, typesetting |
| released | |
| designer | Andy Hammerlindl, John C. Bowman, Tom Prince |
| latest release version | |
| latest release date | |
| latest preview date | |
| typing | strong |
| influenced by | MetaPost |
| programming language | [C++](c) |
| operating system | Cross-platform |
| license | LGPL |
| website |
Asymptote is a descriptive vector graphics language – developed by Andy Hammerlindl, John C. Bowman (University of Alberta), and Tom Prince – which provides a natural coordinate-based framework for technical drawing. Asymptote runs on all major platforms (Unix, Mac OS, Microsoft Windows). It is free software, available under the terms of the GNU Lesser General Public License (LGPL).
Syntax and notable features
Asymptote typesets labels and equations with LaTeX, producing high-quality PostScript, PDF, SVG, or 3D PRC output. It is inspired by MetaPost, but has a C-like syntax. It provides a language for typesetting mathematical figures, just as TeX/LaTeX provides a language for typesetting equations. It is mathematically oriented (e.g. rotation of vectors by complex multiplication), and uses the simplex method and deferred drawing to solve overall size constraint issues between fixed-sized objects (labels and arrowheads) and objects that should scale with figure size.
Asymptote fully generalizes MetaPost path construction algorithms to three dimensions, 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. This allows Asymptote to be used as a 3D vector file format.
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 Heaviside function by means of the Asymptote language.
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.

References
References
- [http://www.math.ualberta.ca/~bowman/publications/asyTUG.pdf Asymptote: A vector graphics language, J. C. Bowman and A. Hammerlindl, TUGBOAT: The Communications of the TeX Users Group, 29:2, 288-294 (2008).]
- [http://www.math.ualberta.ca/~bowman/publications/asy3d.pdf The 3D Asymptote Generalization of MetaPost Bézier Interpolation, J. C. Bowman, Proceedings in Applied Mathematics and Mechanics, 7:1, 2010021-2010022 (2007)].
- [http://www.math.ualberta.ca/~bowman/publications/asyTUG3.pdf 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).]
- [http://www.math.ualberta.ca/~bowman/publications/cad10.pdf Surface Parametrization of Nonsimply Connected Planar Bézier Regions, O. Shardt and J. C. Bowman, Computer-Aided Design, '''44:5''' (2012).]
This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.
Ask Mako anything about Asymptote (vector graphics language) — get instant answers, deeper analysis, and related topics.
Research with MakoFree with your Surf account
Create a free account to save articles, ask Mako questions, and organize your research.
Sign up freeThis content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.
Report