vector-space-points-0.1.2.0: A type for points, as distinct from vectors.

Maintainerbyorgey@cis.upenn.edu
Safe HaskellNone

Data.AffineSpace.Point

Contents

Description

A type for points (as distinct from vectors), with an appropriate AffineSpace instance.

Synopsis

Points

newtype Point v Source

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 
Typeable1 Point 
Eq v => Eq (Point v) 
(Typeable (Point v), Data v) => Data (Point v) 
(Eq (Point v), Ord v) => Ord (Point v) 
Read v => Read (Point v) 
Show v => Show (Point v) 
(AdditiveGroup (Diff (Point v)), AdditiveGroup v) => AffineSpace (Point v) 
Newtype (Point v) v 

unPoint :: Point v -> vSource

Convert a point p into the vector from the origin to p. This should be considered a "semantically unsafe" operation; think carefully about whether and why you need to use it. The recommended way to do this conversion would be to write (p .-. origin).

origin :: AdditiveGroup v => Point vSource

The origin of the vector space v.

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

Scale a point by a scalar.