complex() extended to sparses
[scilab.git] / scilab / modules / elementary_functions / help / ja_JP / complex / complex.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) 2011 - DIGITEO - Michael Baudin
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2020 - 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="complex" xml:lang="ja">
20     <refnamediv>
21         <refname>complex</refname>
22         <refpurpose>複素数を計算する</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>呼び出し手順</title>
26         <synopsis>
27             c = complex(u)
28             c = complex(a, b)
29         </synopsis>
30     </refsynopsisdiv>
31     <refsection>
32         <title>引数</title>
33         <variablelist>
34             <varlistentry>
35                 <term>u, a, b</term>
36                 <listitem>
37                     scalars, vectors, matrices or hypermatrices of real numbers.
38                     If both <varname>a</varname> and <varname>b</varname> are not
39                     scalars, they must have the same sizes.
40                     <para/>
41                 </listitem>
42             </varlistentry>
43             <varlistentry>
44                 <term>c</term>
45                 <listitem>
46                     array of complex numbers, of the size of <varname>u</varname> or of
47                     <varname>a</varname> and <varname>b</varname>.
48                     If <varname>u</varname> is sparse, or if <varname>a</varname> and
49                     <varname>b</varname> have the same sizes and both are sparse,
50                     then <varname>c</varname> is also sparse.
51                     Otherwise <varname>c</varname> is dense-encoded.
52                     <para/>
53                 </listitem>
54             </varlistentry>
55         </variablelist>
56     </refsection>
57     <refsection>
58         <title>説明</title>
59         <para>
60             <emphasis role="bold">c = complex(u)</emphasis> は, <varname>u</varname>を実部,
61             0 を虚部とする複素数を作成します.
62         </para>
63         <para>
64             <emphasis role="bold">c = complex(a,b)</emphasis> は実部<varname>a</varname> ,
65             虚部<varname>b</varname>の複素数を作成します.
66         </para>
67         <para>
68             This function is equivalent to <literal>a + imult(b)</literal>, which
69             handles properly special Inf and NaN real and imaginary parts.
70         </para>
71     </refsection>
72     <refsection>
73         <title>例</title>
74         <para>
75             以下の例では,実部と虚部から複素数を生成します.
76         </para>
77         <programlisting role="example"><![CDATA[
78 complex(1,2)
79 complex([1 2],[3 4])
80  ]]></programlisting>
81         <para>
82             <varname>a</varname> のみが指定された場合, 虚部は0に設定されます.
83         </para>
84         <programlisting role="example"><![CDATA[
85 complex([1 2 3])
86  ]]></programlisting>
87         <para>
88             <varname>a</varname> がスカラーで <varname>b</varname> が
89             行列の場合, 結果 <varname>c</varname> は,
90             <varname>b</varname>と同じ大きさとなります.
91             同様に, <varname>b</varname> がスカラーで <varname>a</varname>
92             が行列の場合, 結果 <varname>c</varname> は
93             <varname>a</varname>と同じ大きさになります.
94         </para>
95         <programlisting role="example"><![CDATA[
96 c = complex([1 2 3], 4)
97 c = complex(1, [2 3 4])
98  ]]></programlisting>
99         <para>
100             <varname>a</varname> と <varname>b</varname> が
101             異なる大きさの行列の場合,以下のセッションのような
102             エラーが発生します.
103         </para>
104         <screen><![CDATA[
105 -->complex(ones(2,3),ones(4,5))
106  !--error 10000
107 complex: Incompatible input arguments #1 and #2: Same sizes expected.
108 at line      33 of function complex called by :
109 complex(ones(2,3),ones(4,5))
110  ]]></screen>
111         <para>
112             With special real or/and imaginary parts:
113         </para>
114         <programlisting role="example"><![CDATA[
115 r = [0   0    0 %inf %inf %inf %nan %nan %nan].';
116 i = [0 %inf %nan  0  %inf %nan   0  %inf %nan].';
117 [r, i]
118
119 // Then let's compare complex(r, i) with r + i*%i :
120 [complex(r,i), r+i*%i]
121  ]]></programlisting>
122         <screen><![CDATA[
123 --> [r, i]
124  ans  =
125    0.    0.
126    0.    Inf
127    0.    Nan
128    Inf   0.
129    Inf   Inf
130    Inf   Nan
131    Nan   0.
132    Nan   Inf
133    Nan   Nan
134
135 // Then let's compare complex(r, i) with r + i*%i :
136 --> [complex(r,i), r+i*%i]
137  ans  =
138    0.  + 0.i    0.  + 0.i
139    0.  + Infi   Nan + Infi
140    0.  + Nani   Nan + Nani
141    Inf + 0.i    Inf + 0.i
142    Inf + Infi   Nan + Infi
143    Inf + Nani   Nan + Nani
144    Nan + 0.i    Nan + 0.i
145    Nan + Infi   Nan + Infi
146    Nan + Nani   Nan + Nani
147  ]]></screen>
148     </refsection>
149     <refsection role="see also">
150         <title>参照</title>
151         <simplelist type="inline">
152             <member>
153                 <link linkend="percenti">%i</link>
154             </member>
155             <member>
156                 <link linkend="imult">imult</link>
157             </member>
158         </simplelist>
159     </refsection>
160     <refsection role="history">
161         <title>履歴</title>
162         <revhistory>
163             <revision>
164                 <revnumber>6.1.1</revnumber>
165                 <revdescription>Extension to sparse arrays.
166                 </revdescription>
167             </revision>
168         </revhistory>
169     </refsection>
170 </refentry>