jonathanfishbein1/complex-numbers/2.0.0

NOTE: the latest version is 11.0.1

ComplexNumbers

A module for complex numbers

Types

type Real r
= Real r

Real portion

type Imaginary i
= Imaginary i

Imaginary portion

type Modulus m
= Modulus m

Modulus or magnitude portion

type Theta t
= Theta t

Angle in real-complex plane of modulus

= ComplexNumberCartesian (Real a) (Imaginary a)

Cartesian representation of a complex number

= ComplexNumberPolar (Modulus a) (Theta a)

Polar representation of a complex number

Arithmetic operations on complex numbers

The number i

Extracts the real part of a complex number

Extracts the imaginary part of a complex number

Extracts the modulus part of a complex number

Extracts the imaginary part of a complex number

Add two complex numbers together

sum : Monoid (ComplexNumberCartesian number)

Monoidally add two complex numbers together

Multiply two complex numbers together

Monoidally multiply two complex numbers together

Subtract two complex numbers together

Divide two complex numbers together

Calculate the modulus of a complex number

Calculate the conjugate of a complex number

Convert from the Cartesian representation of a complex number to the polar representation

Convert from the polar representation of a complex number to the Cartesian representation

Multiply two complex numbers in polar representations together

-> Result String (ComplexNumberPolar Float)

Divide two complex numbers in polar representations together

power : number -> ComplexNumberPolar number -> ComplexNumberPolar number

Calculate a complex number raised to a power

Map over a complex number

Map over a complex number in polar representation

Place a value in the minimal Complex Number Cartesian context

Place a value in the minimal Complex Number polar context

Apply for Complex Number Cartesian representaiton applicative

Apply for Complex Number polar representaiton applicative

Monadic bind for Complex Number Cartesian representaiton

Monadic bind for Complex Number polar representaiton