Copyright | (c) 2011 diagrams-lib team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Points in space. For more tools for working with points and vectors, see Linear.Affine.
Synopsis
- newtype Point (f :: Type -> Type) a = P (f a)
- origin :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a
- (*.) :: forall (v :: Type -> Type) n. (Functor v, Num n) => n -> Point v n -> Point v n
- centroid :: (Additive v, Fractional n) => [Point v n] -> Point v n
- pointDiagram :: forall (v :: Type -> Type) n b m. (Metric v, Fractional n) => Point v n -> QDiagram b v n m
- _Point :: forall f1 a g b p f2. (Profunctor p, Functor f2) => p (f1 a) (f2 (g b)) -> p (Point f1 a) (f2 (Point g b))
- lensP :: forall f1 a g b f2. Functor f2 => (f1 a -> f2 (g b)) -> Point f1 a -> f2 (Point g b)
Points
newtype Point (f :: Type -> Type) a #
A handy wrapper to help distinguish points from vectors at the type level
P (f a) |
Instances
Generic1 (Point f :: Type -> Type) | |
Unbox (f a) => Vector Vector (Point f a) | |
Defined in Linear.Affine basicUnsafeFreeze :: Mutable Vector s (Point f a) -> ST s (Vector (Point f a)) # basicUnsafeThaw :: Vector (Point f a) -> ST s (Mutable Vector s (Point f a)) # basicLength :: Vector (Point f a) -> Int # basicUnsafeSlice :: Int -> Int -> Vector (Point f a) -> Vector (Point f a) # basicUnsafeIndexM :: Vector (Point f a) -> Int -> Box (Point f a) # basicUnsafeCopy :: Mutable Vector s (Point f a) -> Vector (Point f a) -> ST s () # | |
Unbox (f a) => MVector MVector (Point f a) | |
Defined in Linear.Affine 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 :: Int -> ST s (MVector s (Point f a)) # basicInitialize :: MVector s (Point f a) -> ST s () # basicUnsafeReplicate :: Int -> Point f a -> ST s (MVector s (Point f a)) # basicUnsafeRead :: MVector s (Point f a) -> Int -> ST s (Point f a) # basicUnsafeWrite :: MVector s (Point f a) -> Int -> Point f a -> ST s () # basicClear :: MVector s (Point f a) -> ST s () # basicSet :: MVector s (Point f a) -> Point f a -> ST s () # basicUnsafeCopy :: MVector s (Point f a) -> MVector s (Point f a) -> ST s () # basicUnsafeMove :: MVector s (Point f a) -> MVector s (Point f a) -> ST s () # basicUnsafeGrow :: MVector s (Point f a) -> Int -> ST s (MVector s (Point f a)) # | |
Representable f => Representable (Point f) | |
Foldable f => Foldable (Point f) | |
Defined in Linear.Affine 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 # | |
Eq1 f => Eq1 (Point f) | |
Ord1 f => Ord1 (Point f) | |
Defined in Linear.Affine | |
Read1 f => Read1 (Point f) | |
Defined in Linear.Affine | |
Show1 f => Show1 (Point f) | |
Traversable f => Traversable (Point f) | |
Applicative f => Applicative (Point f) | |
Functor f => Functor (Point f) | |
Monad f => Monad (Point f) | |
Serial1 f => Serial1 (Point f) | |
Defined in Linear.Affine serializeWith :: MonadPut m => (a -> m ()) -> Point f a -> m () # deserializeWith :: MonadGet m => m a -> m (Point f a) # | |
HasPhi v => HasPhi (Point v) Source # | |
HasTheta v => HasTheta (Point v) Source # | |
(Metric v, OrderedField n) => TrailLike [Point v n] Source # | A list of points is trail-like; this instance simply
computes the vertices of the trail, using |
HasR v => HasR (Point v) Source # | |
Distributive f => Distributive (Point f) | |
Hashable1 f => Hashable1 (Point f) | |
Defined in Linear.Affine | |
Additive f => Affine (Point f) | |
Metric f => Metric (Point f) | |
Finite f => Finite (Point f) | |
R1 f => R1 (Point f) | |
Defined in Linear.Affine | |
R2 f => R2 (Point f) | |
R3 f => R3 (Point f) | |
R4 f => R4 (Point f) | |
Additive f => Additive (Point f) | |
Defined in Linear.Affine | |
Apply f => Apply (Point f) | |
Bind f => Bind (Point f) | |
Functor v => Cosieve (Query v) (Point v) | |
Defined in Diagrams.Core.Query | |
(Typeable f, Typeable a, Data (f a)) => Data (Point f a) | |
Defined in Linear.Affine 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) # | |
Storable (f a) => Storable (Point f a) | |
Defined in Linear.Affine | |
Monoid (f a) => Monoid (Point f a) | |
Semigroup (f a) => Semigroup (Point f a) | |
Generic (Point f a) | |
Ix (f a) => Ix (Point f a) | |
Defined in Linear.Affine 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 # | |
Num (f a) => Num (Point f a) | |
Read (f a) => Read (Point f a) | |
Fractional (f a) => Fractional (Point f a) | |
Show (f a) => Show (Point f a) | |
Binary (f a) => Binary (Point f a) | |
Serial (f a) => Serial (Point f a) | |
Defined in Linear.Affine | |
Serialize (f a) => Serialize (Point f a) | |
NFData (f a) => NFData (Point f a) | |
Defined in Linear.Affine | |
(OrderedField n, Metric v) => Enveloped (Point v n) | |
Defined in Diagrams.Core.Envelope | |
(Additive v, Num n) => HasOrigin (Point v n) | |
Defined in Diagrams.Core.HasOrigin | |
(Additive v, Ord n) => Traced (Point v n) | 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). |
(Additive v, Num n) => Transformable (Point v n) | |
Defined in Diagrams.Core.Transform | |
Coordinates (v n) => Coordinates (Point v n) Source # | |
Defined in Diagrams.Coordinates | |
Eq (f a) => Eq (Point f a) | |
Ord (f a) => Ord (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 | |
Random (f a) => Random (Point f a) | |
Unbox (f a) => Unbox (Point f a) | |
Defined in Linear.Affine | |
r ~ Point u n => Deformable (Point v n) r Source # | |
(Additive v, Num n, r ~ Point u n) => AffineMappable (Point v n) r Source # | |
t ~ Point g b => Rewrapped (Point f a) t | |
Defined in Linear.Affine | |
LinearMappable (Point v n) (Point u m) Source # | |
Traversable f => Each (Point f a) (Point f b) a b | |
(Additive v', Foldable v', Ord n') => Each (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n') Source # | Only valid if the second point is not smaller than the first. |
Defined in Diagrams.BoundingBox each :: Traversal (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n') # | |
Each (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') Source # | |
Defined in Diagrams.Segment each :: Traversal (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') # | |
type Rep1 (Point f :: Type -> Type) | |
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 Rep (Point f a) | |
Defined in Linear.Affine | |
type N (Point v n) | |
Defined in Diagrams.Core.Points | |
type V (Point v n) | |
Defined in Diagrams.Core.Points | |
type Decomposition (Point v n) Source # | |
Defined in Diagrams.Coordinates | |
type FinalCoord (Point v n) Source # | |
Defined in Diagrams.Coordinates | |
type PrevDim (Point v n) Source # | |
Defined in Diagrams.Coordinates | |
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 | |
newtype Vector (Point f a) | |
Defined in Linear.Affine |
origin :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a #
Vector spaces have origins.
(*.) :: forall (v :: Type -> Type) n. (Functor v, Num n) => n -> Point v n -> Point v n #
Scale a point by a scalar. Specialized version of (*^)
.
Point-related utilities
centroid :: (Additive v, Fractional n) => [Point v n] -> Point v n Source #
The centroid of a set of n points is their sum divided by n. Returns the origin for an empty list of points.
pointDiagram :: forall (v :: Type -> Type) n b m. (Metric v, Fractional n) => Point v n -> QDiagram b v n m #
Create a "point diagram", which has no content, no trace, an empty query, and a point envelope.