hgeometry-0.6.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Triangle

Synopsis

Documentation

data Triangle p r Source #

Constructors

Triangle (Point 2 r :+ p) (Point 2 r :+ p) (Point 2 r :+ p) 

Instances

Functor (Triangle p) Source # 

Methods

fmap :: (a -> b) -> Triangle p a -> Triangle p b #

(<$) :: a -> Triangle p b -> Triangle p a #

PointFunctor (Triangle p) Source # 

Methods

pmap :: (Point (Dimension (Triangle p r)) r -> Point (Dimension (Triangle p s)) s) -> Triangle p r -> Triangle p s Source #

(Eq r, Eq p) => Eq (Triangle p r) Source # 

Methods

(==) :: Triangle p r -> Triangle p r -> Bool #

(/=) :: Triangle p r -> Triangle p r -> Bool #

(Show r, Show p) => Show (Triangle p r) Source # 

Methods

showsPrec :: Int -> Triangle p r -> ShowS #

show :: Triangle p r -> String #

showList :: [Triangle p r] -> ShowS #

Num r => IsTransformable (Triangle d r) Source # 
type NumType (Triangle p r) Source # 
type NumType (Triangle p r) = r
type Dimension (Triangle p r) Source # 
type Dimension (Triangle p r) = 2

area :: Fractional r => Triangle p r -> r Source #

Compute the area of a triangle

doubleArea :: Num r => Triangle p r -> r Source #

2*the area of a triangle.

inscribedDisk :: (Eq r, Fractional r) => Triangle p r -> Maybe (Disk () r) Source #

get the inscribed disk. Returns Nothing if the triangle is degenerate, i.e. if the points are colinear.