Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Triangle d p r = Triangle (Point d r :+ p) (Point d r :+ p) (Point d r :+ p)
- area :: Fractional r => Triangle 2 p r -> r
- doubleArea :: Num r => Triangle 2 p r -> r
- inscribedDisk :: (Eq r, Fractional r) => Triangle 2 p r -> Maybe (Disk () r)
Documentation
Instances
Arity d => Functor (Triangle d p) Source # | |
PointFunctor (Triangle d p) Source # | |
(Arity d, Show r, Show p) => Show (Triangle d p r) Source # | |
(Fractional r, Arity d, Arity (d + 1)) => IsTransformable (Triangle d p r) Source # | |
Defined in Data.Geometry.Triangle 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 # | |
Defined in Data.Geometry.Triangle | |
type Dimension (Triangle d p r) Source # | |
Defined in Data.Geometry.Triangle |
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.