| Copyright | (c) The University of Glasgow 2001 |
|---|---|
| License | BSD-style (see the file libraries/base/LICENSE) |
| Maintainer | libraries@haskell.org |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
Data.Complex
Contents
Description
Complex numbers.
Synopsis
- data Complex a = !a :+ !a
- realPart :: Complex a -> a
- imagPart :: Complex a -> a
- mkPolar :: Floating a => a -> a -> Complex a
- cis :: Floating a => a -> Complex a
- polar :: RealFloat a => Complex a -> (a, a)
- magnitude :: RealFloat a => Complex a -> a
- phase :: RealFloat a => Complex a -> a
- conjugate :: Num a => Complex a -> Complex a
Rectangular form
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.
Constructors
Instances
Methods
exp :: Complex a -> Complex a Source
log :: Complex a -> Complex a Source
sqrt :: Complex a -> Complex a Source
(**) :: Complex a -> Complex a -> Complex a Source
logBase :: Complex a -> Complex a -> Complex a Source
sin :: Complex a -> Complex a Source
cos :: Complex a -> Complex a Source
tan :: Complex a -> Complex a Source
asin :: Complex a -> Complex a Source
acos :: Complex a -> Complex a Source
atan :: Complex a -> Complex a Source
sinh :: Complex a -> Complex a Source
cosh :: Complex a -> Complex a Source
tanh :: Complex a -> Complex a Source
asinh :: Complex a -> Complex a Source
Methods
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Complex a -> c (Complex a) Source
gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Complex a) Source
toConstr :: Complex a -> Constr Source
dataTypeOf :: Complex a -> DataType Source
dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Complex a)) Source
dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Complex a)) Source
gmapT :: (forall b. Data b => b -> b) -> Complex a -> Complex a Source
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r Source
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r Source
gmapQ :: (forall d. Data d => d -> u) -> Complex a -> [u] Source
gmapQi :: Int -> (forall d. Data d => d -> u) -> Complex a -> u Source
gmapM :: Monad m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) Source
gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) Source
gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) Source
Methods
(+) :: Complex a -> Complex a -> Complex a Source
(-) :: Complex a -> Complex a -> Complex a Source
(*) :: Complex a -> Complex a -> Complex a Source
negate :: Complex a -> Complex a Source
abs :: Complex a -> Complex a Source
signum :: Complex a -> Complex a Source
fromInteger :: Integer -> Complex a Source
Methods
sizeOf :: Complex a -> Int Source
alignment :: Complex a -> Int Source
peekElemOff :: Ptr (Complex a) -> Int -> IO (Complex a) Source
pokeElemOff :: Ptr (Complex a) -> Int -> Complex a -> IO () Source
peekByteOff :: Ptr b -> Int -> IO (Complex a) Source
pokeByteOff :: Ptr b -> Int -> Complex a -> IO () Source
Polar form
mkPolar :: Floating a => a -> a -> Complex a Source
Form a complex number from polar components of magnitude and phase.