Copyright | (c) 2020 Cedric Liegeois |
---|---|
License | BSD3 |
Maintainer | Cedric Liegeois <ofmooseandmen@yahoo.fr> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
3-element vector and associated math functions.
Synopsis
- data V3
- v3x :: V3 -> Double
- v3y :: V3 -> Double
- v3z :: V3 -> Double
- vec3 :: Double -> Double -> Double -> V3
- add :: V3 -> V3 -> V3
- subtract :: V3 -> V3 -> V3
- squaredDistance :: V3 -> V3 -> Double
- dot :: V3 -> V3 -> Double
- norm :: V3 -> Double
- cross :: V3 -> V3 -> V3
- scale :: V3 -> Double -> V3
- unit :: V3 -> V3
- zero :: V3
- transposeM :: [V3] -> [V3]
- dotM :: [V3] -> [V3] -> [V3]
- multM :: V3 -> [V3] -> V3
Documentation
3-element vector.
vec3 :: Double -> Double -> Double -> V3 Source #
Vector 3d from given coordinates.
0.0 is added to each component to avoid -0.0
.
squaredDistance :: V3 -> V3 -> Double Source #
Computes the square of the straight line distance (or geometrical distance) between 2 vectors.