cl3-3.0.0.0: Clifford Algebra of three dimensional space.
Copyright(C) 2017-2022 Nathan Waivio
LicenseBSD3
MaintainerNathan Waivio <nathan.waivio@gmail.com>
StabilityStable
Portabilityunportable
Safe HaskellSafe
LanguageHaskell2010

Algebra.Geometric.Cl3

Description

Library implementing standard functions for the Algebra of Physical Space Cl(3,0)

Synopsis

The type for the Algebra of Physical Space

data Cl3 where Source #

Cl3 provides specialized constructors for sub-algebras and other geometric objects contained in the algebra. Cl(3,0), abbreviated to Cl3, is a Geometric Algebra of 3 dimensional space known as the Algebra of Physical Space (APS). Geometric Algebras are Real Clifford Algebras, double precision floats are used to approximate real numbers in this library. Single and Double grade combinations are specialized using algebraic datatypes and live within the APS.

  • R is the constructor for the Real Scalar Sub-algebra Grade-0
  • V3 is the Three Dimensional Real Vector constructor Grade-1
  • BV is the Bivector constructor Grade-2 an Imaginary Three Dimensional Vector
  • I is the Imaginary constructor Grade-3 and is the Pseudo-Scalar for APS
  • PV is the Paravector constructor with Grade-0 and Grade-1 elements, a Real Scalar plus Vector, (R + V3)
  • H is the Quaternion constructor it is the Even Sub-algebra with Grade-0 and Grade-2 elements, a Real Scalar plus Bivector, (R + BV)
  • C is the Complex constructor it is the Scalar Sub-algebra with Grade-0 and Grade-3 elements, a Real Scalar plus Imaginar Scalar, (R + I)
  • BPV is the Biparavector constructor with Grade-1 and Grade-2 elements, a Real Vector plus Bivector, (V3 + BV)
  • ODD is the Odd constructor with Grade-1 and Grade-3 elements, a Vector plus Imaginary Scalar, (V3 + I)
  • TPV is the Triparavector constructor with Grade-2 and Grade-3 elements, a Bivector plus Imaginary, (BV + I)
  • APS is the constructor for an element in the Algebra of Physical Space with Grade-0 through Grade-3 elements

Constructors

R :: !Double -> Cl3 
V3 :: !Double -> !Double -> !Double -> Cl3 
BV :: !Double -> !Double -> !Double -> Cl3 
I :: !Double -> Cl3 
PV :: !Double -> !Double -> !Double -> !Double -> Cl3 
H :: !Double -> !Double -> !Double -> !Double -> Cl3 
C :: !Double -> !Double -> Cl3 
BPV :: !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> Cl3 
ODD :: !Double -> !Double -> !Double -> !Double -> Cl3 
TPV :: !Double -> !Double -> !Double -> !Double -> Cl3 
APS :: !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> Cl3 

Instances

Instances details
Eq Cl3 Source #

Cl(3,0) has the property of equivalence. Eq is True when all of the grade elements are equivalent.

Instance details

Defined in Algebra.Geometric.Cl3

Methods

(==) :: Cl3 -> Cl3 -> Bool #

(/=) :: Cl3 -> Cl3 -> Bool #

Floating Cl3 Source #

Cl(3,0) has a Floating instance.

Instance details

Defined in Algebra.Geometric.Cl3

Methods

pi :: Cl3 #

exp :: Cl3 -> Cl3 #

log :: Cl3 -> Cl3 #

sqrt :: Cl3 -> Cl3 #

(**) :: Cl3 -> Cl3 -> Cl3 #

logBase :: Cl3 -> Cl3 -> Cl3 #

sin :: Cl3 -> Cl3 #

cos :: Cl3 -> Cl3 #

tan :: Cl3 -> Cl3 #

asin :: Cl3 -> Cl3 #

acos :: Cl3 -> Cl3 #

atan :: Cl3 -> Cl3 #

sinh :: Cl3 -> Cl3 #

cosh :: Cl3 -> Cl3 #

tanh :: Cl3 -> Cl3 #

asinh :: Cl3 -> Cl3 #

acosh :: Cl3 -> Cl3 #

atanh :: Cl3 -> Cl3 #

log1p :: Cl3 -> Cl3 #

