Asymptote (vector Graphics Language)
   HOME

TheInfoList



OR:

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 a ...
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, and ot ...
,
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 "M ...
,
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
). 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, no ...
, 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 (angiosperms ...
, 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, Doug Br ...
,
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 China, officially the People's Republic of China (PRC), is a country in East Asia. It is the world's most populous country, with a population exceeding 1.4 billion, slightly ahead of India. China spans the equivalent of five time zones and ...
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++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
-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 Ho ...
mathematical figures, just as
TeX Tex may refer to: People and fictional characters * Tex (nickname), a list of people and fictional characters with the nickname * Joe Tex (1933–1982), stage name of American soul singer Joseph Arrington Jr. Entertainment * ''Tex'', the Italian ...
/
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 (angiosperms ...
provides a language for typesetting equations. It is mathematically oriented (e.g. rotation of vectors by complex multiplication), and uses the
simplex method In mathematical optimization, Dantzig's simplex algorithm (or simplex method) is a popular algorithm for linear programming. The name of the algorithm is derived from the concept of a simplex and was suggested by T. S. Motzkin. Simplices are ...
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 hardw ...
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 Tex may refer to: People and fictional characters * Tex (nickname), a list of people and fictional characters with the nickname * Joe Tex (1933–1982), stage name of American soul singer Joseph Arrington Jr. Entertainment * ''Tex'', the Italian ...
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 Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
(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 com ...
compatible grammar.


Application examples

The following source code allows you to draw a graph of the
Heaviside function The Heaviside step function, or the unit step function, usually denoted by or (but sometimes , or ), is a step function, named after Oliver Heaviside (1850–1925), the value of which is zero for negative arguments and one for positive argume ...
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 GeoGebra (a portmanteau of ''geometry'' and ''algebra'') is an interactive geometry, algebra, statistics and calculus application, intended for learning and teaching mathematics and science from primary school to university level. GeoGebra is ...
– free Dynamic Mathematics program with Asymptote export * PSTricks *
TikZ PGF/Ti''k''Z is a pair of languages for producing vector graphics (e.g., technical illustrations and drawings) from a geometric/algebraic description, with standard features including the drawing of points, lines, arrows, paths, circles, ellipse ...
*
PyX A pyx or pix ( la, pyxis, transliteration of Greek: ''πυξίς'', boxwood receptacle, from ''πύξος'', box tree) is a small round container used in the Catholic, Old Catholic and Anglican Churches to carry the consecrated host (Eucharist) ...


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