Previous: clpph Up: ../plot79_c.html Next: clppl2
SUBROUTINE CLPPI (P1,P2,CENTER,RADIUS,EN1,EN2,MOVED1,MOVED2,
X REJECT,ALPHA1,ALPHA2)
C$ (Clip to Pie Segment)
C$ Clip a line segment to fit in a pie segment, as for pie
C$ chart filling. The arguments are:
C$
C$ P1(*)..........(X,Y,Z,H) coordinates of first point.
C$ P2(*)..........(X,Y,Z,H) coordinates of second point. For
C$ both points, the Z coordinate is ignored,
C$ and H is assumed to be 1.
C$ CENTER(*)......(X,Y,Z,H) coordinates of center of circle
C$ containing the pie segment.
C$ RADIUS.........Radius of circle.
C$ EN1(*).........Inward-pointing normal on segment edge 1.
C$ This vector is (-SIN(THETA1),COS(THETA1),0,0).
C$ EN2(*).........Inward-pointing normal on segment edge 2.
C$ This vector is (SIN(THETA2), -COS(THETA1),
C$ 0, 0). These edge normals are provided in
C$ place of the angles so that unnecessary
C$ recomputation of the sines and cosines can
C$ be avoided while filling the pie segment is
C$ in progress. The angles must satisfy THETA2
C$ .GE. THETA1, and (THETA2 - THETA1) .LE.
C$ 180.0, because only one clipped segment is
C$ returned. If the interior angle of the pie
C$ segment is greater than 180 degrees, the
C$ segment must be divided in two and passed in
C$ separate calls to this routine. ***NOTE***
C$ This requirement is not tested for, and
C$ incorrect results may be generated if it is
C$ not obeyed.
C$ MOVED1.........LOGICAL value set .TRUE. if point 1 is moved.
C$ MOVED2.........LOGICAL value set .TRUE. if point 2 is moved.
C$ REJECT.........LOGICAL value set .TRUE. if the segment is
C$ rejected (i.e. invisible). REJECT must have
C$ a value on entry, and return will occur
C$ immediately if it is .TRUE.. If the line is
C$ rejected, ALPHA1 and ALPHA2 will be
C$ unchanged on return.
C$ ALPHA1.........Parameter alpha for the first point in the
C$ parametric line representation (1-alpha)*P1
C$ + alpha*P2.
C$ ALPHA2.........Parameter alpha for the second point.
C$
C$ ALPHA1 and ALPHA2 must have valid values on input (e.g. 0.0
C$ and 1.0), and will only be updated if MOVED1 or MOVED2 is
C$ set .TRUE. respectively. P1(*) and P2(*) are ***NEVER***
C$ modified; the clipped line segment is defined solely in
C$ terms of the ALPHA's.
C$
C$ (03-APR-82)