Up: Strageties for using scripts

Handling Coordinate Systems

The Geometry Center has developed a Perl module containing a number of subroutines for handling coordinate systems, axes, etc. To use this library in your own Perl scripts, you must include the library in your script as shown:
#! /usr/bin/perl

require "axes.pl";
.
.
.

Subroutines in axes.pl


gifsize

Calling Syntax: &gifsize(xmin, xmax, ymin, ymax, xmid, ymid)

You must call gifsize before any other axes.pl routines, except pssize.

You can determine the gif coordinates of a region in a gif by using the middle mouse button in xv.


pssize

Calling Syntax: &pssize(xmin, xmax, ymin, ymax)

You must call pssize before any other axes.pl routines, except gifsize.


sizetofit

Calling Syntax: &sizetofit(xmax, ymax)

This routine chooses the user coordinate system so that the input point lies in the first quardrant region determined by the axes, which are in turn implicitly determined by the gif coordinates of the origin and the bounding box specified in gifsize>. The routine may srhink the user region more than is necessary to accomodate the input point to achieve better tick marks.

This routine requires that gifsize be called first. pssize can be called after, but none of the coordinate conversion routines involving PostScript coordinate will function until pssize called.


u2p

Calling Syntax: (px, py) = &u2p(ux, uy)


p2u

Calling Syntax: (ux, uy) = &p2u(px, py)


u2g

Calling Syntax: (gx, gy) = &u2g(ux, uy)


g2u

Calling Syntax: (ux, uy) = &g2u(gx, gy)


p2g

Calling Syntax: (gx, gy) = &p2g(px, py)


g2p

Calling Syntax: (px, py) = &g2p(gx, gy)


xticks

Calling Syntax: &xticks()

This routine attempts to intelligently draw and label tick marks on the x-axis. You will probably end up editing this routine to meet your own specifications.


yticks

Calling Syntax: &yticks()

This routine attempts to intelligently draw and label tick marks on the y-axis. You will probably end up editing this routine to meet your own specifications.


Up: Strageties for using scripts

[HOME] The Geometry Center Home Page

Comments to: webmaster@www.geom.uiuc.edu
Created: May 10 1996 --- Last modified: May 30 1996