Line Graphics

Lines are drawn from point to point on the page. The positions of each point are given by two coordinates, the x and y coordinates. They are the number of the point across the page horizontally from the left, and the number of the point vertically from the bottom, respectively. So, the bottom left point is 0 0, and on a letter size page, the top right point is 612 792.

The lineto command is an operator requiring two operands, or arguments. Use it to make a line from the current point (set by the “moveto” command) to the point specified by the lineto arguments. Thus, to create a diagonal from the bottom left to the top right of the page:

0 0 moveto
612 792 lineto

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s