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

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Triangle

Synopsis

Documentation

data Triangle d p r Source #

Constructors

Triangle (Point d r :+ p) (Point d r :+ p) (Point d r :+ p) 
Instances
Arity d => Functor (Triangle d p) Source # 
Instance details

Defined in Data.Geometry.Triangle

Methods

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

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

PointFunctor (Triangle d p) Source # 
Instance details

Defined in Data.Geometry.Triangle

Methods

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

(Arity d, Show r, Show p) => Show (Triangle d p r) Source # 
Instance details

Defined in Data.Geometry.Triangle

Methods

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

show :: Triangle d p r -> String #

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

(Fractional r, Arity d, Arity (d + 1)) => IsTransformable (Triangle d p r) Source # 
Instance details

Defined in Data.Geometry.Triangle

Methods

transformBy :: Transformation (Dimension (Triangle d p r)) (NumType (Triangle d p r)) -> Triangle d p r -> Triangle d p r Source #

type NumType (Triangle d p r) Source # 
Instance details

Defined in Data.Geometry.Triangle

type NumType (Triangle d p r) = r
type Dimension (Triangle d p r) Source # 
Instance details

Defined in Data.Geometry.Triangle

type Dimension (Triangle d p r) = d

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

Compute the area of a triangle

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

2*the area of a triangle.

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

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