diagrams-core-1.2.0.2: Core libraries for diagrams EDSL

Copyright(c) 2011 diagrams-core team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellNone
LanguageHaskell2010

Diagrams.Core.Points

Contents

Description

A type for points (as distinct from vectors).

Synopsis

Points

newtype Point v :: * -> *

Point is a newtype wrapper around vectors used to represent points, so we don't get them mixed up. The distinction between vectors and points is important: translations affect points, but leave vectors unchanged. Points are instances of the AffineSpace class from Data.AffineSpace.

Constructors

P v 

Instances

Functor 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) 
AdditiveGroup v => AffineSpace (Point v) 
VectorSpace v => HasOrigin (Point v) 
HasLinearMap v => Transformable (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 no intersection points for every query. Arguably it should return a single finite distance for vectors aimed directly at the given point, 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).

(OrderedField (Scalar v), InnerSpace v) => Enveloped (Point v) 
Typeable (* -> *) Point 
type Diff (Point v) = v 
type V (Point v) = v 

origin :: AdditiveGroup v => Point v

The origin of the vector space v.

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

Scale a point by a scalar.

_relative :: AffineSpace (Point v) => Point v -> Iso' (Point v) v Source

An isomorphism between points and vectors, given a reference point. This is provided for defining new lenses on points.