Lagrange and Hermite polynomial interpolation : interp1.asy. See examples (with French comments).
This modules are now included within the official Asymptote distribution.
A very beginning routine to deal with piecewise-constant functions (sum, multiplication and drawing) : escalier2.asy and the result is here.
A solution to highlight Asymptote code with HTML, LaTeX, RTF outputs : Pygments with a very beginning Asymptote lexer. You need to install Python and Pygments.
Copy the files vectorgraphic.py and _asylist.py in the pygments/lexer
directory. Execute in the pygments/lexer
directory "sudo python _mapping.py"
(or the similar command with the root privileges). Then pygmentize
recognizes asy
files or use "pygmentize -l asy"
. You can see examples here (and SVG output).
The lexer vectorgraphic.py is based on the C(++) Pygments lexer. Since a name “can be” a type
and a function
, the solution is not perfect and can be improved. Pygments uses regular expressions. The file _asylist.py
contains all the variable and function names (TODO: Perl/Python script which generates this file).
Please send any comment and contribution to improve this lexer so that we can propose it in the Pygments distribution.