diagrams-lib-0.7.1.1: Embedded domain-specific language for declarative graphics

Maintainer | diagrams-discuss@googlegroups.com
Safe Haskell | None

Diagrams.Points

Contents

- Points
- Point-related utilities

Description

Points in space. For more tools for working with points and vectors, see Data.AffineSpace and Diagrams.Coordinates.

Synopsis

- data Point v
- origin :: AdditiveGroup v => Point v
- (*.) :: VectorSpace v => Scalar v -> Point v -> Point v
- centroid :: (VectorSpace v, Fractional (Scalar v)) => [Point v] -> Point v

# Points

data Point v

Instances

Functor Point |
Typeable1 Point |
Eq v => Eq (Point v) |
Data v => Data (Point v) |
Ord v => Ord (Point v) |
Read v => Read (Point v) |
Show v => Show (Point v) |
(OrderedField (Scalar v), InnerSpace v) => Enveloped (Point v) |

(Ord (Scalar v), VectorSpace v) => Traced (Point v)

The trace of a single point is the empty trace, i.e. the one which returns positive infinity for every query. Arguably it should return a finite distance for vectors aimed directly at the given point and infinity for everything else, but due to floating-point inaccuracy this is problematic. Note that the envelope for a single point is not the empty envelope (see Diagrams.Core.Envelope).

HasLinearMap v => Transformable (Point v) |
VectorSpace v => HasOrigin (Point v) |
AdditiveGroup v => AffineSpace (Point v) |
Coordinates v => Coordinates (Point v) |
(InnerSpace v, OrderedField (Scalar v)) => TrailLike [Point v] | A list of points is trail-like; this instance simply computes the vertices of the trail, using `trailVertices`.
Newtype (Point v) v |

origin :: AdditiveGroup v => Point v

(*.) :: VectorSpace v => Scalar v -> Point v -> Point v

# Point-related utilities

centroid :: (VectorSpace v, Fractional (Scalar v)) => [Point v] -> Point vSource

The centroid of a set of n points is their sum divided by n.