Mercurial > hg > octave-lyh
annotate doc/interpreter/arith.txi @ 9064:7c02ec148a3c
Check grammar on all .cc files
Same check as previously done on .m files
Attempt to enforce some conformity in documentation text for rules
such as two spaces after a period, commas around latin abbreviations, etc.
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Sat, 28 Mar 2009 13:57:22 -0700 |
parents | eb63fbe60fab |
children | c1fff751b5a8 |
rev | line source |
---|---|
8920 | 1 @c Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2007, 2008, |
2 @c 2009 John W. Eaton | |
7018 | 3 @c |
4 @c This file is part of Octave. | |
5 @c | |
6 @c Octave is free software; you can redistribute it and/or modify it | |
7 @c under the terms of the GNU General Public License as published by the | |
8 @c Free Software Foundation; either version 3 of the License, or (at | |
9 @c your option) any later version. | |
10 @c | |
11 @c Octave is distributed in the hope that it will be useful, but WITHOUT | |
12 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 @c for more details. | |
15 @c | |
16 @c You should have received a copy of the GNU General Public License | |
17 @c along with Octave; see the file COPYING. If not, see | |
18 @c <http://www.gnu.org/licenses/>. | |
3294 | 19 |
4167 | 20 @node Arithmetic |
3294 | 21 @chapter Arithmetic |
22 | |
23 Unless otherwise noted, all of the functions described in this chapter | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
24 will work for real and complex scalar or matrix arguments. Functions described as @dfn{mapping functions} apply the given operation to each element when given a matrix argument. |
3294 | 25 |
26 @menu | |
27 * Utility Functions:: | |
28 * Complex Arithmetic:: | |
29 * Trigonometry:: | |
30 * Sums and Products:: | |
31 * Special Functions:: | |
3803 | 32 * Coordinate Transformations:: |
3294 | 33 * Mathematical Constants:: |
34 @end menu | |
35 | |
4169 | 36 @node Utility Functions |
3294 | 37 @section Utility Functions |
38 | |
39 The following functions are available for working with complex numbers. | |
40 Each expects a single argument. They are called @dfn{mapping functions} | |
41 because when given a matrix argument, they apply the given function to | |
42 each element of the matrix. | |
43 | |
3321 | 44 @DOCSTRING(ceil) |
3294 | 45 |
6550 | 46 @DOCSTRING(cplxpair) |
47 | |
6788 | 48 @DOCSTRING(del2) |
49 | |
3321 | 50 @DOCSTRING(exp) |
3294 | 51 |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
52 @DOCSTRING(expm1) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
53 |
6550 | 54 @DOCSTRING(factor) |
55 | |
56 @DOCSTRING(factorial) | |
57 | |
3321 | 58 @DOCSTRING(fix) |
3294 | 59 |
3321 | 60 @DOCSTRING(floor) |
3294 | 61 |
6550 | 62 @DOCSTRING(fmod) |
63 | |
3321 | 64 @DOCSTRING(gcd) |
3294 | 65 |
6551 | 66 @DOCSTRING(gradient) |
67 | |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
68 @DOCSTRING(hypot) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
69 |
3321 | 70 @DOCSTRING(lcm) |
3294 | 71 |
3321 | 72 @DOCSTRING(log) |
3294 | 73 |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
74 @DOCSTRING(log1p) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
75 |
3321 | 76 @DOCSTRING(log10) |
3294 | 77 |
3321 | 78 @DOCSTRING(log2) |
3294 | 79 |
3321 | 80 @DOCSTRING(max) |
3294 | 81 |
3321 | 82 @DOCSTRING(min) |
83 | |
8783
aee6f5c6665e
include DOCSTRING entries for cummin and cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8286
diff
changeset
|
84 @DOCSTRING(cummax) |
aee6f5c6665e
include DOCSTRING entries for cummin and cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8286
diff
changeset
|
85 |
aee6f5c6665e
include DOCSTRING entries for cummin and cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8286
diff
changeset
|
86 @DOCSTRING(cummin) |
aee6f5c6665e
include DOCSTRING entries for cummin and cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8286
diff
changeset
|
87 |
3982 | 88 @DOCSTRING(mod) |
89 | |
3321 | 90 @DOCSTRING(nextpow2) |
3294 | 91 |
6550 | 92 @DOCSTRING(nthroot) |
93 | |
3321 | 94 @DOCSTRING(pow2) |
3294 | 95 |
6550 | 96 @DOCSTRING(primes) |
97 | |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
98 @DOCSTRING(reallog) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
99 |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
100 @DOCSTRING(realpow) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
101 |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
102 @DOCSTRING(realsqrt) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
103 |
3321 | 104 @DOCSTRING(rem) |
3294 | 105 |
3321 | 106 @DOCSTRING(round) |
3294 | 107 |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
108 @DOCSTRING(roundb) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
109 |
3321 | 110 @DOCSTRING(sign) |
3294 | 111 |
3321 | 112 @DOCSTRING(sqrt) |
3294 | 113 |
4169 | 114 @node Complex Arithmetic |
3294 | 115 @section Complex Arithmetic |
116 | |
117 The following functions are available for working with complex | |
118 numbers. Each expects a single argument. Given a matrix they work on | |
119 an element by element basis. In the descriptions of the following | |
120 functions, | |
121 @iftex | |
122 @tex | |
123 $z$ is the complex number $x + iy$, where $i$ is defined as | |
124 $\sqrt{-1}$. | |
125 @end tex | |
126 @end iftex | |
127 @ifinfo | |
128 @var{z} is the complex number @var{x} + @var{i}@var{y}, where @var{i} is | |
129 defined as @code{sqrt (-1)}. | |
130 @end ifinfo | |
131 | |
3321 | 132 @DOCSTRING(abs) |
3294 | 133 |
3321 | 134 @DOCSTRING(arg) |
3294 | 135 |
3321 | 136 @DOCSTRING(conj) |
3294 | 137 |
3321 | 138 @DOCSTRING(imag) |
3294 | 139 |
3321 | 140 @DOCSTRING(real) |
3294 | 141 |
4169 | 142 @node Trigonometry |
3294 | 143 @section Trigonometry |
144 | |
145 Octave provides the following trigonometric functions. Angles are | |
6939 | 146 specified in radians. To convert from degrees to radians multiply by |
3294 | 147 @iftex |
148 @tex | |
149 $\pi/180$ | |
150 @end tex | |
151 @end iftex | |
152 @ifinfo | |
153 @code{pi/180} | |
154 @end ifinfo | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
155 (e.g., @code{sin (30 * pi/180)} returns the sine of 30 degrees). |
3294 | 156 |
3321 | 157 @DOCSTRING(sin) |
158 @DOCSTRING(cos) | |
159 @DOCSTRING(tan) | |
160 @DOCSTRING(sec) | |
161 @DOCSTRING(csc) | |
162 @DOCSTRING(cot) | |
3294 | 163 |
3321 | 164 @DOCSTRING(asin) |
165 @DOCSTRING(acos) | |
166 @DOCSTRING(atan) | |
167 @DOCSTRING(asec) | |
168 @DOCSTRING(acsc) | |
169 @DOCSTRING(acot) | |
3294 | 170 |
3321 | 171 @DOCSTRING(sinh) |
172 @DOCSTRING(cosh) | |
173 @DOCSTRING(tanh) | |
174 @DOCSTRING(sech) | |
3428 | 175 @DOCSTRING(csch) |
3321 | 176 @DOCSTRING(coth) |
3294 | 177 |
3321 | 178 @DOCSTRING(asinh) |
179 @DOCSTRING(acosh) | |
180 @DOCSTRING(atanh) | |
181 @DOCSTRING(asech) | |
182 @DOCSTRING(acsch) | |
183 @DOCSTRING(acoth) | |
3294 | 184 |
7001 | 185 Each of these functions expects a single argument. For matrix arguments, |
3294 | 186 they work on an element by element basis. For example, |
187 | |
188 @example | |
189 @group | |
190 sin ([1, 2; 3, 4]) | |
191 @result{} 0.84147 0.90930 | |
192 0.14112 -0.75680 | |
193 @end group | |
194 @end example | |
195 | |
3321 | 196 @DOCSTRING(atan2) |
197 | |
6502 | 198 In addition to the trigonometric functions that work with radians, |
199 Octave also provides the following functions which work with degrees. | |
200 | |
201 @DOCSTRING(sind) | |
202 @DOCSTRING(cosd) | |
203 @DOCSTRING(tand) | |
204 @DOCSTRING(secd) | |
205 @DOCSTRING(cscd) | |
206 @DOCSTRING(cotd) | |
207 | |
208 @DOCSTRING(asind) | |
209 @DOCSTRING(acosd) | |
210 @DOCSTRING(atand) | |
211 @DOCSTRING(asecd) | |
212 @DOCSTRING(acscd) | |
213 @DOCSTRING(acotd) | |
3294 | 214 |
4169 | 215 @node Sums and Products |
3294 | 216 @section Sums and Products |
217 | |
3321 | 218 @DOCSTRING(sum) |
3294 | 219 |
3321 | 220 @DOCSTRING(prod) |
3294 | 221 |
3321 | 222 @DOCSTRING(cumsum) |
3294 | 223 |
3321 | 224 @DOCSTRING(cumprod) |
3294 | 225 |
3321 | 226 @DOCSTRING(sumsq) |
3294 | 227 |
6770 | 228 @DOCSTRING(accumarray) |
229 | |
4169 | 230 @node Special Functions |
3294 | 231 @section Special Functions |
232 | |
3459 | 233 @DOCSTRING(besselj) |
234 | |
235 @DOCSTRING(airy) | |
3294 | 236 |
3321 | 237 @DOCSTRING(beta) |
3294 | 238 |
3444 | 239 @DOCSTRING(betainc) |
3294 | 240 |
6502 | 241 @DOCSTRING(betaln) |
242 | |
3321 | 243 @DOCSTRING(bincoeff) |
3294 | 244 |
3321 | 245 @DOCSTRING(erf) |
3294 | 246 |
3321 | 247 @DOCSTRING(erfc) |
3294 | 248 |
3321 | 249 @DOCSTRING(erfinv) |
3294 | 250 |
3321 | 251 @DOCSTRING(gamma) |
3294 | 252 |
3444 | 253 @DOCSTRING(gammainc) |
3294 | 254 |
6502 | 255 @DOCSTRING(legendre) |
256 | |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
257 @anchor{doc-gammaln} |
3321 | 258 @DOCSTRING(lgamma) |
259 | |
260 @DOCSTRING(cross) | |
3294 | 261 |
3321 | 262 @DOCSTRING(commutation_matrix) |
3294 | 263 |
3321 | 264 @DOCSTRING(duplication_matrix) |
3294 | 265 |
4169 | 266 @node Coordinate Transformations |
3803 | 267 @section Coordinate Transformations |
268 | |
269 @DOCSTRING(cart2pol) | |
270 | |
271 @DOCSTRING(pol2cart) | |
272 | |
273 @DOCSTRING(cart2sph) | |
274 | |
275 @DOCSTRING(sph2cart) | |
276 | |
4169 | 277 @node Mathematical Constants |
3294 | 278 @section Mathematical Constants |
279 | |
3321 | 280 @DOCSTRING(I) |
281 | |
282 @DOCSTRING(Inf) | |
3294 | 283 |
3321 | 284 @DOCSTRING(NaN) |
3294 | 285 |
3321 | 286 @DOCSTRING(pi) |
3294 | 287 |
3321 | 288 @DOCSTRING(e) |
289 | |
290 @DOCSTRING(eps) | |
3294 | 291 |
3321 | 292 @DOCSTRING(realmax) |
3294 | 293 |
3321 | 294 @DOCSTRING(realmin) |