请输入您要查询的百科知识:

 

词条 Asymptote (vector graphics language)
释义

  1. Syntax and notable features

  2. Application examples

  3. See also

  4. References

  5. External links

{{Infobox programming language
| name = Asymptote
| logo = AsymptoteLogo.svg
| logo caption = The Asymptote logo (SVG file created with Asymptote)
| screenshot =
| screenshot caption =
| file ext =
| paradigm = imperative, typesetting
| scope =
| released = {{start date and age|2004}}
| designer = Andy Hammerlindl, John C. Bowman, Tom Prince
| developer =
| latest release version = 2.47
| latest release date = {{start date and age|2018|07|30}}[1]
| latest preview version =
| latest preview date =
| typing = strong
| implementations =
| dialects =
| influenced by = MetaPost
| influenced =
| programming language = C++
| platform =
| operating system = Cross-platform
| license = LGPL
| website = {{url|asymptote.sourceforge.net}}
| wikibooks =
}}

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.[2] 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,[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 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.

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);

See also

{{commonscat|Created with Asymptote|Asymptote}}{{Portal|Free and open-source software}}
  • GeoGebra – free Dynamic Mathematics program with Asymptote export
  • PSTricks
  • TikZ
  • PyX

References

1. ^{{cite web|url=https://github.com/vectorgraphics/asymptote/releases|title=Releases - vectorgraphics/asymptote|accessdate=2018-09-29|via=GitHub}}
2. ^Asymptote: A vector graphics language, J. C. Bowman and A. Hammerlindl, TUGBOAT: The Communications of the TeX Users Group, 29:2, 288-294 (2008).
3. ^The 3D Asymptote Generalization of MetaPost Bézier Interpolation, J. C. Bowman, Proceedings in Applied Mathematics and Mechanics, 7:1, 2010021-2010022 (2007).
4. ^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).
5. ^Surface Parametrization of Nonsimply Connected Planar Bézier Regions, O. Shardt and J. C. Bowman, Computer-Aided Design, 44:5 (2012).

External links

  • {{SourceForge|asymptote}}
  • Asymptote official website
  • Philippe Ivaldi's extensive Asymptote gallery
  • Asymptote: Art of Problem Solving Wiki
  • Art of Problem Solving Forum
  • Asymptote examples by Gaétan Marris
  • Programming with Asymptote (in Dutch)
  • An Asymptote Tutorial by Charles Staats
{{Vector graphics markup languages}}

6 : Free educational software|Free graphics software|Free software programmed in C++|Linux TeX software|TeX SourceForge projects|Vector graphics

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/16 13:10:51