cmplx

package
v0.0.0-...-eb2585e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[R rules.Real, C rules.Complex](x C) R

Abs returns the absolute value (also called the modulus) of x.

func Acos

func Acos[C rules.Complex](x C) C

Acos returns the inverse cosine of x.

func Acosh

func Acosh[C rules.Complex](x C) C

Acosh returns the inverse hyperbolic cosine of x.

func Asin

func Asin[C rules.Complex](x C) C

Asin returns the inverse sine of x.

func Asinh

func Asinh[C rules.Complex](x C) C

Asinh returns the inverse hyperbolic sine of x.

func Atan

func Atan[C rules.Complex](x C) C

Atan returns the inverse tangent of x.

func Atanh

func Atanh[C rules.Complex](x C) C

Atanh returns the inverse hyperbolic tangent of x.

func Conj

func Conj[C rules.Complex](x C) C

Conj returns the complex conjugate of x.

func Cos

func Cos[C rules.Complex](x C) C

Cos returns the cosine of x.

func Cosh

func Cosh[C rules.Complex](x C) C

Cosh returns the hyperbolic cosine of x.

func Cot

func Cot[C rules.Complex](x C) C

Cot returns the cotangent of x.

func Exp

func Exp[C rules.Complex](x C) C

Exp returns e**x, the base-e exponential of x.

func Imag

func Imag[R rules.Real, C rules.Complex](z C) R

func Inf

func Inf[C rules.Complex]() C

Inf returns a complex infinity, complex(+Inf, +Inf).

func IsInf

func IsInf[C rules.Complex](x C) bool

IsInf reports whether either real(x) or imag(x) is an infinity.

func IsNaN

func IsNaN[C rules.Complex](x C) bool

IsNaN reports whether either real(x) or imag(x) is NaN and neither is an infinity.

func Log

func Log[C rules.Complex](x C) C

Log returns the natural logarithm of x.

func Log10

func Log10[C rules.Complex](x C) C

Log10 returns the decimal logarithm of x.

func NaN

func NaN[C rules.Complex]() C

NaN returns a complex “not-a-number” value.

func Phase

func Phase[R rules.Real, C rules.Complex](x C) R

Phase returns the phase (also called the argument) of x. The returned value is in the range [-Pi, Pi].

func Polar

func Polar[R rules.Real, C rules.Complex](x C) (r, θ R)

Polar returns the absolute value r and phase θ of x, such that x = r * e**θi. The phase is in the range [-Pi, Pi].

func Pow

func Pow[C rules.Complex](x, y C) C

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 Real

func Real[R rules.Real, C rules.Complex](z C) R

func Rect

func Rect[C rules.Complex, R rules.Real](r, θ R) C

func Sin

func Sin[C rules.Complex](x C) C

Sin returns the sine of x.

func Sinh

func Sinh[C rules.Complex](x C) C

Sinh returns the hyperbolic sine of x.

func Sqrt

func Sqrt[C rules.Complex](x C) C

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

func Tan[C rules.Complex](x C) C

Tan returns the tangent of x.

func Tanh

func Tanh[C rules.Complex](x C) C

Tanh returns the hyperbolic tangent of x.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL