<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="taninv2">
  <refmeta>
    <refentrytitle>taninv2</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>taninv2</refname>

    <refpurpose>
      Returns an arctangent.
      <indexterm id="IndexTaninv2"><primary>taninv2</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Returns the arctangent of <emphasis>iy/ix</emphasis>, <emphasis>ky/kx</emphasis>, or <emphasis>ay/ax</emphasis>.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>taninv2</command> ay, ax</synopsis>

    <synopsis>ir <command>taninv2</command> iy, ix</synopsis>

    <synopsis>kr <command>taninv2</command> ky, kx</synopsis>

    <para>
      Returns the arctangent of <emphasis>iy/ix</emphasis>, <emphasis>ky/kx</emphasis>, or <emphasis>ay/ax</emphasis>. If y is zero, <emphasis>taninv2</emphasis> returns zero regardless of the value of x. If x is zero, the return value is:
      <itemizedlist>
        <listitem><para><emphasis>PI/2</emphasis>, if y is positive.</para></listitem>
        <listitem><para><emphasis>-PI/2</emphasis>, if y is negative.</para></listitem>
        <listitem><para><emphasis>0</emphasis>, if y is 0.</para></listitem>
      </itemizedlist>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>iy, ix</emphasis> -- values to be converted
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ky, kx</emphasis> -- control rate signals to be converted
    </para>

    <para>
      <emphasis>ay, ax</emphasis> -- audio rate signals to be converted
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the taninv2 opcode. It uses the files <ulink url="examples/taninv2.orc"><citetitle>taninv2.orc</citetitle></ulink> and <ulink url="examples/taninv2.sco"><citetitle>taninv2.sco</citetitle></ulink>.

      <example>
        <title>Example of the taninv2 opcode.</title>

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

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

      Its output should include a line like this:
      <screen>
instr 1:  i1 = 0.464
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="taninv"><citetitle>taninv</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namejohn;</member>
        <member>University of Bath/Codemist Ltd.</member>
        <member>Bath, UK</member>
        <member>April 1998</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>

    <para>New in Csound version 3.48</para>
    <para>Corrected on May 2002, thanks to &nameistvan;.</para>
  </refsect1>
</refentry>
