home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 300 / 249 / spline.arc / SPLINE.DOC < prev    next >
Text File  |  1986-10-28  |  4KB  |  109 lines

  1. NAME
  2.     spline - interpolate using splines under tension
  3.  
  4. SYNOPSIS
  5.     spline [file] [options]
  6.  
  7. DESCRIPTION
  8.     Without options, SPLINE reads pairs of numbers (x- and y-values) from
  9.     the standard input (or the given file), generates a smooth curve
  10.     through the points, and writes to the standard output points from the
  11.     smooth curve.  The curve is a spline under tension (see references),
  12.     which is somewhat "tighter" than a cubic spline, and less
  13.     likely to have spurious inflection points.  As with GRAPH, each
  14.     pair of points may optionally be followed by a comment.  If the
  15.     comment is surrounded by quotes "...", the comment may contain
  16.     spaces.  The given points, and their comments if any, will be
  17.     included in the output.  The interpolation may optionally be
  18.     restarted after each label, so that a family of curves may be
  19.     processed together (see the -b switch).
  20.  
  21.     Input lines starting with ";" are copied to the beginning of
  22.     the output file but are otherwise ignored.  Blank lines are
  23.     ignored.
  24.  
  25.     If the -c switch is not used, the input points must be from a function
  26.     - that is, the x values must be strictly increasing.  The
  27.     output points will also be from a function.  (If the -b switch
  28.     is used, this restriction applies only within each segment.)
  29.  
  30.     If the -c switch is used (indicating a general curve), the
  31.     input points need not be from a function, but each pair of
  32.     points must be separated from the previous pair by a finite
  33.     distance.  (If the -b switch is used, this restriction applies
  34.     only within each segment.)
  35.     
  36. options are:
  37.   -a  [step [start]] Input data contains only y values - generate automatic
  38.           abscissas at intervals of step (default 1) starting at start
  39.           (default 0).
  40.  
  41.   -b         break the interpolation at each label.  That is, the input
  42.         curve is divided into sections with the last point in
  43.         each section marked by a label (which may be empty:
  44.         "").  A separate interpolating curve is to be found for
  45.         each section.  In this case, the requirements on the
  46.         number of intervals (specified by the -n switch or
  47.         defaulted) and the interpolation range (specified by the 
  48.         -x switch) are applied to each section independently.
  49.  
  50.   -c            general curve rather than function.  In this case, the
  51.               curve is parameterized on the polygonal arclength from
  52.               the first to the last given point, with the whole
  53.               length scaled to be 1.  Thus, the values min and max
  54.               for the -x switch should satisfy 0 <= min < max <= 1. 
  55.               The -s and -c switches cannot be used together.
  56.  
  57.   -i  file
  58.           interpolate at x values given in file.  Only 1st number
  59.           on each line of file is used - rest of line is ignored. 
  60.           Blank lines and lines starting with ';' are ignored.
  61.  
  62.   -n  num       interpolate over num intervals (default is 100)
  63.  
  64.   -q            Quadruple: increase the number of intervals fourfold.
  65.  
  66.   -s [num [num]]
  67.           Specify slopes at beginning and end of curve.  Slopes
  68.           not given are assumed to be zero.  Without the -s 
  69.           switch, slopes are determined from other information.  
  70.           The -s and -c switches cannot be used together.
  71.  
  72.   -t num    Specify tension in interpolating curve.  Tension of 50 gives
  73.         almost polygonal line, tension of .01 gives almost cubic
  74.         spline.  Tension must be positive.  Default is 1.
  75.  
  76.   -x [min [max]]
  77.           Interpolate from min to max only.  min and max should
  78.           be in the range of the given x values, except that if
  79.           the -c switch is used they should satisfy 0 <= min <
  80.           max <= 1.
  81.  
  82.   -xl        take log of x values before interpolating, take exponential
  83.            afterwards (probably necessary if -xl switch is needed for
  84.            GRAPH)
  85.  
  86.   -yl        take log of y values before interpolating, take exponential
  87.            afterwards (probably necessary if -yl switch is needed for
  88.            GRAPH)
  89.  
  90. NOTES
  91.     Similar to the Unix routine, except using splines under tension,
  92.     passing labels through, performing multiple interpolations from
  93.     one file and allowing general curves.
  94.  
  95. REFERENCES
  96.  
  97.     A.  K.  Cline, "Scalar- and Planar- Valued Curve Fitting Using
  98.     Splines Under Tension", Communications of the ACM v 17 n 4 p
  99.     218-223 (Apr 74).
  100.  
  101.     Schweikert, D.  G.  "An interpolation curve using a spline in
  102.     tension", J.  Math.  and Physics v 45 p 312-317 (1966).
  103.  
  104. AUTHOR
  105.     Copyright (c) 1985  James R. Van Zandt
  106.  
  107.     Resale forbidden, copying for personal use encouraged.
  108.  
  109.