@@ -55,13 +55,13 @@ segment that joins the origin to *z*.
55
55
The following functions can be used to convert from the native
56
56
rectangular coordinates to polar coordinates and back.
57
57
58
- .. function :: phase(x )
58
+ .. function :: phase(z )
59
59
60
- Return the phase of *x * (also known as the *argument * of *x *), as a float.
61
- ``phase(x ) `` is equivalent to ``math.atan2(x .imag, x .real) ``. The result
60
+ Return the phase of *z * (also known as the *argument * of *z *), as a float.
61
+ ``phase(z ) `` is equivalent to ``math.atan2(z .imag, z .real) ``. The result
62
62
lies in the range [-\ *π *, *π *], and the branch cut for this operation lies
63
63
along the negative real axis. The sign of the result is the same as the
64
- sign of ``x .imag ``, even when ``x .imag `` is zero::
64
+ sign of ``z .imag ``, even when ``z .imag `` is zero::
65
65
66
66
>>> phase(complex(-1.0, 0.0))
67
67
3.141592653589793
@@ -71,147 +71,147 @@ rectangular coordinates to polar coordinates and back.
71
71
72
72
.. note ::
73
73
74
- The modulus (absolute value) of a complex number *x * can be
74
+ The modulus (absolute value) of a complex number *z * can be
75
75
computed using the built-in :func: `abs ` function. There is no
76
76
separate :mod: `cmath ` module function for this operation.
77
77
78
78
79
- .. function :: polar(x )
79
+ .. function :: polar(z )
80
80
81
- Return the representation of *x * in polar coordinates. Returns a
82
- pair ``(r, phi) `` where *r * is the modulus of *x * and phi is the
83
- phase of *x *. ``polar(x ) `` is equivalent to ``(abs(x ),
84
- phase(x )) ``.
81
+ Return the representation of *z * in polar coordinates. Returns a
82
+ pair ``(r, phi) `` where *r * is the modulus of *z * and * phi * is the
83
+ phase of *z *. ``polar(z ) `` is equivalent to ``(abs(z ),
84
+ phase(z )) ``.
85
85
86
86
87
87
.. function :: rect(r, phi)
88
88
89
- Return the complex number *x * with polar coordinates *r * and *phi *.
89
+ Return the complex number *z * with polar coordinates *r * and *phi *.
90
90
Equivalent to ``complex(r * math.cos(phi), r * math.sin(phi)) ``.
91
91
92
92
93
93
Power and logarithmic functions
94
94
-------------------------------
95
95
96
- .. function :: exp(x )
96
+ .. function :: exp(z )
97
97
98
- Return *e * raised to the power *x *, where *e * is the base of natural
98
+ Return *e * raised to the power *z *, where *e * is the base of natural
99
99
logarithms.
100
100
101
101
102
- .. function :: log(x [, base])
102
+ .. function :: log(z [, base])
103
103
104
- Returns the logarithm of *x * to the given *base *. If the *base * is not
105
- specified, returns the natural logarithm of *x *. There is one branch cut,
104
+ Return the logarithm of *z * to the given *base *. If the *base * is not
105
+ specified, returns the natural logarithm of *z *. There is one branch cut,
106
106
from 0 along the negative real axis to -∞.
107
107
108
108
109
- .. function :: log10(x )
109
+ .. function :: log10(z )
110
110
111
- Return the base-10 logarithm of *x *. This has the same branch cut as
111
+ Return the base-10 logarithm of *z *. This has the same branch cut as
112
112
:func: `log `.
113
113
114
114
115
- .. function :: sqrt(x )
115
+ .. function :: sqrt(z )
116
116
117
- Return the square root of *x *. This has the same branch cut as :func: `log `.
117
+ Return the square root of *z *. This has the same branch cut as :func: `log `.
118
118
119
119
120
120
Trigonometric functions
121
121
-----------------------
122
122
123
- .. function :: acos(x )
123
+ .. function :: acos(z )
124
124
125
- Return the arc cosine of *x *. There are two branch cuts: One extends right
125
+ Return the arc cosine of *z *. There are two branch cuts: One extends right
126
126
from 1 along the real axis to ∞. The other extends left from -1 along the
127
127
real axis to -∞.
128
128
129
129
130
- .. function :: asin(x )
130
+ .. function :: asin(z )
131
131
132
- Return the arc sine of *x *. This has the same branch cuts as :func: `acos `.
132
+ Return the arc sine of *z *. This has the same branch cuts as :func: `acos `.
133
133
134
134
135
- .. function :: atan(x )
135
+ .. function :: atan(z )
136
136
137
- Return the arc tangent of *x *. There are two branch cuts: One extends from
137
+ Return the arc tangent of *z *. There are two branch cuts: One extends from
138
138
``1j `` along the imaginary axis to ``∞j ``. The other extends from ``-1j ``
139
139
along the imaginary axis to ``-∞j ``.
140
140
141
141
142
- .. function :: cos(x )
142
+ .. function :: cos(z )
143
143
144
- Return the cosine of *x *.
144
+ Return the cosine of *z *.
145
145
146
146
147
- .. function :: sin(x )
147
+ .. function :: sin(z )
148
148
149
- Return the sine of *x *.
149
+ Return the sine of *z *.
150
150
151
151
152
- .. function :: tan(x )
152
+ .. function :: tan(z )
153
153
154
- Return the tangent of *x *.
154
+ Return the tangent of *z *.
155
155
156
156
157
157
Hyperbolic functions
158
158
--------------------
159
159
160
- .. function :: acosh(x )
160
+ .. function :: acosh(z )
161
161
162
- Return the inverse hyperbolic cosine of *x *. There is one branch cut,
162
+ Return the inverse hyperbolic cosine of *z *. There is one branch cut,
163
163
extending left from 1 along the real axis to -∞.
164
164
165
165
166
- .. function :: asinh(x )
166
+ .. function :: asinh(z )
167
167
168
- Return the inverse hyperbolic sine of *x *. There are two branch cuts:
168
+ Return the inverse hyperbolic sine of *z *. There are two branch cuts:
169
169
One extends from ``1j `` along the imaginary axis to ``∞j ``. The other
170
170
extends from ``-1j `` along the imaginary axis to ``-∞j ``.
171
171
172
172
173
- .. function :: atanh(x )
173
+ .. function :: atanh(z )
174
174
175
- Return the inverse hyperbolic tangent of *x *. There are two branch cuts: One
175
+ Return the inverse hyperbolic tangent of *z *. There are two branch cuts: One
176
176
extends from ``1 `` along the real axis to ``∞ ``. The other extends from
177
177
``-1 `` along the real axis to ``-∞ ``.
178
178
179
179
180
- .. function :: cosh(x )
180
+ .. function :: cosh(z )
181
181
182
- Return the hyperbolic cosine of *x *.
182
+ Return the hyperbolic cosine of *z *.
183
183
184
184
185
- .. function :: sinh(x )
185
+ .. function :: sinh(z )
186
186
187
- Return the hyperbolic sine of *x *.
187
+ Return the hyperbolic sine of *z *.
188
188
189
189
190
- .. function :: tanh(x )
190
+ .. function :: tanh(z )
191
191
192
- Return the hyperbolic tangent of *x *.
192
+ Return the hyperbolic tangent of *z *.
193
193
194
194
195
195
Classification functions
196
196
------------------------
197
197
198
- .. function :: isfinite(x )
198
+ .. function :: isfinite(z )
199
199
200
- Return ``True `` if both the real and imaginary parts of *x * are finite, and
200
+ Return ``True `` if both the real and imaginary parts of *z * are finite, and
201
201
``False `` otherwise.
202
202
203
203
.. versionadded :: 3.2
204
204
205
205
206
- .. function :: isinf(x )
206
+ .. function :: isinf(z )
207
207
208
- Return ``True `` if either the real or the imaginary part of *x * is an
208
+ Return ``True `` if either the real or the imaginary part of *z * is an
209
209
infinity, and ``False `` otherwise.
210
210
211
211
212
- .. function :: isnan(x )
212
+ .. function :: isnan(z )
213
213
214
- Return ``True `` if either the real or the imaginary part of *x * is a NaN,
214
+ Return ``True `` if either the real or the imaginary part of *z * is a NaN,
215
215
and ``False `` otherwise.
216
216
217
217
0 commit comments