next up previous contents index
Next: SUBROUTINE PAUSE Up: Miscellaneous Routines Previous: SUBROUTINE MTV4

SUBROUTINE NXTVU

   NXTVU is used internally by PLT3D. NXTVU computes the maximum (or minimum) of two piecewise linear functions: the curve specified in the input d array and the curve stored in the working array w. On return the new maximum (minimum) curve replaces the old in w. Any line segments or fractions thereof above (below) the maximum (minimum) are plotted. If iabs(i)=1 the input is copied into the working array and plotted. Subsequent calls should use iabs(i)=2. Using i positive computes the maximum while using i negative plots the minimum.

A grid of lines in only one dimension may be made by calling NXTVU once for each row, adjusting the d curve to offset each row by a small amount to give the impression of a surface.

The dimension of the working arrays is dependent of the surface complexity -- the greater the complexity the larger n2 must be. ier is used to indicate when n2 is not large enough. As a minimum n2>2*n. Note: w should not be modified between calls.

CALL NXTVU (i,d,n,w,n2,ier)

i     (I): initialize code
             < 0 : plot lower side of surface
            => 0 : plot upper side of surface
            = -1 : first call for lower surface plot
            = -2 : subsequent calls for lower surface plot
            =  1 : first call for upper surface plot
            =  2 : subsequent calls for upper surface plot
d     (R): array of (x,y) coordinate pairs dimensioned d(2*n)
            d(1) = x(1)
            d(2) = y(1)
            d(3) = x(2)
             ...
n     (I): number of coordinate pairs in d array
w     (R): working storage array of dimensioned d(n2)
            (should not be modified between calls)
n2    (I): dimension of working array
ier   (I): (returned) error code
            = 0 : no error
            = 1 : out of space in w



David Long
Wed Jun 12 10:34:11 MDT 1996