expm1 :: Cl3 -> Cl3 #

log1pexp :: Cl3 -> Cl3 #

log1mexp :: Cl3 -> Cl3 #

Fractional Cl3 Source #

Cl(3,0) has a Fractional instance

Instance details

Defined in Algebra.Geometric.Cl3

Methods

(/) :: Cl3 -> Cl3 -> Cl3 #

recip :: Cl3 -> Cl3 #

fromRational :: Rational -> Cl3 #

Data Cl3 Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Cl3 -> c Cl3 #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Cl3 #

toConstr :: Cl3 -> Constr #

dataTypeOf :: Cl3 -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Cl3) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Cl3) #

gmapT :: (forall b. Data b => b -> b) -> Cl3 -> Cl3 #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Cl3 -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Cl3 -> r #

gmapQ :: (forall d. Data d => d -> u) -> Cl3 -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Cl3 -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Cl3 -> m Cl3 #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Cl3 -> m Cl3 #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Cl3 -> m Cl3 #

Num Cl3 Source #

Cl3 has a Num instance. Num is addition, geometric product, negation, abs the largest singular value, and signum.

Instance details

Defined in Algebra.Geometric.Cl3

Methods

(+) :: Cl3 -> Cl3 -> Cl3 #

(-) :: Cl3 -> Cl3 -> Cl3 #

(*) :: Cl3 -> Cl3 -> Cl3 #

negate :: Cl3 -> Cl3 #

abs :: Cl3 -> Cl3 #

signum :: Cl3 -> Cl3 #

fromInteger :: Integer -> Cl3 #

Ord Cl3 Source #

Cl3 has a total preorder ordering in which all pairs are comparable by two real valued functions. Comparison of two reals is just the typical real compare function. Comparison of to imaginary numbers is just the typical comparison function. When reals are compared to anything else it will compare the absolute value of the reals to the magnitude of the other cliffor. Compare of two complex values compares the polar magnitude of the complex numbers. Compare of two vectors compares the vector magnitudes. The Ord instance for the general case is based on the singular values of each cliffor and this Ordering compares the largest singular value abs and then the littlest singular value lsv. Some arbitrary cliffors may return EQ for Ord but not be exactly == equivalent, but they are related by a right and left multiplication of two unitary elements. For instance for the Cliffors A and B, A == B could be False, but compare A B is EQ, because A * V = U * B, where V and U are unitary.

Instance details

Defined in Algebra.Geometric.Cl3

Methods

compare :: Cl3 -> Cl3 -> Ordering #

(<) :: Cl3 -> Cl3 -> Bool #

(<=) :: Cl3 -> Cl3 -> Bool #

(>) :: Cl3 -> Cl3 -> Bool #

(>=) :: Cl3 -> Cl3 -> Bool #

max :: Cl3 -> Cl3 -> Cl3 #

min :: Cl3 -> Cl3 -> Cl3 #

Read Cl3 Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3 Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

showsPrec :: Int -> Cl3 -> ShowS #

show :: Cl3 -> String #

showList :: [Cl3] -> ShowS #

Generic Cl3 Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Associated Types

type Rep Cl3 :: Type -> Type #

Methods

from :: Cl3 -> Rep Cl3 x #

to :: Rep Cl3 x -> Cl3 #

Storable Cl3 Source #

Cl3 instance of Storable uses the APS constructor as its standard interface. "peek" returns a cliffor constructed with APS. "poke" converts a cliffor to APS. For a more compact storing of constructors other than APS use the storable subtypes Cl3_R, Cl3_V3, Cl3_BV, Cl3_I, Cl3_PV, Cl3_H, Cl3_C, Cl3_BPV, Cl3_ODD, Cl3_TPV.

Instance details

Defined in Algebra.Geometric.Cl3

Methods

sizeOf :: Cl3 -> Int #

alignment :: Cl3 -> Int #

peekElemOff :: Ptr Cl3 -> Int -> IO Cl3 #

pokeElemOff :: Ptr Cl3 -> Int -> Cl3 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Cl3 #

pokeByteOff :: Ptr b -> Int -> Cl3 -> IO () #

peek :: Ptr Cl3 -> IO Cl3 #

poke :: Ptr Cl3 -> Cl3 -> IO () #

