Copyright | (c) The University of Glasgow 2001 |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | numericprelude@henning-thielemann.de |
Stability | provisional |
Portability | portable (?) |
Safe Haskell | None |
Language | Haskell98 |
Complex numbers.
Synopsis
- data T a
- imaginaryUnit :: C a => T a
- fromReal :: C a => a -> T a
- (+:) :: a -> a -> T a
- (-:) :: C a => a -> a -> T a
- scale :: C a => a -> T a -> T a
- exp :: C a => T a -> T a
- quarterLeft :: C a => T a -> T a
- quarterRight :: C a => T a -> T a
- fromPolar :: C a => a -> a -> T a
- cis :: C a => a -> T a
- signum :: (C a, C a) => T a -> T a
- signumNorm :: (C a, C a a, C a) => T a -> T a
- toPolar :: (C a, C a) => T a -> (a, a)
- magnitude :: C a => T a -> a
- magnitudeSqr :: C a => T a -> a
- phase :: (C a, C a) => T a -> a
- conjugate :: C a => T a -> T a
- propPolar :: (C a, C a) => T a -> Bool
- class C a => Power a where
- defltPow :: (C a, C a) => Rational -> T a -> T a
Cartesian form
Complex numbers are an algebraic type.
Instances
Functor T Source # | |
C T Source # | |
C a b => C a (T b) Source # | The |
C a b => C a (T b) Source # | |
Defined in Number.Complex | |
(Show v, C v, C v, C a v) => C a (T v) Source # | |
Defined in Number.Complex | |
(C a, C a v) => C a (T v) Source # | |
Defined in Number.Complex | |
(Ord a, C a v) => C a (T v) Source # | |
Defined in Number.Complex | |
(C a, Sqr a b) => C a (T b) Source # | |
Defined in Number.Complex | |
Sqr a b => Sqr a (T b) Source # | |
Defined in Number.Complex | |
Eq a => Eq (T a) Source # | |
(Floating a, Eq a) => Fractional (T a) Source # | |
(Floating a, Eq a) => Num (T a) Source # | |
Read a => Read (T a) Source # | |
Show a => Show (T a) Source # | |
Arbitrary a => Arbitrary (T a) Source # | |
Storable a => Storable (T a) Source # | |
Defined in Number.Complex | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
(Ord a, C a) => C (T a) Source # | |
(Ord a, C a, C a) => C (T a) Source # | |
(C a, C a, C a) => C (T a) Source # | |
C a => C (T a) Source # | |
(C a, C a, Power a) => C (T a) Source # | |
(C a, C a, C a, Power a) => C (T a) Source # | |
imaginaryUnit :: C a => T a Source #
exp :: C a => T a -> T a Source #
Exponential of a complex number with minimal type class constraints.
Polar form
fromPolar :: C a => a -> a -> T a Source #
Form a complex number from polar components of magnitude and phase.
magnitudeSqr :: C a => T a -> a Source #
Conjugate
Properties
Auxiliary classes
class C a => Power a where Source #
We like to build the Complex Algebraic instance
on top of the Algebraic instance of the scalar type.
This poses no problem to sqrt
.
However, root
requires computing the complex argument
which is a transcendent operation.
In order to keep the type class dependencies clean
for more sophisticated algebraic number types,
we introduce a type class which actually performs the radix operation.