geom2d-0.1.0.1: package for geometry in euklidean 2d space

Safe HaskellNone
LanguageHaskell2010

Geom2d.Point

Synopsis

Documentation

class Point p where Source

Methods

x :: p a -> a Source

y :: p a -> a Source

fromCoords :: a -> a -> p a Source

Instances

type Triangle p = (p, p, p) Source

class Scale p where Source

Methods

scale :: Num a => a -> p a -> p a Source

Instances

normalize :: (Scale p, Point p, Fractional a, Eq a, Floating a) => p a -> Maybe (p a) Source

Normalizes a scaleable point to length 1.

magnitude :: (Point p, Floating a, Num a) => p a -> a Source

dot :: (Num a, Point p) => p a -> p a -> a infixl 7 Source

cross :: (Num a, Point p) => p a -> p a -> a infixl 7 Source

triArea :: (Point p, Num (p a), Fractional a) => Triangle (p a) -> a Source

pointInTriangle :: (Eq (p a), Num (p a), Fractional a, Point p, Ord a) => Triangle (p a) -> p a -> Bool Source