ergetgetagt

Page 50

Chapter 6: Programming

45

• One can prevent labels from overwriting one another by using the pen attribute overwrite, which takes a single argument: Allow

Allow labels to overwrite one another. This is the default behaviour (unless overridden with defaultpen(pen).

Suppress

Suppress, with a warning, each label that would overwrite another label.

SuppressQuiet Suppress, without warning, each label that would overwrite another label. Move

Move a label that would overwrite another out of the way and issue a warning. As this adjustment is during the final output phase (in PostScript coordinates) it could result in a larger figure than requested.

MoveQuiet Move a label that would overwrite another out of the way, without warning. As this adjustment is during the final output phase (in PostScript coordinates) it could result in a larger figure than requested. The routine defaultpen() returns the current default pen attributes. Calling the routine resetdefaultpen() resets all pen default attributes to their initial values.

6.4 Transforms Asymptote makes extensive use of affine transforms. A pair (x,y) is transformed by the transform t=(t.x,t.y,t.xx,t.xy,t.yx,t.yy) to (x’,y’), where x’ = t.x + t.xx * x + t.xy * y y’ = t.y + t.yx * x + t.yy * y This is equivalent to the PostScript transformation [t.xx t.yx t.xy t.yy t.x t.y]. Transforms can be applied to pairs, guides, paths, pens, strings, transforms, frames, and pictures by multiplication (via the binary operator *) on the left (see [circle], page 30 for an example). Transforms can be composed with one another and inverted with the function transform inverse(transform t); they can also be raised to any integer power with the ^ operator. The built-in transforms are: transform identity(); the identity transform; transform shift(pair z); translates by the pair z; transform shift(real x, real y); translates by the pair (x,y); transform xscale(real x); scales by x in the x direction; transform yscale(real y); scales by y in the y direction; transform scale(real s); scale by s in both x and y directions;


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.