GPIEXY Call
converts from polar to world coordinates
- CALL GPIEXY( x, y, fract-radii, angles<,
center><, radius><, window>);
The inputs to the GPIEXY subroutine are as follows:
- x and y
- are vectors of coordinates returned by GPIEXY.
- fract-radii
- is a vector of fractions of the radius of the reference circle.
- angles
- is the vector of angle coordinates in degrees.
- center
- defines the reference circle.
- radius
- defines the reference circle.
- window
- is a numeric matrix or literal specifying a window.
This is given in world coordinates and has the form
| {minimum-x minimum-y maximum-x maximum-y} |
The GPIEXY subroutine computes the world coordinates
of a sequence of points relative to a circle.
The x and y arguments are vectors of new
coordinates returned by the GPIEXY subroutine.
Together, the vectors fract-radii and
angles define the points in polar coordinates.
Each pair from the fract-radii and angles vectors
yields a corresponding pair in the x and y vectors.
For example, suppose fract-radii has two
elements, 0.5 and 0.3, and the corresponding
two elements of angles are 90 and 30.
The GPIEXY subroutine returns two elements in the
x vector and two elements in the y vector.
The first (x,y) pair locates a point half way from the center
to the reference circle on the vertical line through the center,
and the second (x,y) pair locates a point one-third of the way
on the line segment from the center to the reference circle,
where the line segment slants 30 degrees from the horizontal.
The reference circle can be defined by an earlier
GPIE call or another GPIEXY call, or it can be
defined by specifying center and radius.
Graphics devices can have diverse aspect ratios; thus,
a circle may appear distorted when drawn on some devices.
The SAS graphics system adjusts computations
to compensate for this distortion.
Thus, for any given point, the transformation
from polar coordinates to world coordinates
may need an equivalent adjustment.
The GPIEXY subroutine ensures that the same adjustment
applied in the GPIE subroutine is applied to the conversion.
An example using the GPIEXY call follows:
/* add labels to a pie with 4 slices of equal size */
call gpie(50,50,30,{0 90 180 270},{90 180 270 0});
call gpiexy(x,y,1.2,{45 135 225 315},{50 50},30,{0 0 100 100});
/* adjust for label size: */
x [4,]=x[4,]-3;
x [1,]=x[1,]-4;
x [2,]=x[2,]+1;
call gscript(x,y,{'QTR1' 'QTR2' 'QTR3' 'QTR4'});
call gshow;
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.