Copyright | (C) 2012-2015 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
2-D Vectors
Documentation
A 2-dimensional vector
>>>
pure 1 :: V2 Int
V2 1 1
>>>
V2 1 2 + V2 3 4
V2 4 6
>>>
V2 1 2 * V2 3 4
V2 3 8
>>>
sum (V2 1 2)
3
V2 !a !a |
Instances
A space that has at least 1 basis vector _x
.
class R1 t => R2 t where Source #
>>>
V2 1 2 ^._y
2
>>>
V2 1 2 & _y .~ 3
V2 1 3