complex-generic-0.1.1: complex numbers with non-mandatory RealFloat

Portability MultiParamTypeClasses, FunctionalDependencies unstable claude@mathr.co.uk Safe-Inferred

Data.Complex.Generic.Class

Description

Classes for complex number operations.

Synopsis

Documentation

class ComplexRect c r | c -> r whereSource

Rectangular form.

Methods

Arguments

 :: r real -> r imaginary -> c

Construction.

Arguments

 :: r real -> c

Construction with imagPart 0.

Arguments

 :: r imaginary -> c

Construction with realPart 0.

rect :: c -> (r, r)Source

Deconstruction.

realPart :: c -> rSource

Get the real part.

imagPart :: c -> rSource

Get the imaginary part.

conjugate :: c -> cSource

Conjugation.

magnitudeSquared :: c -> rSource

Squared magnitude.

sqr :: c -> cSource

Complex square.

(.*) :: r -> c -> cSource

Real-complex multiplication.

(*.) :: c -> r -> cSource

Complex-real multiplication.

Instances

 ComplexRect (Complex Double) Double ComplexRect (Complex Float) Float ComplexRect (Complex Int) Int ComplexRect (Complex Int8) Int8 ComplexRect (Complex Int16) Int16 ComplexRect (Complex Int32) Int32 ComplexRect (Complex Int64) Int64 ComplexRect (Complex Integer) Integer ComplexRect (Complex Word) Word ComplexRect (Complex Word8) Word8 ComplexRect (Complex Word16) Word16 ComplexRect (Complex Word32) Word32 ComplexRect (Complex Word64) Word64 ComplexRect (Complex CFloat) CFloat ComplexRect (Complex CDouble) CDouble Integral t => ComplexRect (Complex (Ratio t)) (Ratio t) HasResolution t => ComplexRect (Complex (Fixed t)) (Fixed t)

(/.) :: (Fractional r, ComplexRect c r) => c -> r -> cSource

Complex-real division.

(.+) :: ComplexRect c r => r -> r -> cSource

A synonym for mkRect.

class ComplexPolar c r | c -> r whereSource

Polar form.

Methods

mkPolar :: r -> r -> cSource

cis :: r -> cSource

polar :: c -> (r, r)Source

magnitude :: c -> rSource

Magnitude.

phase :: c -> rSource

Phase in (-pi, pi].

Instances

 ComplexPolar (Complex Double) Double ComplexPolar (Complex Float) Float ComplexPolar (Complex CFloat) CFloat ComplexPolar (Complex CDouble) CDouble