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

Copyright(c) 2011 Brent Yorgey
LicenseBSD-style (see LICENSE)
Maintainerbyorgey@cis.upenn.edu
Safe HaskellSafe
LanguageHaskell2010

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 Source # 
Instance details

Defined in Data.AffineSpace.Point

Methods

fmap :: (a -> b) -> Point a -> Point b Source #

(<$) :: a -> Point b -> Point a Source #

Eq v => Eq (Point v) Source # 
Instance details

Defined in Data.AffineSpace.Point

Methods

(==) :: Point v -> Point v -> Bool Source #

(/=) :: Point v -> Point v -> Bool Source #

Data v => Data (Point v) Source # 
Instance details

Defined in Data.AffineSpace.Point

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Point v -> c (Point v) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Point v) Source #

toConstr :: Point v -> Constr Source #

dataTypeOf :: Point v -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Point v)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Point v)) Source #

gmapT :: (forall b. Data b => b -> b) -> Point v -> Point v Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Point v -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Point v -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Point v -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Point v -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Point v -> m (Point v) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Point v -> m (Point v) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Point v -> m (Point v) Source #

Ord v => Ord (Point v) Source # 
Instance details

Defined in Data.AffineSpace.Point

Methods

compare :: Point v -> Point v -> Ordering Source #

(<) :: Point v -> Point v -> Bool Source #

(<=) :: Point v -> Point v -> Bool Source #

(>) :: Point v -> Point v -> Bool Source #

(>=) :: Point v -> Point v -> Bool Source #

max :: Point v -> Point v -> Point v Source #

min :: Point v -> Point v -> Point v Source #

Read v => Read (Point v) Source # 
Instance details

Defined in Data.AffineSpace.Point

Show v => Show (Point v) Source # 
Instance details

Defined in Data.AffineSpace.Point

AdditiveGroup v => AffineSpace (Point v) Source # 
Instance details

Defined in Data.AffineSpace.Point

Associated Types

type Diff (Point v) :: Type Source #

Methods

(.-.) :: Point v -> Point v -> Diff (Point v) Source #

(.+^) :: Point v -> Diff (Point v) -> Point v Source #

type Diff (Point v) Source # 
Instance details

Defined in Data.AffineSpace.Point

type Diff (Point v) = v

unPoint :: Point v -> v Source #

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 v Source #

The origin of the vector space v.

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

Scale a point by a scalar.

mirror :: AdditiveGroup v => Point v -> Point v Source #

Reflect a point through the origin.

Reflection through a point

relative :: AffineSpace p => p -> (Diff p -> Diff p) -> p -> p Source #

Apply a transformation relative to the given point.

relative2 :: AffineSpace p => p -> (Diff p -> Diff p -> Diff p) -> p -> p -> p Source #

Apply a transformation relative to the given point.

relative3 :: AffineSpace p => p -> (Diff p -> Diff p -> Diff p -> Diff p) -> p -> p -> p -> p Source #

Apply a transformation relative to the given point.

reflectThrough :: AffineSpace p => p -> p -> p Source #

Mirror a point through a given point.