diff options
Diffstat (limited to 'devdocs/go/math%2Fcmplx%2Findex.html')
| -rw-r--r-- | devdocs/go/math%2Fcmplx%2Findex.html | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/devdocs/go/math%2Fcmplx%2Findex.html b/devdocs/go/math%2Fcmplx%2Findex.html new file mode 100644 index 00000000..8d64ef40 --- /dev/null +++ b/devdocs/go/math%2Fcmplx%2Findex.html @@ -0,0 +1,74 @@ +<h1> Package cmplx </h1> <ul id="short-nav"> +<li><code>import "math/cmplx"</code></li> +<li><a href="#pkg-overview" class="overviewLink">Overview</a></li> +<li><a href="#pkg-index" class="indexLink">Index</a></li> +<li><a href="#pkg-examples" class="examplesLink">Examples</a></li> +</ul> <h2 id="pkg-overview">Overview </h2> <p>Package cmplx provides basic constants and mathematical functions for complex numbers. Special case handling conforms to the C99 standard Annex G IEC 60559-compatible complex arithmetic. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav"> +<li><a href="#Abs">func Abs(x complex128) float64</a></li> +<li><a href="#Acos">func Acos(x complex128) complex128</a></li> +<li><a href="#Acosh">func Acosh(x complex128) complex128</a></li> +<li><a href="#Asin">func Asin(x complex128) complex128</a></li> +<li><a href="#Asinh">func Asinh(x complex128) complex128</a></li> +<li><a href="#Atan">func Atan(x complex128) complex128</a></li> +<li><a href="#Atanh">func Atanh(x complex128) complex128</a></li> +<li><a href="#Conj">func Conj(x complex128) complex128</a></li> +<li><a href="#Cos">func Cos(x complex128) complex128</a></li> +<li><a href="#Cosh">func Cosh(x complex128) complex128</a></li> +<li><a href="#Cot">func Cot(x complex128) complex128</a></li> +<li><a href="#Exp">func Exp(x complex128) complex128</a></li> +<li><a href="#Inf">func Inf() complex128</a></li> +<li><a href="#IsInf">func IsInf(x complex128) bool</a></li> +<li><a href="#IsNaN">func IsNaN(x complex128) bool</a></li> +<li><a href="#Log">func Log(x complex128) complex128</a></li> +<li><a href="#Log10">func Log10(x complex128) complex128</a></li> +<li><a href="#NaN">func NaN() complex128</a></li> +<li><a href="#Phase">func Phase(x complex128) float64</a></li> +<li><a href="#Polar">func Polar(x complex128) (r, θ float64)</a></li> +<li><a href="#Pow">func Pow(x, y complex128) complex128</a></li> +<li><a href="#Rect">func Rect(r, θ float64) complex128</a></li> +<li><a href="#Sin">func Sin(x complex128) complex128</a></li> +<li><a href="#Sinh">func Sinh(x complex128) complex128</a></li> +<li><a href="#Sqrt">func Sqrt(x complex128) complex128</a></li> +<li><a href="#Tan">func Tan(x complex128) complex128</a></li> +<li><a href="#Tanh">func Tanh(x complex128) complex128</a></li> +</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Abs">Abs</a></dd> <dd><a class="exampleLink" href="#example_Exp">Exp</a></dd> <dd><a class="exampleLink" href="#example_Polar">Polar</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>abs.go</span> <span>asin.go</span> <span>conj.go</span> <span>exp.go</span> <span>isinf.go</span> <span>isnan.go</span> <span>log.go</span> <span>phase.go</span> <span>polar.go</span> <span>pow.go</span> <span>rect.go</span> <span>sin.go</span> <span>sqrt.go</span> <span>tan.go</span> </p> <h2 id="Abs">func <span>Abs</span> </h2> <pre data-language="go">func Abs(x complex128) float64</pre> <p>Abs returns the absolute value (also called the modulus) of x. </p> <h4 id="example_Abs"> <span class="text">Example</span> +</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.1f", cmplx.Abs(3+4i)) +</pre> <p>Output:</p> <pre class="output" data-language="go">5.0 +</pre> <h2 id="Acos">func <span>Acos</span> </h2> <pre data-language="go">func Acos(x complex128) complex128</pre> <p>Acos returns the inverse cosine of x. </p> +<h2 id="Acosh">func <span>Acosh</span> </h2> <pre data-language="go">func Acosh(x complex128) complex128</pre> <p>Acosh returns the inverse hyperbolic cosine of x. </p> +<h2 id="Asin">func <span>Asin</span> </h2> <pre data-language="go">func Asin(x complex128) complex128</pre> <p>Asin returns the inverse sine of x. </p> +<h2 id="Asinh">func <span>Asinh</span> </h2> <pre data-language="go">func Asinh(x complex128) complex128</pre> <p>Asinh returns the inverse hyperbolic sine of x. </p> +<h2 id="Atan">func <span>Atan</span> </h2> <pre data-language="go">func Atan(x complex128) complex128</pre> <p>Atan returns the inverse tangent of x. </p> +<h2 id="Atanh">func <span>Atanh</span> </h2> <pre data-language="go">func Atanh(x complex128) complex128</pre> <p>Atanh returns the inverse hyperbolic tangent of x. </p> +<h2 id="Conj">func <span>Conj</span> </h2> <pre data-language="go">func Conj(x complex128) complex128</pre> <p>Conj returns the complex conjugate of x. </p> +<h2 id="Cos">func <span>Cos</span> </h2> <pre data-language="go">func Cos(x complex128) complex128</pre> <p>Cos returns the cosine of x. </p> +<h2 id="Cosh">func <span>Cosh</span> </h2> <pre data-language="go">func Cosh(x complex128) complex128</pre> <p>Cosh returns the hyperbolic cosine of x. </p> +<h2 id="Cot">func <span>Cot</span> </h2> <pre data-language="go">func Cot(x complex128) complex128</pre> <p>Cot returns the cotangent of x. </p> +<h2 id="Exp">func <span>Exp</span> </h2> <pre data-language="go">func Exp(x complex128) complex128</pre> <p>Exp returns e**x, the base-e exponential of x. </p> <h4 id="example_Exp"> <span class="text">Example</span> +</h4> <p>ExampleExp computes Euler's identity. </p> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.1f", cmplx.Exp(1i*math.Pi)+1) +</pre> <p>Output:</p> <pre class="output" data-language="go">(0.0+0.0i) +</pre> <h2 id="Inf">func <span>Inf</span> </h2> <pre data-language="go">func Inf() complex128</pre> <p>Inf returns a complex infinity, complex(+Inf, +Inf). </p> +<h2 id="IsInf">func <span>IsInf</span> </h2> <pre data-language="go">func IsInf(x complex128) bool</pre> <p>IsInf reports whether either real(x) or imag(x) is an infinity. </p> +<h2 id="IsNaN">func <span>IsNaN</span> </h2> <pre data-language="go">func IsNaN(x complex128) bool</pre> <p>IsNaN reports whether either real(x) or imag(x) is NaN and neither is an infinity. </p> +<h2 id="Log">func <span>Log</span> </h2> <pre data-language="go">func Log(x complex128) complex128</pre> <p>Log returns the natural logarithm of x. </p> +<h2 id="Log10">func <span>Log10</span> </h2> <pre data-language="go">func Log10(x complex128) complex128</pre> <p>Log10 returns the decimal logarithm of x. </p> +<h2 id="NaN">func <span>NaN</span> </h2> <pre data-language="go">func NaN() complex128</pre> <p>NaN returns a complex “not-a-number” value. </p> +<h2 id="Phase">func <span>Phase</span> </h2> <pre data-language="go">func Phase(x complex128) float64</pre> <p>Phase returns the phase (also called the argument) of x. The returned value is in the range [-Pi, Pi]. </p> +<h2 id="Polar">func <span>Polar</span> </h2> <pre data-language="go">func Polar(x complex128) (r, θ float64)</pre> <p>Polar returns the absolute value r and phase θ of x, such that x = r * e**θi. The phase is in the range [-Pi, Pi]. </p> <h4 id="example_Polar"> <span class="text">Example</span> +</h4> <p>Code:</p> <pre class="code" data-language="go">r, theta := cmplx.Polar(2i) +fmt.Printf("r: %.1f, θ: %.1f*π", r, theta/math.Pi) +</pre> <p>Output:</p> <pre class="output" data-language="go">r: 2.0, θ: 0.5*π +</pre> <h2 id="Pow">func <span>Pow</span> </h2> <pre data-language="go">func Pow(x, y complex128) complex128</pre> <p>Pow returns x**y, the base-x exponential of y. For generalized compatibility with <span>math.Pow</span>: </p> +<pre data-language="go">Pow(0, ±0) returns 1+0i +Pow(0, c) for real(c)<0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i. +</pre> <h2 id="Rect">func <span>Rect</span> </h2> <pre data-language="go">func Rect(r, θ float64) complex128</pre> <p>Rect returns the complex number x with polar coordinates r, θ. </p> +<h2 id="Sin">func <span>Sin</span> </h2> <pre data-language="go">func Sin(x complex128) complex128</pre> <p>Sin returns the sine of x. </p> +<h2 id="Sinh">func <span>Sinh</span> </h2> <pre data-language="go">func Sinh(x complex128) complex128</pre> <p>Sinh returns the hyperbolic sine of x. </p> +<h2 id="Sqrt">func <span>Sqrt</span> </h2> <pre data-language="go">func Sqrt(x complex128) complex128</pre> <p>Sqrt returns the square root of x. The result r is chosen so that real(r) ≥ 0 and imag(r) has the same sign as imag(x). </p> +<h2 id="Tan">func <span>Tan</span> </h2> <pre data-language="go">func Tan(x complex128) complex128</pre> <p>Tan returns the tangent of x. </p> +<h2 id="Tanh">func <span>Tanh</span> </h2> <pre data-language="go">func Tanh(x complex128) complex128</pre> <p>Tanh returns the hyperbolic tangent of x. </p><div class="_attribution"> + <p class="_attribution-p"> + © Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br> + <a href="http://golang.org/pkg/math/cmplx/" class="_attribution-link">http://golang.org/pkg/math/cmplx/</a> + </p> +</div> |
