Copyright | (c) 2011 diagrams-lib team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | None |
Language | Haskell2010 |
Basic types for two-dimensional Euclidean space.
- data V2 a :: * -> * = V2 ~a ~a
- class R1 t where
- class R1 t => R2 t where
- type P2 = Point V2
- type T2 = Transformation V2
- r2 :: (n, n) -> V2 n
- unr2 :: V2 n -> (n, n)
- mkR2 :: n -> n -> V2 n
- r2Iso :: Iso' (V2 n) (n, n)
- p2 :: (n, n) -> P2 n
- mkP2 :: n -> n -> P2 n
- unp2 :: P2 n -> (n, n)
- p2Iso :: Iso' (Point V2 n) (n, n)
- r2PolarIso :: RealFloat n => Iso' (V2 n) (n, Angle n)
- class HasR t where
2D Euclidean space
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 |
A space that has at least 1 basis vector _x
.
type T2 = Transformation V2 Source #
A space which has magnitude _r
that can be calculated numerically.