|
|
|
|
Synopsis |
|
class AbelianGroup g where | | | vecSum :: AbelianGroup g => [g] -> g | | class AbelianGroup r => Ring r where | | | ringProduct :: Ring r => [r] -> r | | class LeftModule r m where | | | class RightModule m r where | | | class AbelianGroup v => Vector v where | | | class DotProd v where | | | normalize :: (Vector v, DotProd v) => v -> v | | distance :: (Vector v, DotProd v) => v -> v -> Float | | angle :: (Vector v, DotProd v) => v -> v -> Float | | angle' :: (Vector v, UnitVector v u, DotProd v) => u -> u -> Float | | class (Vector v, DotProd v) => UnitVector v u | v -> u, u -> v where | | | project' :: (Vector v, UnitVector v u, DotProd v) => v -> u -> v | | projectUnsafe :: (Vector v, DotProd v) => v -> v -> v | | project :: (Vector v, DotProd v) => v -> v -> v | | flipNormal :: UnitVector v n => n -> n | | class CrossProd v where | | | class Pointwise v where | | | class HasCoordinates v x | v -> x where | _1 :: v -> x | _2 :: v -> x | _3 :: v -> x | _4 :: v -> x |
| | class Extend u v where | | | class Diagonal s t | t -> s where | | | class Matrix m where | | | class Tensor t v | t -> v where | | | class Determinant m where | | | data Vec2 = Vec2 !Float !Float | | data Vec3 = Vec3 !Float !Float !Float | | data Vec4 = Vec4 !Float !Float !Float !Float | | data Mat2 = Mat2 !Vec2 !Vec2 | | data Mat3 = Mat3 !Vec3 !Vec3 !Vec3 | | data Mat4 = Mat4 !Vec4 !Vec4 !Vec4 !Vec4 | | newtype Normal2 = Normal2 Vec2 | | newtype Normal3 = Normal3 Vec3 | | newtype Normal4 = Normal4 Vec4 | | mkVec2 :: (Float, Float) -> Vec2 | | mkVec3 :: (Float, Float, Float) -> Vec3 | | mkVec4 :: (Float, Float, Float, Float) -> Vec4 | | rndUnit :: (RandomGen g, Random v, Vector v, DotProd v) => g -> (v, g) |
|
|
Documentation |
|
class AbelianGroup g where | Source |
|
| Methods | | | Instances | |
|
|
|
|
|
| Methods | | | Instances | |
|
|
|
|
class LeftModule r m where | Source |
|
| Methods | | | Instances | |
|
|
class RightModule m r where | Source |
|
| Methods | | | Instances | |
|
|
|
| Methods | | | Instances | |
|
|
|
| Methods | | | Instances | |
|
|
|
|
|
|
|
the angle between two vectors
|
|
|
the angle between two unit vectors
|
|
|
| Methods | | :: v | | -> u | normalizes the input
|
| | | :: v | | -> u | does not normalize the input!
|
| | | | |
| | Instances | |
|
|
|
projects the first vector onto the direction of the second (unit) vector
|
|
|
direction (second argument) is assumed to be a unit vector!
|
|
|
|
|
since unit vectors are not a group, we need a separate function.
|
|
|
| Methods | crossprod :: v -> v -> v | Source |
| | |
| | Instances | |
|
|
|
| Methods | pointwise :: v -> v -> v | Source |
| | |
| | Instances | |
|
|
class HasCoordinates v x | v -> x where | Source |
|
| Methods | | | Instances | |
|
|
|
conversion between vectors (and matrices) of different dimensions
| | Methods | | :: u | | -> v | example: extendZero (Vec2 5 6) = Vec4 5 6 0 0
|
| | | :: Float | | -> u | | -> v | example: extendWith 1 (Vec2 5 6) = Vec4 5 6 1 1
|
| | | :: v | | -> u | example: trim (Vec4 5 6 7 8) = Vec2 5 6
|
|
| | Instances | |
|
|
class Diagonal s t | t -> s where | Source |
|
makes a diagonal matrix from a vector
| | Methods | | | Instances | |
|
|
|
| Methods | | | Instances | |
|
|
class Tensor t v | t -> v where | Source |
|
Outer product (could be unified with Diagonal?)
| | Methods | | | Instances | |
|
|
class Determinant m where | Source |
|
| Methods | | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
these are row vectors
| Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
The assumption when dealing with these is always that they are of unit length.
Also, interpolation works differently.
| Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.4.2 |