<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="GEN08">
  <refmeta>
    <refentrytitle>GEN08</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>GEN08</refname>
    <refpurpose>
      Generate a piecewise cubic spline curve.
      <indexterm id="IndexGEN08"><primary>GEN08</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      This subroutine will generate a piecewise cubic spline curve, the smoothest possible through all specified points.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>f</command> # time size 8 a n1 b n2 c n3 d ...</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>size</emphasis> -- number of points in the table. Must be a power of 2 or power-of-2 plus 1 (see <link linkend="f"><citetitle>f statement</citetitle></link>).
    </para>

    <para>
      <emphasis>a, b, c,</emphasis> etc. -- ordinate values of the function.
    </para>

    <para>
      <emphasis>n1, n2, n3 ... </emphasis> -- length of each segment measured in stored values. May not be zero, but may be fractional. A particular segment may or may not actually store any values; stored values will be generated at integral points from the beginning of the function. The sum <emphasis>n1</emphasis> + <emphasis>n2</emphasis> + ... will normally equal <emphasis>size</emphasis> for fully specified functions.
    </para>

    <note>
      <title>Note</title>
      <para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis>GEN08</emphasis> constructs a stored table from segments of cubic polynomial functions. Each segment runs between two specified points but depends as well on their neighbors on each side. Neighboring segments will agree in both value and slope at their common point. (The common slope is that of a parabola through that point and its two neighbors). The slope at the two ends of the function is constrained to be zero (flat).
            </para>
          </listitem>

          <listitem>
            <para>
              <emphasis>Hint:</emphasis> to make a discontinuity in slope or value in the function as stored, arrange a series of points in the interval between two stored values; likewise for a non-zero boundary slope.
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </note>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is a simple example of the GEN08 routine. It uses the files <ulink url="examples/gen08.orc"><citetitle>gen08.orc</citetitle></ulink> and <ulink url="examples/gen08.sco"><citetitle>gen08.sco</citetitle></ulink>. It will create a curve with a smooth hump in the middle, going briefly negative outside the hump then flat at its ends. Here is its diagram:
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/gen08.png" format="PNG">
        </imageobject>

        <textobject>
          <phrase>Diagram of the waveform generated by GEN08.</phrase>
        </textobject>

        <caption>
          <para>Diagram of the waveform generated by GEN08.</para>
        </caption>
      </mediaobject>

      <example>
        <title>A simple example of the GEN08 routine.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/gen08.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/gen08.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>
    </para>
  </refsect1>

  <refsect1>
     <title>See Also</title>
     <para>
       <link linkend="GEN05"><citetitle>GEN05</citetitle></link>,
       <link linkend="GEN06"><citetitle>GEN06</citetitle></link>, and
       <link linkend="GEN07"><citetitle>GEN07</citetitle></link>
     </para>
  </refsect1>
</refentry>
