Copyright | (c) 2011 Brent Yorgey |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | byorgey@cis.upenn.edu |
Safe Haskell | Safe |
Language | Haskell2010 |
Data.AffineSpace.Point
Contents
Description
A type for points (as distinct from vectors), with an appropriate AffineSpace instance.
Synopsis
- newtype Point v = P v
- unPoint :: Point v -> v
- origin :: AdditiveGroup v => Point v
- (*.) :: VectorSpace v => Scalar v -> Point v -> Point v
- mirror :: AdditiveGroup v => Point v -> Point v
- relative :: AffineSpace p => p -> (Diff p -> Diff p) -> p -> p
- relative2 :: AffineSpace p => p -> (Diff p -> Diff p -> Diff p) -> p -> p -> p
- relative3 :: AffineSpace p => p -> (Diff p -> Diff p -> Diff p -> Diff p) -> p -> p -> p -> p
- reflectThrough :: AffineSpace p => p -> p -> p
Points
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 # | |
Eq v => Eq (Point v) Source # | |
Data v => Data (Point v) Source # | |
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) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Point v) # toConstr :: Point v -> Constr # dataTypeOf :: Point v -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Point v)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Point v)) # gmapT :: (forall b. Data b => b -> b) -> Point v -> Point v # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Point v -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Point v -> r # gmapQ :: (forall d. Data d => d -> u) -> Point v -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Point v -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Point v -> m (Point v) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Point v -> m (Point v) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Point v -> m (Point v) # | |
Ord v => Ord (Point v) Source # | |
Defined in Data.AffineSpace.Point | |
Read v => Read (Point v) Source # | |
Show v => Show (Point v) Source # | |
AdditiveGroup v => AffineSpace (Point v) Source # | |
type Diff (Point v) Source # | |
Defined in Data.AffineSpace.Point |
origin :: AdditiveGroup v => Point v Source #
The origin of the vector space v
.
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.