Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Point p where
- x :: p a -> a
- y :: p a -> a
- fromCoords :: a -> a -> p a
- data Point' a
- type Triangle p = (p, p, p)
- class Scale p where
- normalize :: (Scale p, Point p, Fractional a, Eq a, Floating a) => p a -> Maybe (p a)
- magnitude :: (Point p, Floating a, Num a) => p a -> a
- dot :: (Num a, Point p) => p a -> p a -> a
- cross :: (Num a, Point p) => p a -> p a -> a
- triArea :: (Point p, Num (p a), Fractional a) => Triangle (p a) -> a
- pointInTriangle :: (Eq (p a), Num (p a), Fractional a, Point p, Ord a) => Triangle (p a) -> p a -> Bool
Documentation
Functor Point' Source | |
Rotation Point' Source | |
Point Point' Source | |
Scale Point' Source | |
Translate Point' Source | |
Distance Point' Point' Source | |
Eq a => Eq (Point' a) Source | |
(Eq a, Num a, Fractional a, RealFloat a) => Num (Point' a) Source | |
Read a => Read (Point' a) Source | |
Show a => Show (Point' a) Source | |
Arbitrary a => Arbitrary (Point' a) Source | |
(Num a, AEq a, RealFloat a) => AEq (Point' a) Source | |
Eq a => Intersect (Point' a) (Point' a) Source |
normalize :: (Scale p, Point p, Fractional a, Eq a, Floating a) => p a -> Maybe (p a) Source
Normalizes a scaleable point to length 1.
pointInTriangle :: (Eq (p a), Num (p a), Fractional a, Point p, Ord a) => Triangle (p a) -> p a -> Bool Source