3.1 Drawing in batch mode

To draw a line from coordinate (0,0) to coordinate (100,100), create a text file test.asy containing

draw((0,0)--(100,100));

Then execute the command

asy -V test

Alternatively, MSDOS users can drag and drop test.asy onto the Desktop asy icon (or make Asymptote the default application for the extension asy).

This method, known as batch mode, outputs a PostScript file test.eps. If you prefer PDF output, use the command line

asy -V -f pdf test

In either case, the -V option opens up a viewer window so you can immediately view the result:


./diagonal

Here, the -- connector joins the two points (0,0) and (100,100) with a line segment.