-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A type for points, as distinct from vectors.
--   
--   A type for points, as distinct from vectors, built on top of
--   Data.AffineSpace.
@package vector-space-points
@version 0.2.1.2


-- | A type for <i>points</i> (as distinct from vectors), with an
--   appropriate AffineSpace instance.
module Data.AffineSpace.Point

-- | <tt>Point</tt> 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 <a>AffineSpace</a> class from
--   <a>Data.AffineSpace</a>.
newtype Point v
P :: v -> Point v

-- | Convert a point <tt>p</tt> into the vector from the origin to
--   <tt>p</tt>. 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 <tt>(p
--   <a>.-.</a> <a>origin</a>)</tt>.
unPoint :: Point v -> v

-- | The origin of the vector space <tt>v</tt>.
origin :: AdditiveGroup v => Point v

-- | Scale a point by a scalar.
(*.) :: VectorSpace v => Scalar v -> Point v -> Point v

-- | Reflect a point through the <a>origin</a>.
mirror :: AdditiveGroup v => Point v -> Point v

-- | Apply a transformation relative to the given point.
relative :: AffineSpace p => p -> (Diff p -> Diff p) -> p -> p

-- | Apply a transformation relative to the given point.
relative2 :: AffineSpace p => p -> (Diff p -> Diff p -> Diff p) -> p -> p -> p

-- | Apply a transformation relative to the given point.
relative3 :: AffineSpace p => p -> (Diff p -> Diff p -> Diff p -> Diff p) -> p -> p -> p -> p

-- | Mirror a point through a given point.
reflectThrough :: AffineSpace p => p -> p -> p
instance GHC.Base.Functor Data.AffineSpace.Point.Point
instance Data.Data.Data v => Data.Data.Data (Data.AffineSpace.Point.Point v)
instance GHC.Show.Show v => GHC.Show.Show (Data.AffineSpace.Point.Point v)
instance GHC.Read.Read v => GHC.Read.Read (Data.AffineSpace.Point.Point v)
instance GHC.Classes.Ord v => GHC.Classes.Ord (Data.AffineSpace.Point.Point v)
instance GHC.Classes.Eq v => GHC.Classes.Eq (Data.AffineSpace.Point.Point v)
instance Data.AdditiveGroup.AdditiveGroup v => Data.AffineSpace.AffineSpace (Data.AffineSpace.Point.Point v)
