Asymptote is a descriptive
vector graphics
Vector graphics is a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector display ...
language — developed by Andy Hammerlindl, John C. Bowman (University of Alberta), and Tom Prince — which provides a natural coordinate-based framework for
technical drawing
Technical drawing, drafting or drawing, is the act and Academic discipline, discipline of composing Plan (drawing), drawings that Visual communication, visually communicate how something functions or is constructed.
Technical drawing is essent ...
. Asymptote runs on all major platforms (
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
,
Mac OS
Two major famlies of Mac operating systems were developed by Apple Inc.
In 1984, Apple debuted the operating system that is now known as the "Classic" Mac OS with its release of the original Macintosh System Software. The system, rebranded " ...
,
Microsoft Windows). It is
free software
Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, ...
, available under the terms of the
GNU Lesser General Public License
The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
(LGPL).
Syntax and notable features
Asymptote typesets labels and equations with
LaTeX
Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well.
In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosper ...
, producing high-quality
PostScript
PostScript (PS) is a page description language in the electronic publishing and desktop publishing realm. It is a dynamically typed, concatenative programming language. It was created at Adobe Systems by John Warnock, Charles Geschke, ...
,
PDF
Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. ...
,
SVG, or 3D
PRC output. It is inspired by
MetaPost
MetaPost refers to both a programming language and the interpreter of the MetaPost programming language. Both are derived from Donald Knuth's Metafont language and interpreter. MetaPost produces vector graphic diagrams from a geometric/algebra ...
, but has a
C++-like syntax. It provides a language for
typesetting
Typesetting is the composition of text by means of arranging physical ''type'' (or ''sort'') in mechanical systems or '' glyphs'' in digital systems representing '' characters'' (letters and other symbols).Dictionary.com Unabridged. Random ...
mathematical figures, just as
TeX/
LaTeX
Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well.
In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosper ...
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
In computing, a virtual machine (VM) is the virtualization/ emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized har ...
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.
Surface Parametrization of Nonsimply Connected Planar Bézier Regions, O. Shardt and J. C. Bowman, Computer-Aided Design, 44:5 (2012).
/ref>
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
Yacc (Yet Another Compiler-Compiler) is a computer program for the Unix operating system developed by Stephen C. Johnson. It is a Look Ahead Left-to-Right Rightmost Derivation (LALR) parser generator, generating a LALR parser (the part of a comp ...
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 = ;
real[] y1 = ;
real[] x2 = ;
real[] y2 = ;
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[]), Arrow);
yaxis( Label("$y$"), Ticks(new real[]), Arrow, ymin=-0.18, ymax=1.25);
// Origin.
labelx("$O$",0,SW);
The code above yields the following pdf output.
See also
* GeoGebra – free Dynamic Mathematics program with Asymptote export
* PSTricks
* TikZ
* PyX
References
External links
*
Asymptote official website
Philippe Ivaldi's extensive Asymptote gallery
Asymptote: Art of Problem Solving Wiki
Art of Problem Solving Forum
An Asymptote Tutorial by Charles Staats
{{Vector graphics markup languages
Free educational software
Free graphics software
Free plotting software
Free software programmed in C
Free software programmed in C++
Linux TeX software
TeX SourceForge projects
Vector graphics