Previous: fitvgr Up: ../plot79_f.html Next: fitvpd


FITVLC

       SUBROUTINE  FITVLC (NDP, XD, YD, NT, IPT, NL, IPL, XII, YII, ITI,
      X    IWK, WK)
 C$    (ALG526 - Internal Locate Triangle Number)
 C$    This subroutine locates a  point, i.e., determines to  what
 C$    triangle a given point  (XII,YII) belongs.  When the  given
 C$    point does not  lie inside the  data area, this  subroutine
 C$    determines the border line segment  when the point lies  in
 C$    an outside rectangular area,  and two border line  segments
 C$    when the point  lies in  an outside  triangular area.   The
 C$    input parameters are:
 C$
 C$    NDP............Number of data points,
 C$    XD(*),YD(*)....Arrays of dimension NDP containing the X
 C$                   and Y coordinates of the data points,
 C$    NT ............Number of triangles,
 C$    IPT(*).........INTEGER array of  dimension 3*NT  containing
 C$                   the point  numbers of  the vertexes  of  the
 C$                   triangles,
 C$    NL ............Number of border line segments,
 C$    IPL(*).........INTEGER array of dimension  3*NL  containing
 C$                   the point numbers of  the end points of  the
 C$                   border line  segments and  their  respective
 C$                   triangle numbers,
 C$    XII,YII........X and Y coordinates of the point to be
 C$                   located.
 C$
 C$    The output parameter is:
 C$
 C$    ITI............Triangle  number, when  the point  is inside
 C$                   the data area,  or two  border line  segment
 C$                   numbers,   IL1    and    IL2,    coded    to
 C$                   IL1*(NT+NL)+IL2, when the  point is  outside
 C$                   the data area.
 C$
 C$    The other parameters are
 C$
 C$    IWK(*).........INTEGER array of dimension 18*NDP used
 C$                   internally as a work area,
 C$    WK(*)..........REAL array of dimension 8*NDP used
 C$                   internally as a work area.
 C$
 C$    This routine  incorporates  the  corrections  published  in
 C$    Hiroshi Akima, "Remark on Algorithm 526", ACM Trans.  Math.
 C$    Software 5, No. 2, 242-243 (June 1979).
 C$
 C$    (03-APR-82)