Skip to main content

complex

A complex number that takes the form of an array of two floats. The first element is the real number and the second represents the imaginary.

re

re() -> float 

Returns the real part of a complex number.

A complex number.

im

im() -> float 

Returns the imaginary part of a complex number.

A complex number.

mul

mul() 

Multiplies two complex numbers together and returns the result VWV W.

The complex number on the left hand side.

The complex number on the right hand side.

conj

conj() -> complex 

Calculates the conjugate of a complex number.

A complex number.

dot

dot() -> float 

Calculates the dot product of two complex numbers in R^2 VWV \cdot W.

The complex number on the left hand side.

The complex number on the right hand side.

normsq

normsq() -> float 

Calculates the squared normal of a complex number.

The complex number.

norm

norm() -> float 

Calculates the normal of a complex number

The complex number.

scale

scale() -> complex 

Multiplies a complex number by a scale factor.

The complex number to scale.

The scale factor.

unit

unit() -> vector 

Returns a unit vector in the direction of a complex number.

The complex number.

inv

inv() -> complex 

Inverts a complex number.

The complex number

div

div() -> complex 

Divides two complex numbers.

The complex number of the numerator.

The complex number of the denominator.

add

add() -> complex 

Adds two complex numbers together.

The complex number on the left hand side.

The complex number on the right hand side.

sub

sub() -> complex 

Subtracts two complex numbers together.

The complex number on the left hand side.

The complex number on the right hand side.

arg

arg() 

Calculates the argument of a complex number.

The complex number.

ang

ang() 

Get the signed angle of two complex numbers from V to W.

A complex number.

A complex number.