Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Complex a :: * -> * = ~a :+ ~a
- real :: Elt a => Exp (Complex a) -> Exp a
- imag :: Elt a => Exp (Complex a) -> Exp a
- mkPolar :: (Elt a, IsFloating a) => Exp a -> Exp a -> Exp (Complex a)
- cis :: (Elt a, IsFloating a) => Exp a -> Exp (Complex a)
- polar :: (Elt a, IsFloating a) => Exp (Complex a) -> Exp (a, a)
- magnitude :: (Elt a, IsFloating a) => Exp (Complex a) -> Exp a
- phase :: (Elt a, IsFloating a) => Exp (Complex a) -> Exp a
- conjugate :: (Elt a, IsNum a) => Exp (Complex a) -> Exp (Complex a)
Rectangular from
Complex numbers are an algebraic type.
For a complex number z
,
is a number with the magnitude of abs
zz
,
but oriented in the positive real direction, whereas
has the phase of signum
zz
, but unit magnitude.
The Foldable
and Traversable
instances traverse the real part first.
~a :+ ~a infix 6 | forms a complex number from its real and imaginary rectangular components. |
Monad Complex | |
Functor Complex | |
Applicative Complex | |
Foldable Complex | |
Traversable Complex | |
Generic1 Complex | |
(RealFloat a, Unbox a) => Vector Vector (Complex a) | |
(RealFloat a, Unbox a) => MVector MVector (Complex a) | |
Eq a => Eq (Complex a) | |
RealFloat a => Floating (Complex a) | |
RealFloat a => Fractional (Complex a) | |
Data a => Data (Complex a) | |
RealFloat a => Num (Complex a) | |
Read a => Read (Complex a) | |
Show a => Show (Complex a) | |
Generic (Complex a) | |
Storable a => Storable (Complex a) | |
(RealFloat a, Unbox a) => Unbox (Complex a) | |
type Rep1 Complex | |
data MVector s (Complex a) | |
type Rep (Complex a) | |
data Vector (Complex a) | |
type Plain (Complex a) # | |
Polar form
mkPolar :: (Elt a, IsFloating a) => Exp a -> Exp a -> Exp (Complex a) #
Form a complex number from polar components of magnitude and phase.
magnitude :: (Elt a, IsFloating a) => Exp (Complex a) -> Exp a #
The non-negative magnitude of a complex number
Conjugate
conjugate :: (Elt a, IsNum a) => Exp (Complex a) -> Exp (Complex a) #
Return the complex conjugate of a complex number, defined as
conjugate(Z) = X - iY