cmplx
2 分钟阅读
cmplx
https://pkg.go.dev/math/cmplx@go1.20.1
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.
常量
This section is empty.
变量
This section is empty.
函数
func Abs
|
|
Abs returns the absolute value (also called the modulus) of x.
Example
|
|
func Acos
|
|
Acos returns the inverse cosine of x.
func Acosh
|
|
Acosh returns the inverse hyperbolic cosine of x.
func Asin
|
|
Asin returns the inverse sine of x.
func Asinh
|
|
Asinh returns the inverse hyperbolic sine of x.
func Atan
|
|
Atan returns the inverse tangent of x.
func Atanh
|
|
Atanh returns the inverse hyperbolic tangent of x.
func Conj
|
|
Conj returns the complex conjugate of x.
func Cos
|
|
Cos returns the cosine of x.
func Cosh
|
|
Cosh returns the hyperbolic cosine of x.
func Cot
|
|
Cot returns the cotangent of x.
func Exp
|
|
Exp returns e**x, the base-e exponential of x.
Example
|
|
func Inf
|
|
Inf returns a complex infinity, complex(+Inf, +Inf).
func IsInf
|
|
IsInf reports whether either real(x) or imag(x) is an infinity.
func IsNaN
|
|
IsNaN reports whether either real(x) or imag(x) is NaN and neither is an infinity.
func Log
|
|
Log returns the natural logarithm of x.
func Log10
|
|
Log10 returns the decimal logarithm of x.
func NaN
|
|
NaN returns a complex “not-a-number” value.
func Phase
|
|
Phase returns the phase (also called the argument) of x. The returned value is in the range [-Pi, Pi].
func Polar
|
|
Polar returns the absolute value r and phase θ of x, such that x = r * e**θi. The phase is in the range [-Pi, Pi].
Example
|
|
func Pow
|
|
Pow returns x**y, the base-x exponential of y. For generalized compatibility with 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
|
|
Rect returns the complex number x with polar coordinates r, θ.
func Sin
|
|
Sin returns the sine of x.
func Sinh
|
|
Sinh returns the hyperbolic sine of x.
func Sqrt
|
|
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).
func Tan
|
|
Tan returns the tangent of x.
func Tanh
|
|
Tanh returns the hyperbolic tangent of x.
类型
This section is empty.