Package cmplx

import "math/cmplx"
Overview
Index
Examples

Overview ▾

包cmplx为复数提供基本常数和数学函数.

func Abs

func Abs(x complex128) float64

Abs返回x的绝对值(也称为模数).

Example

5.0

func Acos

func Acos(x complex128) complex128

Acos返回x的反余弦值.

func Acosh

func Acosh(x complex128) complex128

Acosh返回x的反双曲余弦值.

func Asin

func Asin(x complex128) complex128

Asin返回x的反正弦值.

func Asinh

func Asinh(x complex128) complex128

Asinh返回x的反双曲正弦值.

func Atan

func Atan(x complex128) complex128

Atan返回x的反正切.

func Atanh

func Atanh(x complex128) complex128

Atanh返回x的反双曲正切值.

func Conj

func Conj(x complex128) complex128

Conj返回x的复共轭.

func Cos

func Cos(x complex128) complex128

Cos返回x的余弦.

func Cosh

func Cosh(x complex128) complex128

Cosh返回x的双曲余弦值.

func Cot

func Cot(x complex128) complex128

Cot返回x的余切.

func Exp

func Exp(x complex128) complex128

Exp返回e ** x,x的基数e指数.

Example

ExampleExp计算欧拉的身份.

(0.0+0.0i)

func Inf

func Inf() complex128

Inf返回复数无穷大,即complex(+ Inf,+ Inf).

func IsInf

func IsInf(x complex128) bool

IsInf报告real(x)或imag(x)是无穷大.

func IsNaN

func IsNaN(x complex128) bool

IsNaN报告real(x)或imag(x)是NaN还是无穷大.

func Log

func Log(x complex128) complex128

对数返回x的自然对数.

func Log10

func Log10(x complex128) complex128

Log10返回x的十进制对数.

func NaN

func NaN() complex128

NaN返回一个复杂的"非数字"值.

func Phase

func Phase(x complex128) float64

Phase返回x的相位(也称为自变量). 返回的值在[-Pi,Pi]范围内.

func Polar

func Polar(x complex128) (r, θ float64)

Polar返回x的绝对值r和相位θ,使得x = r * e **θi. 相位在[-Pi,Pi]范围内.

Example

r: 2.0, θ: 0.5*π

func Pow

func Pow(x, y complex128) complex128

Pow返回x ** y,即y的基数x指数. 为了与math.Pow通用兼容:

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.

func Rect

func Rect(r, θ float64) complex128

Rect返回具有极坐标r,θ的复数x.

func Sin

func Sin(x complex128) complex128

Sin返回x的正弦.

func Sinh

func Sinh(x complex128) complex128

Sinh返回x的双曲正弦值.

func Sqrt

func Sqrt(x complex128) complex128

Sqrt返回x的平方根. 选择结果r使得real(r)≥0且imag(r)具有与imag(x)相同的符号.

func Tan

func Tan(x complex128) complex128

Tan返回x的切线.

func Tanh

func Tanh(x complex128) complex128

Tanh返回x的双曲正切值.

by  ICOPY.SITE