vector-space-points- A type for points, as distinct from vectors.
Safe HaskellNone




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



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.


P v 


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) 
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.