Copyright | (c) 2020 Cedric Liegeois |
---|---|
License | BSD3 |
Maintainer | Cedric Liegeois <ofmooseandmen@yahoo.fr> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Types and functions for working with triangles at the surface of a spherical celestial body.
In order to use this module you should start with the following imports:
import qualified Data.Geo.Jord.Geodetic as Geodetic import qualified Data.Geo.Jord.Triangle as Triangle
Synopsis
- data Triangle a
- vertex0 :: Spherical a => Triangle a -> HorizontalPosition a
- vertex1 :: Spherical a => Triangle a -> HorizontalPosition a
- vertex2 :: Spherical a => Triangle a -> HorizontalPosition a
- make :: Spherical a => HorizontalPosition a -> HorizontalPosition a -> HorizontalPosition a -> Maybe (Triangle a)
- unsafeMake :: Spherical a => HorizontalPosition a -> HorizontalPosition a -> HorizontalPosition a -> Triangle a
- centroid :: Spherical a => Triangle a -> HorizontalPosition a
- circumcentre :: Spherical a => Triangle a -> HorizontalPosition a
- contains :: Spherical a => Triangle a -> HorizontalPosition a -> Bool
Documentation
A triangle whose vertices are horizontal geodetic positions.
vertex0 :: Spherical a => Triangle a -> HorizontalPosition a Source #
First vertex of given triangle.
vertex1 :: Spherical a => Triangle a -> HorizontalPosition a Source #
Second vertex of given triangle.
vertex2 :: Spherical a => Triangle a -> HorizontalPosition a Source #
Third vertex of given triangle.
make :: Spherical a => HorizontalPosition a -> HorizontalPosition a -> HorizontalPosition a -> Maybe (Triangle a) Source #
Triangle from given vertices. Returns Nothing
if some vertices are equal or some are antipodes of others.
unsafeMake :: Spherical a => HorizontalPosition a -> HorizontalPosition a -> HorizontalPosition a -> Triangle a Source #
Triangle from given vertices. This is unsafe, if any vertices are equal or some are antipodes of others, the resulting triangle is actually undefined.
centroid :: Spherical a => Triangle a -> HorizontalPosition a Source #
Computes the centroid of the given triangle: the position which is the intersection of the three medians of the triangle (each median connecting a vertex with the midpoint of the opposite side).
The centroid is always within the triangle.
circumcentre :: Spherical a => Triangle a -> HorizontalPosition a Source #
The circumcentre of the triangle: the position which is equidistant from all three vertices.
The circumscribed circle or circumcircle of a triangle is a circle which passes through all the vertices of the triangle; The circumcentre is not necessarily inside the triangle.
Thanks to STRIPACK: http://orion.math.iastate.edu/burkardt/f_src/stripack/stripack.f90
contains :: Spherical a => Triangle a -> HorizontalPosition a -> Bool Source #
contains t p
returns True
if position p
is enclosed by the vertices of triangle
t
- see enclosedBy
.