Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
class VectorSpace v where Source #
A generic vector space. Not only classic vectors like Vec2
form a vector
space, but also concepts like Angle
s – anything that can be added, inverted,
and multiplied with a scalar.
Vector spaces come with a number of laws that you can look up on Wikipedia. The short version is: each operation behaves like addition/multiplication on normal numbers.
(+.) :: v -> v -> v infixl 6 Source #
Vector addition
(-.) :: v -> v -> v infixl 6 Source #
Vector subtraction
(*.) :: Double -> v -> v infixl 7 Source #
Multiplication with a scalar
(/.) :: v -> Double -> v infixl 7 Source #
Division by a scalar
Neutral element
Inverse element
Instances
VectorSpace Angle Source # | |
VectorSpace Mat2 Source # | |
VectorSpace Vec2 Source # | |
VectorSpace PhaseSpace Source # | |
Defined in Physics (+.) :: PhaseSpace -> PhaseSpace -> PhaseSpace Source # (-.) :: PhaseSpace -> PhaseSpace -> PhaseSpace Source # (*.) :: Double -> PhaseSpace -> PhaseSpace Source # (/.) :: PhaseSpace -> Double -> PhaseSpace Source # zero :: PhaseSpace Source # negateV :: PhaseSpace -> PhaseSpace Source # | |
VectorSpace Double Source # | |
VectorSpace a => VectorSpace (NBody a) Source # | |
VectorSpace b => VectorSpace (a -> b) Source # | |
(VectorSpace v1, VectorSpace v2) => VectorSpace (v1, v2) Source # | |
(VectorSpace v1, VectorSpace v2, VectorSpace v3) => VectorSpace (v1, v2, v3) Source # | |
(VectorSpace v1, VectorSpace v2, VectorSpace v3, VectorSpace v4) => VectorSpace (v1, v2, v3, v4) Source # | |
Defined in Algebra.VectorSpace (+.) :: (v1, v2, v3, v4) -> (v1, v2, v3, v4) -> (v1, v2, v3, v4) Source # (-.) :: (v1, v2, v3, v4) -> (v1, v2, v3, v4) -> (v1, v2, v3, v4) Source # (*.) :: Double -> (v1, v2, v3, v4) -> (v1, v2, v3, v4) Source # (/.) :: (v1, v2, v3, v4) -> Double -> (v1, v2, v3, v4) Source # | |
(VectorSpace v1, VectorSpace v2, VectorSpace v3, VectorSpace v4, VectorSpace v5) => VectorSpace (v1, v2, v3, v4, v5) Source # | |
Defined in Algebra.VectorSpace (+.) :: (v1, v2, v3, v4, v5) -> (v1, v2, v3, v4, v5) -> (v1, v2, v3, v4, v5) Source # (-.) :: (v1, v2, v3, v4, v5) -> (v1, v2, v3, v4, v5) -> (v1, v2, v3, v4, v5) Source # (*.) :: Double -> (v1, v2, v3, v4, v5) -> (v1, v2, v3, v4, v5) Source # (/.) :: (v1, v2, v3, v4, v5) -> Double -> (v1, v2, v3, v4, v5) Source # zero :: (v1, v2, v3, v4, v5) Source # negateV :: (v1, v2, v3, v4, v5) -> (v1, v2, v3, v4, v5) Source # |
vsum :: VectorSpace a => [a] -> a Source #