Go to the first, previous, next, last section, table of contents.


Mapping functions

The following are the "mapping functions" in libplot. When invoked on a Plotter, these functions affect the affine transformation it employs for mapping from the user coordinate system to the device coordinate system. They may be viewed as performing transformations of the user coordinate system. Their names resemble those of the corresponding functions in the Postscript language. For information on how to use them to draw graphics efficiently, consult any good book on Postscript programming, or the Postscript Language Reference Manual.

In the C binding, the names of all functions should be preceded by "pl_", unless the header file plotcompat.h is included. See section C compiling and linking. In the C++ binding, these are member functions of the Plotter class and its subclasses.

int fconcat (double m0, double m1, double m2, double m3, double tx, double ty);
Apply a Postscript-style transformation matrix, i.e., affine map, to the user coordinate system. That is, apply the linear transformation defined by the two-by-two matrix [m0 m1 m2 m3] to the user coordinate system, and also translate by tx units in the x direction and ty units in the y direction, relative to the former user coordinate system. The following three functions (frotate, fscale, ftranslate) are convenience functions that are special cases of fconcat.
int frotate (double theta);
Rotate the user coordinate system axes about their origin by theta degrees, with respect to their former orientation. The position of the user coordinate origin and the size of the x and y units remain unchanged.
int fscale (double sx, double sy);
Make the x and y units in the user coordinate system be the size of sx and sy units in the former user coordinate system. The position of the user coordinate origin and the orientation of the coordinate axes are unchanged.
int ftranslate (double tx, double ty);
Move the origin of the user coordinate system by tx units in the x direction and ty units in the y direction, relative to the former user coordinate system. The size of the x and y units and the orientation of the coordinate axes are unchanged.


Go to the first, previous, next, last section, table of contents.