Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Vec = Vec {}
- magV :: Vec -> Float
- argV :: Vec -> Float
- dotV :: Vec -> Vec -> Float
- detV :: Vec -> Vec -> Float
- mulSV :: Float -> Vec -> Vec
- rotateV :: Float -> Vec -> Vec
- angleVV :: Vec -> Vec -> Float
- normalizeV :: Vec -> Vec
- unitVecAtAngle :: Float -> Vec
- e :: Float -> Vec
- data VecBasis
- fromTuple :: (Float, Float) -> Vec
- toTuple :: Vec -> (Float, Float)
Documentation
Pair of unboxed floats. All operations on vectors are strict which is more suitable for computation intensive domains such as computer graphics.
Instances
Eq Vec Source # | |
Fractional Vec Source # | |
Num Vec Source # | |
Ord Vec Source # | |
Show Vec Source # | |
AdditiveGroup Vec Source # | |
VectorSpace Vec Source # | |
AffineSpace Vec Source # | |
HasCross2 Vec Source # | |
Defined in Dyna.Gloss.Data.Vec | |
HasNormal Vec Source # | |
Defined in Dyna.Gloss.Data.Vec | |
BasisArity Vec Source # | |
Defined in Dyna.Gloss.Data.Vec basisArity :: Vec -> Int # | |
HasBasis Vec Source # | |
type Scalar Vec Source # | |
Defined in Dyna.Gloss.Data.Vec | |
type Diff Vec Source # | |
Defined in Dyna.Gloss.Data.Vec | |
type Basis Vec Source # | |
Defined in Dyna.Gloss.Data.Vec |
rotateV :: Float -> Vec -> Vec Source #
Rotate a vector by an angle (in radians). +ve angle is counter-clockwise.
normalizeV :: Vec -> Vec Source #
Normalise a vector, so it has a magnitude of 1.
unitVecAtAngle :: Float -> Vec Source #
Produce a unit vector at a given angle relative to the +ve x-axis. The provided angle is in radians.