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

Copyright (c) Claude Heiland-Allen 2012 BSD3 claude@mathr.co.uk unstable MultiParamTypeClasses, FunctionalDependencies Safe Haskell98

Data.Complex.Generic.Class

Description

Classes for complex number operations.

Synopsis

# Documentation

class ComplexRect c r | c -> r where Source #

Rectangular form.

Minimal complete definition

Methods

mkRect :: r -> r -> c Source #

Construction.

real :: r -> c Source #

Construction with imagPart 0.

imag :: r -> c Source #

Construction with realPart 0.

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

Deconstruction.

realPart :: c -> r Source #

Get the real part.

imagPart :: c -> r Source #

Get the imaginary part.

conjugate :: c -> c Source #

Conjugation.

magnitudeSquared :: c -> r Source #

Squared magnitude.

sqr :: c -> c Source #

Complex square.

(.*) :: r -> c -> c infixl 7 Source #

Real-complex multiplication.

(*.) :: c -> r -> c infixl 7 Source #

Complex-real multiplication.

Instances

 Source # Methods Source # Methods Source # Methodsrect :: Complex Int -> (Int, Int) Source # Source # Methodsrect :: Complex Int8 -> (Int8, Int8) Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methodsrect :: Complex Word -> (Word, Word) Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Integral t => ComplexRect (Complex (Ratio t)) (Ratio t) Source # MethodsmkRect :: Ratio t -> Ratio t -> Complex (Ratio t) Source #real :: Ratio t -> Complex (Ratio t) Source #imag :: Ratio t -> Complex (Ratio t) Source #rect :: Complex (Ratio t) -> (Ratio t, Ratio t) Source #realPart :: Complex (Ratio t) -> Ratio t Source #imagPart :: Complex (Ratio t) -> Ratio t Source #conjugate :: Complex (Ratio t) -> Complex (Ratio t) Source #sqr :: Complex (Ratio t) -> Complex (Ratio t) Source #(.*) :: Ratio t -> Complex (Ratio t) -> Complex (Ratio t) Source #(*.) :: Complex (Ratio t) -> Ratio t -> Complex (Ratio t) Source # HasResolution t => ComplexRect (Complex (Fixed t)) (Fixed t) Source # MethodsmkRect :: Fixed t -> Fixed t -> Complex (Fixed t) Source #real :: Fixed t -> Complex (Fixed t) Source #imag :: Fixed t -> Complex (Fixed t) Source #rect :: Complex (Fixed t) -> (Fixed t, Fixed t) Source #realPart :: Complex (Fixed t) -> Fixed t Source #imagPart :: Complex (Fixed t) -> Fixed t Source #conjugate :: Complex (Fixed t) -> Complex (Fixed t) Source #sqr :: Complex (Fixed t) -> Complex (Fixed t) Source #(.*) :: Fixed t -> Complex (Fixed t) -> Complex (Fixed t) Source #(*.) :: Complex (Fixed t) -> Fixed t -> Complex (Fixed t) Source #

(/.) :: (Fractional r, ComplexRect c r) => c -> r -> c infixl 6 Source #

Complex-real division.

(.+) :: ComplexRect c r => r -> r -> c infix 6 Source #

A synonym for mkRect.

class ComplexPolar c r | c -> r where Source #

Polar form.

Minimal complete definition

Methods

mkPolar :: r -> r -> c Source #

cis :: r -> c Source #

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

magnitude :: c -> r Source #

Magnitude.

phase :: c -> r Source #

Phase in (-pi, pi].

Instances

 Source # Methods Source # Methods Source # Methods Source # Methods