diagrams-core-1.3.0.5: Core libraries for diagrams EDSL

Diagrams.Core.Points

Contents

Description

A type for points (as distinct from vectors).

Synopsis

# Points

newtype Point f a :: (* -> *) -> * -> *

A handy wrapper to help distinguish points from vectors at the type level

Constructors

 P (f a)

Instances

origin :: (Additive f, Num a) => Point f a

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 :: (Additive f, Num a) => Point f a -> Iso' (Point f a) (f a)

An isomorphism between points and vectors, given a reference point.

_Point :: (Profunctor p, Functor f) => p (f a) (f (f a)) -> p (Point f a) (f (Point f a))

reflectThrough :: (Additive v, Num n) => Point v n -> Point v n -> Point v n Source

Mirror a point through a given point.

mirror :: (Additive v, Num n) => Point v n -> Point v n Source

relative2 :: (Additive v, Num n) => Point v n -> (v n -> v n -> v n) -> Point v n -> Point v n -> Point v n Source

Apply a transformation relative to the given point.

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 Source

Apply a transformation relative to the given point.