* Bug 16021 fixed: tand(90) cotd(90) 1/cosd(90) were wrong
[scilab.git] / scilab / modules / elementary_functions / help / en_US / trigonometry / cotd.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2019 - Samuel GOUGEON
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19           xmlns:scilab="http://www.scilab.org"  xml:id="cotd" xml:lang="en">
20     <refnamediv>
21         <refname>cotd</refname>
22         <refpurpose>element-wise cotangent function, argument in degree</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>Syntax</title>
26         <synopsis>y = cotd(x)</synopsis>
27     </refsynopsisdiv>
28     <refsection>
29         <title>Arguments</title>
30         <variablelist>
31             <varlistentry>
32                 <term>x</term>
33                 <listitem>
34                     <para>a real array.</para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>y</term>
39                 <listitem>
40                     <para>a real array with same dimensions as
41                         <varname>x</varname>.
42                     </para>
43                 </listitem>
44             </varlistentry>
45         </variablelist>
46     </refsection>
47     <refsection>
48         <title>Description</title>
49         <para>
50             The entries of <varname>y</varname> are the cotangents of the
51             corresponding entries of <varname>x</varname> supposed to be given in
52             degree. <code>t=cos(x)./sin(x)</code>. For entries equal to
53             <literal>n*180</literal> with <literal>n</literal> integer, the results
54             are infinite, whereas <code>cotg(n*%pi)</code> is large but finite
55             because <constant>%pi</constant> cannot be represented exactly. For entries
56             equal to <literal>n*90</literal> with <literal>n</literal> integers and
57             odd the results are exactly <literal>0</literal>.
58         </para>
59     </refsection>
60     <refsection>
61         <title>Examples</title>
62         <programlisting role="example"><![CDATA[
63 cotd([30 45 60 90])
64 cotd([-180 -90 0 90 180])
65  ]]></programlisting>
66     <screen><![CDATA[
67 --> cotd([30 45 60 90])
68  ans  =
69    1.7320508   1.   0.5773503   0.
70
71 --> cotd([-180 -90 0 90 180])
72  ans  =
73    Inf   0.   Inf   0.   Inf
74 ]]></screen>
75     </refsection>
76     <refsection role="see also">
77         <title>See also</title>
78         <simplelist type="inline">
79             <member>
80                 <link linkend="cotg">cotg</link>
81             </member>
82             <member>
83                 <link linkend="coth">coth</link>
84             </member>
85             <member>
86                 <link linkend="tan">tan</link>
87             </member>
88             <member>
89                 <link linkend="tand">tand</link>
90             </member>
91         </simplelist>
92     </refsection>
93 </refentry>