File: arith.txi

package info (click to toggle)
octave2.1 1%3A2.1.73-13
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 37,028 kB
  • ctags: 20,874
  • sloc: cpp: 106,508; fortran: 46,978; ansic: 5,720; sh: 4,800; makefile: 3,186; yacc: 3,132; lex: 2,892; lisp: 1,715; perl: 778; awk: 174; exp: 134
file content (222 lines) | stat: -rw-r--r-- 3,606 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
@c Copyright (C) 1996, 1997 John W. Eaton
@c This is part of the Octave manual.
@c For copying conditions, see the file gpl.texi.

@node Arithmetic
@chapter Arithmetic

Unless otherwise noted, all of the functions described in this chapter
will work for real and complex scalar or matrix arguments.

@menu
* Utility Functions::           
* Complex Arithmetic::          
* Trigonometry::                
* Sums and Products::           
* Special Functions::           
* Coordinate Transformations::
* Mathematical Constants::      
@end menu

@node Utility Functions
@section Utility Functions

The following functions are available for working with complex numbers.
Each expects a single argument.  They are called @dfn{mapping functions}
because when given a matrix argument, they apply the given function to
each element of the matrix.

@DOCSTRING(ceil)

@DOCSTRING(exp)

@DOCSTRING(fix)

@DOCSTRING(floor)

@DOCSTRING(gcd)

@DOCSTRING(lcm)

@DOCSTRING(log)

@DOCSTRING(log10)

@DOCSTRING(log2)

@DOCSTRING(max)

@DOCSTRING(min)

@DOCSTRING(mod)

@DOCSTRING(nextpow2)

@DOCSTRING(pow2)

@DOCSTRING(rem)

@DOCSTRING(round)

@DOCSTRING(sign)

@DOCSTRING(sqrt)

@node Complex Arithmetic
@section Complex Arithmetic

The following functions are available for working with complex
numbers.  Each expects a single argument.  Given a matrix they work on
an element by element basis.  In the descriptions of the following
functions,
@iftex
@tex
$z$ is the complex number $x + iy$, where $i$ is defined as
$\sqrt{-1}$.
@end tex
@end iftex
@ifinfo
@var{z} is the complex number @var{x} + @var{i}@var{y}, where @var{i} is
defined as @code{sqrt (-1)}.
@end ifinfo

@DOCSTRING(abs)

@DOCSTRING(arg)

@DOCSTRING(conj)

@DOCSTRING(imag)

@DOCSTRING(real)

@node Trigonometry
@section Trigonometry

Octave provides the following trigonometric functions.  Angles are
specified in radians.  To convert from degrees to radians multipy by
@iftex
@tex
$\pi/180$
@end tex
@end iftex
@ifinfo
@code{pi/180}
@end ifinfo
 (e.g. @code{sin (30 * pi/180)} returns the sine of 30 degrees).

@DOCSTRING(sin)
@DOCSTRING(cos)
@DOCSTRING(tan)
@DOCSTRING(sec)
@DOCSTRING(csc)
@DOCSTRING(cot)

@DOCSTRING(asin)
@DOCSTRING(acos)
@DOCSTRING(atan)
@DOCSTRING(asec)
@DOCSTRING(acsc)
@DOCSTRING(acot)

@DOCSTRING(sinh)
@DOCSTRING(cosh)
@DOCSTRING(tanh)
@DOCSTRING(sech)
@DOCSTRING(csch)
@DOCSTRING(coth)

@DOCSTRING(asinh)
@DOCSTRING(acosh)
@DOCSTRING(atanh)
@DOCSTRING(asech)
@DOCSTRING(acsch)
@DOCSTRING(acoth)

Each of these functions expect a single argument.  For matrix arguments,
they work on an element by element basis.  For example,

@example
@group
sin ([1, 2; 3, 4])
     @result{}  0.84147   0.90930
         0.14112  -0.75680
@end group
@end example

@DOCSTRING(atan2)


@node Sums and Products
@section Sums and Products

@DOCSTRING(sum)

@DOCSTRING(prod)

@DOCSTRING(cumsum)

@DOCSTRING(cumprod)

@DOCSTRING(sumsq)

@node Special Functions
@section Special Functions

@DOCSTRING(besselj)

@DOCSTRING(airy)

@DOCSTRING(beta)

@DOCSTRING(betainc)

@DOCSTRING(bincoeff)

@DOCSTRING(erf)

@DOCSTRING(erfc)

@DOCSTRING(erfinv)

@DOCSTRING(gamma)

@DOCSTRING(gammainc)

@DOCSTRING(lgamma)

@DOCSTRING(cross)

@DOCSTRING(commutation_matrix)

@DOCSTRING(duplication_matrix)

@node Coordinate Transformations
@section Coordinate Transformations

@DOCSTRING(cart2pol)

@DOCSTRING(pol2cart)

@DOCSTRING(cart2sph)

@DOCSTRING(sph2cart)

@node Mathematical Constants
@section Mathematical Constants

@DOCSTRING(I)

@DOCSTRING(Inf)

@DOCSTRING(NaN)

@DOCSTRING(pi)

@DOCSTRING(e)

@DOCSTRING(eps)

@DOCSTRING(realmax)

@DOCSTRING(realmin)