NFData Cl3 Source #

Cl3 can be reduced to a normal form.

Instance details

Defined in Algebra.Geometric.Cl3

Methods

rnf :: Cl3 -> () #

Random Cl3 Source #

Random instance for the Random library

Instance details

Defined in Algebra.Geometric.Cl3

Methods

randomR :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) #

random :: RandomGen g => g -> (Cl3, g) #

randomRs :: RandomGen g => (Cl3, Cl3) -> g -> [Cl3] #

randoms :: RandomGen g => g -> [Cl3] #

type Rep Cl3 Source # 
Instance details

Defined in Algebra.Geometric.Cl3

type Rep Cl3 = D1 ('MetaData "Cl3" "Algebra.Geometric.Cl3" "cl3-3.0.0.0-2fedqkWsj2XGSvAWIGAfaG" 'False) (((C1 ('MetaCons "R" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :+: C1 ('MetaCons "V3" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))) :+: (C1 ('MetaCons "BV" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))) :+: (C1 ('MetaCons "I" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :+: C1 ('MetaCons "PV" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))))) :+: ((C1 ('MetaCons "H" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))) :+: (C1 ('MetaCons "C" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :+: C1 ('MetaCons "BPV" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))))) :+: (C1 ('MetaCons "ODD" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))) :+: (C1 ('MetaCons "TPV" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))) :+: C1 ('MetaCons "APS" 'PrefixI 'False) (((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))) :*: ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))))))))

Clifford Conjugate and Complex Conjugate

bar :: Cl3 -> Cl3 Source #

bar is a Clifford Conjugate, the vector grades are negated

dag :: Cl3 -> Cl3 Source #

dag is the Complex Conjugate, the imaginary grades are negated

The littlest singular value

lsv :: Cl3 -> Cl3 Source #

lsv the littlest singular value. Useful for testing for invertability.

Constructor Selectors - For optimizing and simplifying calculations

toR :: Cl3 -> Cl3 Source #

toR takes any Cliffor and returns the R portion

toV3 :: Cl3 -> Cl3 Source #

toV3 takes any Cliffor and returns the V3 portion

toBV :: Cl3 -> Cl3 Source #

toBV takes any Cliffor and returns the BV portion

toI :: Cl3 -> Cl3 Source #

toI takes any Cliffor and returns the I portion

toPV :: Cl3 -> Cl3 Source #

toPV takes any Cliffor and returns the PV poriton

toH :: Cl3 -> Cl3 Source #

toH takes any Cliffor and returns the H portion

toC :: Cl3 -> Cl3 Source #

toC takes any Cliffor and returns the C portion

toBPV :: Cl3 -> Cl3 Source #

toBPV takes any Cliffor and returns the BPV portion

toODD :: Cl3 -> Cl3 Source #

toODD takes any Cliffor and returns the ODD portion

toTPV :: Cl3 -> Cl3 Source #

toTPV takes any Cliffor and returns the TPV portion

toAPS :: Cl3 -> Cl3 Source #

toAPS takes any Cliffor and returns the APS portion

Pretty Printing for use with Octave

showOctave :: Cl3 -> String Source #

showOctave for useful for debug purposes. The additional octave definition is needed:

e0 = [1,0;0,1]; e1=[0,1;1,0]; e2=[0,-i;i,0]; e3=[1,0;0,-1];

This allows one to take advantage of the isomorphism between Cl3 and M(2,C)

Eliminate grades that are less than tol to use a simpler Constructor

reduce :: Cl3 -> Cl3 Source #

reduce function reduces the number of grades in a specialized Cliffor if they are zero-ish

tol :: Cl3 Source #

tol currently 128*eps

Compact Storable types for the Cl3 Constructors with smart constructors

data Cl3_R Source #

Cl3_R a compact storable data type for R.

Instances

Instances details
Read Cl3_R Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_R Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

showsPrec :: Int -> Cl3_R -> ShowS #

show :: Cl3_R -> String #

showList :: [Cl3_R] -> ShowS #

Storable Cl3_R Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

sizeOf :: Cl3_R -> Int #

alignment :: Cl3_R -> Int #

peekElemOff :: Ptr Cl3_R -> Int -> IO Cl3_R #

pokeElemOff :: Ptr Cl3_R -> Int -> Cl3_R -> IO () #

peekByteOff :: Ptr b -> Int -> IO Cl3_R #

pokeByteOff :: Ptr b -> Int -> Cl3_R -> IO () #

peek :: Ptr Cl3_R -> IO Cl3_R #

poke :: Ptr Cl3_R -> Cl3_R -> IO () #

toCl3_R :: Cl3 -> Cl3_R Source #

toCl3_R converts a Cl3 value constructed with R to its compact form.

fromCl3_R :: Cl3_R -> Cl3 Source #

fromCl3_R converts the compact Cl3_R type back to a Cl3 type.

data Cl3_V3 Source #

Cl3_V3 a compact storable data type for V3.

Instances

Instances details
Read Cl3_V3 Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_V3 Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Storable Cl3_V3 Source # 
Instance details

Defined in Algebra.Geometric.Cl3

toCl3_V3 :: Cl3 -> Cl3_V3 Source #

toCl3_V3 converts a Cl3 value constructed with V3 to its compact form.

fromCl3_V3 :: Cl3_V3 -> Cl3 Source #

fromCl3_V3 converts the compact Cl3_V3 type back to a Cl3 type.

data Cl3_BV Source #

Cl3_BV a compact storable data type for BV.

Instances

Instances details
Read Cl3_BV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_BV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Storable Cl3_BV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

toCl3_BV :: Cl3 -> Cl3_BV Source #

toCl3_BV converts a Cl3 value constructed with BV to its compact form.

fromCl3_BV :: Cl3_BV -> Cl3 Source #

fromCl3_BV converts the compact Cl3_BV type back to a Cl3 type.

data Cl3_I Source #

Cl3_I a compact storable data type for I.

Instances

Instances details
Read Cl3_I Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_I Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

showsPrec :: Int -> Cl3_I -> ShowS #

show :: Cl3_I -> String #

showList :: [Cl3_I] -> ShowS #

Storable Cl3_I Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

sizeOf :: Cl3_I -> Int #

alignment :: Cl3_I -> Int #

peekElemOff :: Ptr Cl3_I -> Int -> IO Cl3_I #

pokeElemOff :: Ptr Cl3_I -> Int -> Cl3_I -> IO () #

peekByteOff :: Ptr b -> Int -> IO Cl3_I #

pokeByteOff :: Ptr b -> Int -> Cl3_I -> IO () #

peek :: Ptr Cl3_I -> IO Cl3_I #

poke :: Ptr Cl3_I -> Cl3_I -> IO () #

toCl3_I :: Cl3 -> Cl3_I Source #

toCl3_I converts a Cl3 value constructed with I to its compact form.

fromCl3_I :: Cl3_I -> Cl3 Source #

fromCl3_I converts the compact Cl3_I type back to a Cl3 type.

data Cl3_PV Source #

Cl3_PV a compact storable data type for PV.

Instances

Instances details
Read Cl3_PV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_PV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Storable Cl3_PV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

toCl3_PV :: Cl3 -> Cl3_PV Source #

toCl3_PV converts a Cl3 value constructed with PV to its compact form.

fromCl3_PV :: Cl3_PV -> Cl3 Source #

fromCl3_PV converts the compact Cl3_PV type back to a Cl3 type.

data Cl3_H Source #

Cl3_H a compact storable data type for H.

Instances

Instances details
Read Cl3_H Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_H Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

showsPrec :: Int -> Cl3_H -> ShowS #

show :: Cl3_H -> String #

showList :: [Cl3_H] -> ShowS #

Storable Cl3_H Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

sizeOf :: Cl3_H -> Int #

alignment :: Cl3_H -> Int #

peekElemOff :: Ptr Cl3_H -> Int -> IO Cl3_H #

pokeElemOff :: Ptr Cl3_H -> Int -> Cl3_H -> IO () #

peekByteOff :: Ptr b -> Int -> IO Cl3_H #

pokeByteOff :: Ptr b -> Int -> Cl3_H -> IO () #

peek :: Ptr Cl3_H -> IO Cl3_H #

poke :: Ptr Cl3_H -> Cl3_H -> IO () #

toCl3_H :: Cl3 -> Cl3_H Source #

toCl3_H converts a Cl3 value constructed with H to its compact form.

fromCl3_H :: Cl3_H -> Cl3 Source #

fromCl3_H converts the compact Cl3_H type back to a Cl3 type.

data Cl3_C Source #

Cl3_C a compact storable data type for C.

Instances

Instances details
Read Cl3_C Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_C Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

showsPrec :: Int -> Cl3_C -> ShowS #

show :: Cl3_C -> String #

showList :: [Cl3_C] -> ShowS #

Storable Cl3_C Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Methods

sizeOf :: Cl3_C -> Int #

alignment :: Cl3_C -> Int #

peekElemOff :: Ptr Cl3_C -> Int -> IO Cl3_C #

pokeElemOff :: Ptr Cl3_C -> Int -> Cl3_C -> IO () #

peekByteOff :: Ptr b -> Int -> IO Cl3_C #

pokeByteOff :: Ptr b -> Int -> Cl3_C -> IO () #

peek :: Ptr Cl3_C -> IO Cl3_C #

poke :: Ptr Cl3_C -> Cl3_C -> IO () #

toCl3_C :: Cl3 -> Cl3_C Source #

toCl3_C converts a Cl3 value constructed with C to its compact form.

fromCl3_C :: Cl3_C -> Cl3 Source #

fromCl3_C converts the compact Cl3_C type back to a Cl3 type.

data Cl3_BPV Source #

Cl3_BPV a compact storable data type for BPV.

Instances

Instances details
Read Cl3_BPV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_BPV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Storable Cl3_BPV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

toCl3_BPV :: Cl3 -> Cl3_BPV Source #

toCl3_BPV converts a Cl3 value constructed with BPV to its compact form.

fromCl3_BPV :: Cl3_BPV -> Cl3 Source #

fromCl3_BPV converts the compact Cl3_BPV type back to a Cl3 type.

data Cl3_ODD Source #

Cl3_ODD a compact storable data type for ODD.

Instances

Instances details
Read Cl3_ODD Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_ODD Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Storable Cl3_ODD Source # 
Instance details

Defined in Algebra.Geometric.Cl3

toCl3_ODD :: Cl3 -> Cl3_ODD Source #

toCl3_ODD converts a Cl3 value constructed with ODD to its compact form.

fromCl3_ODD :: Cl3_ODD -> Cl3 Source #

fromCl3_ODD converts the compact Cl3_ODD type back to a Cl3 type.

data Cl3_TPV Source #

Cl3_TPV a compact storable data type for TPV.

Instances

Instances details
Read Cl3_TPV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_TPV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Storable Cl3_TPV Source # 
Instance details

Defined in Algebra.Geometric.Cl3

toCl3_TPV :: Cl3 -> Cl3_TPV Source #

toCl3_TPV converts a Cl3 value constructed with TPV to its compact form.

fromCl3_TPV :: Cl3_TPV -> Cl3 Source #

fromCl3_TPV converts the compact Cl3_TPV type back to a Cl3 type.

data Cl3_APS Source #

Cl3_APS a compact storable data type for APS.

Instances

Instances details
Read Cl3_APS Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Show Cl3_APS Source # 
Instance details

Defined in Algebra.Geometric.Cl3

Storable Cl3_APS Source # 
Instance details

Defined in Algebra.Geometric.Cl3

toCl3_APS :: Cl3 -> Cl3_APS Source #

toCl3_APS converts a Cl3 value constructed with APS to its compact form.

fromCl3_APS :: Cl3_APS -> Cl3 Source #

fromCl3_APS converts the compact Cl3_APS type back to a Cl3 type.

Random Instances

randR :: RandomGen g => g -> (Cl3, g) Source #

randR random Real Scalar (Grade 0) with random magnitude and random sign

rangeR :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeR random Real Scalar (Grade 0) with random magnitude within a range and a random sign

randV3 :: RandomGen g => g -> (Cl3, g) Source #

randV3 random Vector (Grade 1) with random magnitude and random direction the direction is using spherical coordinates

rangeV3 :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeV3 random Vector (Grade 1) with random magnitude within a range and a random direction

randBV :: RandomGen g => g -> (Cl3, g) Source #

randBV random Bivector (Grade 2) with random magnitude and random direction the direction is using spherical coordinates

rangeBV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeBV random Bivector (Grade 2) with random magnitude in a range and a random direction

randI :: RandomGen g => g -> (Cl3, g) Source #

randI random Imaginary Scalar (Grade 3) with random magnitude and random sign

rangeI :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeI random Imaginary Scalar (Grade 3) with random magnitude within a range and random sign

randPV :: RandomGen g => g -> (Cl3, g) Source #

randPV random Paravector made from random Grade 0 and Grade 1 elements

rangePV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangePV random Paravector made from random Grade 0 and Grade 1 elements within a range

randH :: RandomGen g => g -> (Cl3, g) Source #

randH random Quaternion made from random Grade 0 and Grade 2 elements

rangeH :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeH random Quaternion made from random Grade 0 and Grade 2 elements within a range

randC :: RandomGen g => g -> (Cl3, g) Source #

randC random combination of Grade 0 and Grade 3

rangeC :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeC random combination of Grade 0 and Grade 3 within a range

randBPV :: RandomGen g => g -> (Cl3, g) Source #

randBPV random combination of Grade 1 and Grade 2

rangeBPV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeBPV random combination of Grade 1 and Grade 2 within a range

randODD :: RandomGen g => g -> (Cl3, g) Source #

randODD random combination of Grade 1 and Grade 3

rangeODD :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeODD random combination of Grade 1 and Grade 3 within a range

randTPV :: RandomGen g => g -> (Cl3, g) Source #

randTPV random combination of Grade 2 and Grade 3

rangeTPV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeTPV random combination of Grade 2 and Grade 3 within a range

randAPS :: RandomGen g => g -> (Cl3, g) Source #

randAPS random combination of all 4 grades

rangeAPS :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #

rangeAPS random combination of all 4 grades within a range

randUnitV3 :: RandomGen g => g -> (Cl3, g) Source #

randUnitV3 a unit vector with a random direction

randProjector :: RandomGen g => g -> (Cl3, g) Source #

randProjector a projector with a random direction

randNilpotent :: RandomGen g => g -> (Cl3, g) Source #

randNilpotent a nilpotent element with a random orientation

randUnitary :: RandomGen g => g -> (Cl3, g) Source #

randUnitary a unitary element with a random orientation

Helpful Functions

eigvals :: Cl3 -> (Cl3, Cl3) Source #

eigvals calculates the eignenvalues of the cliffor. This is useful for determining if a cliffor is the pole of a function.

hasNilpotent :: Cl3 -> Bool Source #

hasNilpotent takes a Cliffor and determines if the vector part and the bivector part are orthoganl and equal in magnitude, i.e. that it is simular to a nilpotent BPV.

spectraldcmp :: (Cl3 -> Cl3) -> (Cl3 -> Cl3) -> Cl3 -> Cl3 Source #

spectraldcmp the spectral decomposition of a function to calculate analytic functions of cliffors in Cl(3,0). This function requires the desired function's R, I, and C instances to be calculated and the function's derivative. If multiple functions are being composed, its best to pass the composition of the funcitons to this function and the derivative to this function. Any function with a Taylor Series approximation should be able to be used. A real, imaginary, and complex version of the function to be decomposed must be provided and spectraldcmp will handle the case for an arbitrary Cliffor.

It may be possible to add, in the future, a RULES pragma like:

"spectral decomposition function composition"
forall f f' g g' cliff.
spectraldcmp f f' (spectraldcmp g g' cliff) = spectraldcmp (f.g) (f'.g') cliff

project :: Cl3 -> Cl3 Source #

project makes a projector based off of the vector content of the Cliffor.

mIx :: Cl3 -> Cl3 Source #

mIx a more effecient 'x -> I (-1) * x' typically useful for converting a Bivector to a Vector in the same direction. Related to Hodge Dual and/or Inverse Hodge Star.

timesI :: Cl3 -> Cl3 Source #

timesI is a more effecient 'x -> I 1 * x'

abssignum :: Cl3 -> (Cl3, Cl3) Source #

abssignum is a more effecient 'cl3 -> (abs cl3, signum cl3)' So abs is always R and signum is the same type of constructor as the input signum is the element divided by its largest singular value abs