Copyright | (c) 2011 diagrams-core team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | None |
Language | Haskell2010 |
Diagrams.Core.Points
Contents
Description
A type for points (as distinct from vectors).
Synopsis
- newtype Point (f :: Type -> Type) a = P (f a)
- origin :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a
- (*.) :: (Functor v, Num n) => n -> Point v n -> Point v n
- relative :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a -> Iso' (Point f a) (f a)
- _Point :: forall (f :: Type -> Type) a. Iso' (Point f a) (f a)
- reflectThrough :: (Additive v, Num n) => Point v n -> Point v n -> Point v n
- mirror :: (Additive v, Num n) => Point v n -> Point v n
- relative2 :: (Additive v, Num n) => Point v n -> (v n -> v n -> v n) -> Point v n -> Point v n -> Point v n
- relative3 :: (Additive v, Num n) => Point v n -> (v n -> v n -> v n -> v n) -> Point v n -> Point v n -> Point v n -> Point v n
Points
newtype Point (f :: Type -> Type) a Source #
A handy wrapper to help distinguish points from vectors at the type level
Constructors
P (f a) |
Instances
Unbox (f a) => Vector Vector (Point f a) | |
Defined in Linear.Affine Methods basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Point f a) -> m (Vector (Point f a)) basicUnsafeThaw :: PrimMonad m => Vector (Point f a) -> m (Mutable Vector (PrimState m) (Point f a)) basicLength :: Vector (Point f a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Point f a) -> Vector (Point f a) basicUnsafeIndexM :: Monad m => Vector (Point f a) -> Int -> m (Point f a) basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Point f a) -> Vector (Point f a) -> m () | |
Unbox (f a) => MVector MVector (Point f a) | |
Defined in Linear.Affine Methods basicLength :: MVector s (Point f a) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (Point f a) -> MVector s (Point f a) basicOverlaps :: MVector s (Point f a) -> MVector s (Point f a) -> Bool basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Point f a)) basicInitialize :: PrimMonad m => MVector (PrimState m) (Point f a) -> m () basicUnsafeReplicate :: PrimMonad m => Int -> Point f a -> m (MVector (PrimState m) (Point f a)) basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> m (Point f a) basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> Point f a -> m () basicClear :: PrimMonad m => MVector (PrimState m) (Point f a) -> m () basicSet :: PrimMonad m => MVector (PrimState m) (Point f a) -> Point f a -> m () basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Point f a) -> MVector (PrimState m) (Point f a) -> m () basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Point f a) -> MVector (PrimState m) (Point f a) -> m () basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> m (MVector (PrimState m) (Point f a)) | |
Monad f => Monad (Point f) | |
Functor f => Functor (Point f) | |
Applicative f => Applicative (Point f) | |
Foldable f => Foldable (Point f) | |
Defined in Linear.Affine Methods fold :: Monoid m => Point f m -> m foldMap :: Monoid m => (a -> m) -> Point f a -> m foldMap' :: Monoid m => (a -> m) -> Point f a -> m foldr :: (a -> b -> b) -> b -> Point f a -> b foldr' :: (a -> b -> b) -> b -> Point f a -> b foldl :: (b -> a -> b) -> b -> Point f a -> b foldl' :: (b -> a -> b) -> b -> Point f a -> b foldr1 :: (a -> a -> a) -> Point f a -> a foldl1 :: (a -> a -> a) -> Point f a -> a elem :: Eq a => a -> Point f a -> Bool maximum :: Ord a => Point f a -> a minimum :: Ord a => Point f a -> a | |
Traversable f => Traversable (Point f) | |
Distributive f => Distributive (Point f) | |
Defined in Linear.Affine | |
Representable f => Representable (Point f) | |
Apply f => Apply (Point f) | |
Additive f => Affine (Point f) | |
Defined in Linear.Affine | |
R4 f => R4 (Point f) | |
R3 f => R3 (Point f) | |
R2 f => R2 (Point f) | |
R1 f => R1 (Point f) | |
Finite f => Finite (Point f) | |
Metric f => Metric (Point f) | |
Additive f => Additive (Point f) | |
Defined in Linear.Affine Methods zero :: Num a => Point f a Source # (^+^) :: Num a => Point f a -> Point f a -> Point f a Source # (^-^) :: Num a => Point f a -> Point f a -> Point f a Source # lerp :: Num a => a -> Point f a -> Point f a -> Point f a Source # liftU2 :: (a -> a -> a) -> Point f a -> Point f a -> Point f a Source # liftI2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c Source # | |
Hashable1 f => Hashable1 (Point f) | |
Defined in Linear.Affine Methods liftHashWithSalt :: (Int -> a -> Int) -> Int -> Point f a -> Int | |
Eq1 f => Eq1 (Point f) | |
Defined in Linear.Affine | |
Ord1 f => Ord1 (Point f) | |
Defined in Linear.Affine Methods liftCompare :: (a -> b -> Ordering) -> Point f a -> Point f b -> Ordering | |
Read1 f => Read1 (Point f) | |
Defined in Linear.Affine Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Point f a) liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Point f a] liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Point f a) liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Point f a] | |
Show1 f => Show1 (Point f) | |
Defined in Linear.Affine Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Point f a -> ShowS liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Point f a] -> ShowS | |
Bind f => Bind (Point f) | |
Serial1 f => Serial1 (Point f) | |
Defined in Linear.Affine Methods serializeWith :: MonadPut m => (a -> m ()) -> Point f a -> m () deserializeWith :: MonadGet m => m a -> m (Point f a) | |
Generic1 (Point f :: Type -> Type) | |
Functor v => Cosieve (Query v) (Point v) Source # | |
Eq (f a) => Eq (Point f a) | |
Fractional (f a) => Fractional (Point f a) | |
Defined in Linear.Affine | |
(Typeable f, Typeable a, Data (f a)) => Data (Point f a) | |
Defined in Linear.Affine Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Point f a -> c (Point f a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Point f a) toConstr :: Point f a -> Constr dataTypeOf :: Point f a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Point f a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Point f a)) gmapT :: (forall b. Data b => b -> b) -> Point f a -> Point f a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Point f a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Point f a -> r gmapQ :: (forall d. Data d => d -> u) -> Point f a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Point f a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) | |
Num (f a) => Num (Point f a) | |
Ord (f a) => Ord (Point f a) | |
Defined in Linear.Affine | |
Read (f a) => Read (Point f a) | |
Defined in Linear.Affine | |
Show (f a) => Show (Point f a) | |
Ix (f a) => Ix (Point f a) | |
Defined in Linear.Affine Methods range :: (Point f a, Point f a) -> [Point f a] index :: (Point f a, Point f a) -> Point f a -> Int unsafeIndex :: (Point f a, Point f a) -> Point f a -> Int inRange :: (Point f a, Point f a) -> Point f a -> Bool rangeSize :: (Point f a, Point f a) -> Int unsafeRangeSize :: (Point f a, Point f a) -> Int | |
Generic (Point f a) | |
Storable (f a) => Storable (Point f a) | |
Defined in Linear.Affine Methods peekElemOff :: Ptr (Point f a) -> Int -> IO (Point f a) pokeElemOff :: Ptr (Point f a) -> Int -> Point f a -> IO () peekByteOff :: Ptr b -> Int -> IO (Point f a) pokeByteOff :: Ptr b -> Int -> Point f a -> IO () | |
Unbox (f a) => Unbox (Point f a) | |
Defined in Linear.Affine | |
Hashable (f a) => Hashable (Point f a) | |
Defined in Linear.Affine | |
Ixed (f a) => Ixed (Point f a) | |
Defined in Linear.Affine | |
Wrapped (Point f a) | |
Epsilon (f a) => Epsilon (Point f a) | |
Defined in Linear.Affine | |
Binary (f a) => Binary (Point f a) | |
NFData (f a) => NFData (Point f a) | |
Defined in Linear.Affine | |
Serial (f a) => Serial (Point f a) | |
Defined in Linear.Affine | |
Serialize (f a) => Serialize (Point f a) | |
Defined in Linear.Affine | |
(Additive v, Num n) => HasOrigin (Point v n) Source # | |
(Additive v, Num n) => Transformable (Point v n) Source # | |
(Additive v, Ord n) => Traced (Point v n) Source # | The trace of a single point is the empty trace, i.e. the one which returns no intersection points for every query. Arguably it should return a single finite distance for vectors aimed directly at the given point, but due to floating-point inaccuracy this is problematic. Note that the envelope for a single point is not the empty envelope (see Diagrams.Core.Envelope). |
(OrderedField n, Metric v) => Enveloped (Point v n) Source # | |
Defined in Diagrams.Core.Envelope | |
t ~ Point g b => Rewrapped (Point f a) t | |
Defined in Linear.Affine | |
Traversable f => Each (Point f a) (Point f b) a b | |
newtype MVector s (Point f a) | |
Defined in Linear.Affine | |
type Rep (Point f) | |
Defined in Linear.Affine | |
type Diff (Point f) | |
Defined in Linear.Affine | |
type Size (Point f) | |
Defined in Linear.Affine | |
type Rep1 (Point f :: Type -> Type) | |
Defined in Linear.Affine type Rep1 (Point f :: Type -> Type) = D1 ('MetaData "Point" "Linear.Affine" "linear-1.20.9-RPUBINYq384VPzdgkhYOj" 'True) (C1 ('MetaCons "P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f))) | |
type Rep (Point f a) | |
Defined in Linear.Affine type Rep (Point f a) = D1 ('MetaData "Point" "Linear.Affine" "linear-1.20.9-RPUBINYq384VPzdgkhYOj" 'True) (C1 ('MetaCons "P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a)))) | |
newtype Vector (Point f a) | |
Defined in Linear.Affine | |
type Index (Point f a) | |
Defined in Linear.Affine | |
type IxValue (Point f a) | |
Defined in Linear.Affine | |
type Unwrapped (Point f a) | |
Defined in Linear.Affine | |
type N (Point v n) Source # | |
Defined in Diagrams.Core.Points | |
type V (Point v n) Source # | |
Defined in Diagrams.Core.Points |
origin :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a Source #
Vector spaces have origins.
(*.) :: (Functor v, Num n) => n -> Point v n -> Point v n Source #
Scale a point by a scalar. Specialized version of (*^)
.
relative :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a -> Iso' (Point f a) (f a) Source #
An isomorphism between points and vectors, given a reference point.
reflectThrough :: (Additive v, Num n) => Point v n -> Point v n -> Point v n Source #
Mirror a point through a given point.