<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2013 - Scilab Enterprises
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
          xmlns:scilab="http://www.scilab.org" xml:id="cross" xml:lang="en">
    <refnamediv>
        <refname>cross</refname>
        <refpurpose>vector cross product</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>C = cross(A,B)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>A</term>
                <listitem>
                    <para>real, complex, polynomial or boolean matrix of size 3-by-N or 1-by-3.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>B</term>
                <listitem>
                    <para>real, complex, polynomial or boolean matrix of same size as A.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>C</term>
                <listitem>
                    <para>real, complex, polynomial or boolean matrix of same size as A and B.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <function>cross</function> returns the cross product of <varname>A</varname> and <varname>B</varname>, that is:
            <para>
                <emphasis>C = A ∧ B</emphasis>
            </para>
        </para>
        <para>
            <varname>A</varname> and <varname>B</varname> can be full or sparse matrix. However, rational matrix are not supported.
            Concerning boolean matrix, <function>cross</function> computes as if %t (resp. %f) was 1 (resp. 0), and '&amp;' (resp. '|')
            was '*' (resp. '+').
        </para>
        <para>
            To finish, if <varname>A</varname> and <varname>B</varname> are 3-by-N matrix, column-wise computations are done.
        </para>
    </refsection>
    <refsection>
        <title>Example</title>
        <programlisting role="example"><![CDATA[
A=[1;2;3];
B=[2;3;4];
cross(A,B) //expected: [-1;2;-1]
A=[%i,2,1+%i];
B=[1,%i,2+%i];
cross(A,B) //expected: [5+%i,2-%i,-3]
A=[%t;%f;%t];
B=[%t;%f;%f];
cross(A,B) //expected: [0;1;0]
 ]]></programlisting>
    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>5.5.0</revnumber>
                <revremark>Function cross introduced.</revremark>
            </revision>
        </revhistory>
    </refsection>
</refentry>
