diagrams-lib-1.3.1.3: Embedded domain-specific language for declarative graphics

Copyright (c) 2011 diagrams-lib team (see LICENSE) BSD-style (see LICENSE) diagrams-discuss@googlegroups.com None Haskell2010

Diagrams.ThreeD.Types

Description

Basic types for three-dimensional Euclidean space.

Synopsis

# 3D Euclidean space

r3 :: (n, n, n) -> V3 n Source #

Construct a 3D vector from a triple of components.

unr3 :: V3 n -> (n, n, n) Source #

Convert a 3D vector back into a triple of components.

mkR3 :: n -> n -> n -> V3 n Source #

Curried version of r3.

p3 :: (n, n, n) -> P3 n Source #

Construct a 3D point from a triple of coordinates.

unp3 :: P3 n -> (n, n, n) Source #

Convert a 3D point back into a triple of coordinates.

mkP3 :: n -> n -> n -> P3 n Source #

Curried version of r3.

r3Iso :: Iso' (V3 n) (n, n, n) Source #

p3Iso :: Iso' (P3 n) (n, n, n) Source #

project :: (Metric v, Fractional a) => v a -> v a -> v a #

project u v computes the projection of v onto u.

data V3 a :: * -> * #

A 3-dimensional vector

Constructors

 V3 ~a ~a ~a

Instances

 Methods(>>=) :: V3 a -> (a -> V3 b) -> V3 b #(>>) :: V3 a -> V3 b -> V3 b #return :: a -> V3 a #fail :: String -> V3 a # Methodsfmap :: (a -> b) -> V3 a -> V3 b #(<\$) :: a -> V3 b -> V3 a # Methodsmfix :: (a -> V3 a) -> V3 a # Methodspure :: a -> V3 a #(<*>) :: V3 (a -> b) -> V3 a -> V3 b #(*>) :: V3 a -> V3 b -> V3 b #(<*) :: V3 a -> V3 b -> V3 a # Methodsfold :: Monoid m => V3 m -> m #foldMap :: Monoid m => (a -> m) -> V3 a -> m #foldr :: (a -> b -> b) -> b -> V3 a -> b #foldr' :: (a -> b -> b) -> b -> V3 a -> b #foldl :: (b -> a -> b) -> b -> V3 a -> b #foldl' :: (b -> a -> b) -> b -> V3 a -> b #foldr1 :: (a -> a -> a) -> V3 a -> a #foldl1 :: (a -> a -> a) -> V3 a -> a #toList :: V3 a -> [a] #null :: V3 a -> Bool #length :: V3 a -> Int #elem :: Eq a => a -> V3 a -> Bool #maximum :: Ord a => V3 a -> a #minimum :: Ord a => V3 a -> a #sum :: Num a => V3 a -> a #product :: Num a => V3 a -> a # Methodstraverse :: Applicative f => (a -> f b) -> V3 a -> f (V3 b) #sequenceA :: Applicative f => V3 (f a) -> f (V3 a) #mapM :: Monad m => (a -> m b) -> V3 a -> m (V3 b) #sequence :: Monad m => V3 (m a) -> m (V3 a) # Associated Typestype Rep1 (V3 :: * -> *) :: * -> * # Methodsfrom1 :: V3 a -> Rep1 V3 a #to1 :: Rep1 V3 a -> V3 a # Methods(<.>) :: V3 (a -> b) -> V3 a -> V3 b #(.>) :: V3 a -> V3 b -> V3 b #(<.) :: V3 a -> V3 b -> V3 a # Methodsdistribute :: Functor f => f (V3 a) -> V3 (f a) #collect :: Functor f => (a -> V3 b) -> f a -> V3 (f b) #distributeM :: Monad m => m (V3 a) -> V3 (m a) #collectM :: Monad m => (a -> V3 b) -> m a -> V3 (m b) # Associated Typestype Rep (V3 :: * -> *) :: * # Methodstabulate :: (Rep V3 -> a) -> V3 a #index :: V3 a -> Rep V3 -> a # MethodsliftEq :: (a -> b -> Bool) -> V3 a -> V3 b -> Bool # MethodsliftCompare :: (a -> b -> Ordering) -> V3 a -> V3 b -> Ordering # MethodsliftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (V3 a) #liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [V3 a] # MethodsliftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> V3 a -> ShowS #liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [V3 a] -> ShowS # Methodsmzip :: V3 a -> V3 b -> V3 (a, b) #mzipWith :: (a -> b -> c) -> V3 a -> V3 b -> V3 c #munzip :: V3 (a, b) -> (V3 a, V3 b) # MethodsserializeWith :: MonadPut m => (a -> m ()) -> V3 a -> m () #deserializeWith :: MonadGet m => m a -> m (V3 a) # Methodszero :: Num a => V3 a #(^+^) :: Num a => V3 a -> V3 a -> V3 a #(^-^) :: Num a => V3 a -> V3 a -> V3 a #lerp :: Num a => a -> V3 a -> V3 a -> V3 a #liftU2 :: (a -> a -> a) -> V3 a -> V3 a -> V3 a #liftI2 :: (a -> b -> c) -> V3 a -> V3 b -> V3 c # Methodstraverse1 :: Apply f => (a -> f b) -> V3 a -> f (V3 b) #sequence1 :: Apply f => V3 (f b) -> f (V3 b) # Associated Typestype Diff (V3 :: * -> *) :: * -> * # Methods(.-.) :: Num a => V3 a -> V3 a -> Diff V3 a #(.+^) :: Num a => V3 a -> Diff V3 a -> V3 a #(.-^) :: Num a => V3 a -> Diff V3 a -> V3 a # Methods_z :: Functor f => (a -> f a) -> V3 a -> f (V3 a) #_xyz :: Functor f => (V3 a -> f (V3 a)) -> V3 a -> f (V3 a) # Methods_y :: Functor f => (a -> f a) -> V3 a -> f (V3 a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> V3 a -> f (V3 a) # Methods_x :: Functor f => (a -> f a) -> V3 a -> f (V3 a) # Methodsdot :: Num a => V3 a -> V3 a -> a #quadrance :: Num a => V3 a -> a #qd :: Num a => V3 a -> V3 a -> a #distance :: Floating a => V3 a -> V3 a -> a #norm :: Floating a => V3 a -> a #signorm :: Floating a => V3 a -> V3 a # Methods(>>-) :: V3 a -> (a -> V3 b) -> V3 b #join :: V3 (V3 a) -> V3 a # Methodsfold1 :: Semigroup m => V3 m -> m #foldMap1 :: Semigroup m => (a -> m) -> V3 a -> m # Unbox a => Vector Vector (V3 a) MethodsbasicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V3 a) -> m (Vector (V3 a)) #basicUnsafeThaw :: PrimMonad m => Vector (V3 a) -> m (Mutable Vector (PrimState m) (V3 a)) #basicLength :: Vector (V3 a) -> Int #basicUnsafeSlice :: Int -> Int -> Vector (V3 a) -> Vector (V3 a) #basicUnsafeIndexM :: Monad m => Vector (V3 a) -> Int -> m (V3 a) #basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V3 a) -> Vector (V3 a) -> m () #elemseq :: Vector (V3 a) -> V3 a -> b -> b # Unbox a => MVector MVector (V3 a) MethodsbasicLength :: MVector s (V3 a) -> Int #basicUnsafeSlice :: Int -> Int -> MVector s (V3 a) -> MVector s (V3 a) #basicOverlaps :: MVector s (V3 a) -> MVector s (V3 a) -> Bool #basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V3 a)) #basicInitialize :: PrimMonad m => MVector (PrimState m) (V3 a) -> m () #basicUnsafeReplicate :: PrimMonad m => Int -> V3 a -> m (MVector (PrimState m) (V3 a)) #basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> m (V3 a) #basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> V3 a -> m () #basicClear :: PrimMonad m => MVector (PrimState m) (V3 a) -> m () #basicSet :: PrimMonad m => MVector (PrimState m) (V3 a) -> V3 a -> m () #basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V3 a) -> MVector (PrimState m) (V3 a) -> m () #basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V3 a) -> MVector (PrimState m) (V3 a) -> m () #basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> m (MVector (PrimState m) (V3 a)) # Bounded a => Bounded (V3 a) MethodsminBound :: V3 a #maxBound :: V3 a # Eq a => Eq (V3 a) Methods(==) :: V3 a -> V3 a -> Bool #(/=) :: V3 a -> V3 a -> Bool # Floating a => Floating (V3 a) Methodspi :: V3 a #exp :: V3 a -> V3 a #log :: V3 a -> V3 a #sqrt :: V3 a -> V3 a #(**) :: V3 a -> V3 a -> V3 a #logBase :: V3 a -> V3 a -> V3 a #sin :: V3 a -> V3 a #cos :: V3 a -> V3 a #tan :: V3 a -> V3 a #asin :: V3 a -> V3 a #acos :: V3 a -> V3 a #atan :: V3 a -> V3 a #sinh :: V3 a -> V3 a #cosh :: V3 a -> V3 a #tanh :: V3 a -> V3 a #asinh :: V3 a -> V3 a #acosh :: V3 a -> V3 a #atanh :: V3 a -> V3 a #log1p :: V3 a -> V3 a #expm1 :: V3 a -> V3 a #log1pexp :: V3 a -> V3 a #log1mexp :: V3 a -> V3 a # Fractional a => Fractional (V3 a) Methods(/) :: V3 a -> V3 a -> V3 a #recip :: V3 a -> V3 a # Data a => Data (V3 a) Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V3 a -> c (V3 a) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V3 a) #toConstr :: V3 a -> Constr #dataTypeOf :: V3 a -> DataType #dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (V3 a)) #dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V3 a)) #gmapT :: (forall b. Data b => b -> b) -> V3 a -> V3 a #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V3 a -> r #gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V3 a -> r #gmapQ :: (forall d. Data d => d -> u) -> V3 a -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> V3 a -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) # Num a => Num (V3 a) Methods(+) :: V3 a -> V3 a -> V3 a #(-) :: V3 a -> V3 a -> V3 a #(*) :: V3 a -> V3 a -> V3 a #negate :: V3 a -> V3 a #abs :: V3 a -> V3 a #signum :: V3 a -> V3 a # Ord a => Ord (V3 a) Methodscompare :: V3 a -> V3 a -> Ordering #(<) :: V3 a -> V3 a -> Bool #(<=) :: V3 a -> V3 a -> Bool #(>) :: V3 a -> V3 a -> Bool #(>=) :: V3 a -> V3 a -> Bool #max :: V3 a -> V3 a -> V3 a #min :: V3 a -> V3 a -> V3 a # Read a => Read (V3 a) MethodsreadsPrec :: Int -> ReadS (V3 a) #readList :: ReadS [V3 a] #readPrec :: ReadPrec (V3 a) # Show a => Show (V3 a) MethodsshowsPrec :: Int -> V3 a -> ShowS #show :: V3 a -> String #showList :: [V3 a] -> ShowS # Ix a => Ix (V3 a) Methodsrange :: (V3 a, V3 a) -> [V3 a] #index :: (V3 a, V3 a) -> V3 a -> Int #unsafeIndex :: (V3 a, V3 a) -> V3 a -> IntinRange :: (V3 a, V3 a) -> V3 a -> Bool #rangeSize :: (V3 a, V3 a) -> Int #unsafeRangeSize :: (V3 a, V3 a) -> Int Generic (V3 a) Associated Typestype Rep (V3 a) :: * -> * # Methodsfrom :: V3 a -> Rep (V3 a) x #to :: Rep (V3 a) x -> V3 a # Storable a => Storable (V3 a) MethodssizeOf :: V3 a -> Int #alignment :: V3 a -> Int #peekElemOff :: Ptr (V3 a) -> Int -> IO (V3 a) #pokeElemOff :: Ptr (V3 a) -> Int -> V3 a -> IO () #peekByteOff :: Ptr b -> Int -> IO (V3 a) #pokeByteOff :: Ptr b -> Int -> V3 a -> IO () #peek :: Ptr (V3 a) -> IO (V3 a) #poke :: Ptr (V3 a) -> V3 a -> IO () # Binary a => Binary (V3 a) Methodsput :: V3 a -> Put #get :: Get (V3 a) #putList :: [V3 a] -> Put # Serial a => Serial (V3 a) Methodsserialize :: MonadPut m => V3 a -> m () #deserialize :: MonadGet m => m (V3 a) # Serialize a => Serialize (V3 a) Methodsput :: Putter (V3 a) #get :: Get (V3 a) # NFData a => NFData (V3 a) Methodsrnf :: V3 a -> () # Hashable a => Hashable (V3 a) MethodshashWithSalt :: Int -> V3 a -> Int #hash :: V3 a -> Int # Unbox a => Unbox (V3 a) Ixed (V3 a) Methodsix :: Index (V3 a) -> Traversal' (V3 a) (IxValue (V3 a)) # Epsilon a => Epsilon (V3 a) MethodsnearZero :: V3 a -> Bool # Source # Associated Typestype FinalCoord (V3 n) :: * Source #type PrevDim (V3 n) :: * Source #type Decomposition (V3 n) :: * Source # Methods(^&) :: PrevDim (V3 n) -> FinalCoord (V3 n) -> V3 n Source #pr :: PrevDim (V3 n) -> FinalCoord (V3 n) -> V3 n Source #coords :: V3 n -> Decomposition (V3 n) Source # Methodsimap :: (E V3 -> a -> b) -> V3 a -> V3 b #imapped :: (Indexable (E V3) p, Settable f) => p a (f b) -> V3 a -> f (V3 b) # MethodsifoldMap :: Monoid m => (E V3 -> a -> m) -> V3 a -> m #ifolded :: (Indexable (E V3) p, Contravariant f, Applicative f) => p a (f a) -> V3 a -> f (V3 a) #ifoldr :: (E V3 -> a -> b -> b) -> b -> V3 a -> b #ifoldl :: (E V3 -> b -> a -> b) -> b -> V3 a -> b #ifoldr' :: (E V3 -> a -> b -> b) -> b -> V3 a -> b #ifoldl' :: (E V3 -> b -> a -> b) -> b -> V3 a -> b # Methodsitraverse :: Applicative f => (E V3 -> a -> f b) -> V3 a -> f (V3 b) #itraversed :: (Indexable (E V3) p, Applicative f) => p a (f b) -> V3 a -> f (V3 b) # Each (V3 a) (V3 b) a b Methodseach :: Traversal (V3 a) (V3 b) a b # # MethodsgetTrace :: BoundingBox V3 n -> Trace (V (BoundingBox V3 n)) (N (BoundingBox V3 n)) # type Rep1 V3 type Rep1 V3 = D1 (MetaData "V3" "Linear.V3" "linear-1.20.5-HNp3u7otG3f6j5uIJWPLJY" False) (C1 (MetaCons "V3" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) Par1) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) Par1) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) Par1)))) type Rep V3 type Rep V3 = E V3 type Diff V3 type Diff V3 = V3 data MVector s (V3 a) data MVector s (V3 a) = MV_V3 ~Int ~(MVector s a) type Rep (V3 a) type Rep (V3 a) = D1 (MetaData "V3" "Linear.V3" "linear-1.20.5-HNp3u7otG3f6j5uIJWPLJY" False) (C1 (MetaCons "V3" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))))) type V (V3 n) # type V (V3 n) = V3 type N (V3 n) # type N (V3 n) = n data Vector (V3 a) data Vector (V3 a) = V_V3 ~Int ~(Vector a) type Index (V3 a) type Index (V3 a) = E V3 type IxValue (V3 a) type IxValue (V3 a) = a type FinalCoord (V3 n) Source # type FinalCoord (V3 n) = n type PrevDim (V3 n) Source # type PrevDim (V3 n) = V2 n type Decomposition (V3 n) Source # type Decomposition (V3 n) = (:&) ((:&) n n) n

type P3 = Point V3 Source #

class R1 t where #

A space that has at least 1 basis vector _x.

Minimal complete definition

Nothing

Instances

 Methods_x :: Functor f => (a -> f a) -> Identity a -> f (Identity a) # Methods_x :: Functor f => (a -> f a) -> V4 a -> f (V4 a) # Methods_x :: Functor f => (a -> f a) -> V3 a -> f (V3 a) # Methods_x :: Functor f => (a -> f a) -> V2 a -> f (V2 a) # Methods_x :: Functor f => (a -> f a) -> V1 a -> f (V1 a) # R1 f => R1 (Point f) Methods_x :: Functor f => (a -> f a) -> Point f a -> f (Point f a) #

class R1 t => R2 t where #

A space that distinguishes 2 orthogonal basis vectors _x and _y, but may have more.

Minimal complete definition

Nothing

Instances

 Methods_y :: Functor f => (a -> f a) -> V4 a -> f (V4 a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> V4 a -> f (V4 a) # Methods_y :: Functor f => (a -> f a) -> V3 a -> f (V3 a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> V3 a -> f (V3 a) # Methods_y :: Functor f => (a -> f a) -> V2 a -> f (V2 a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> V2 a -> f (V2 a) # R2 f => R2 (Point f) Methods_y :: Functor f => (a -> f a) -> Point f a -> f (Point f a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> Point f a -> f (Point f a) #

class R2 t => R3 t where #

A space that distinguishes 3 orthogonal basis vectors: _x, _y, and _z. (It may have more)

Minimal complete definition

Nothing

Instances

 Methods_z :: Functor f => (a -> f a) -> V4 a -> f (V4 a) #_xyz :: Functor f => (V3 a -> f (V3 a)) -> V4 a -> f (V4 a) # Methods_z :: Functor f => (a -> f a) -> V3 a -> f (V3 a) #_xyz :: Functor f => (V3 a -> f (V3 a)) -> V3 a -> f (V3 a) # R3 f => R3 (Point f) Methods_z :: Functor f => (a -> f a) -> Point f a -> f (Point f a) #_xyz :: Functor f => (V3 a -> f (V3 a)) -> Point f a -> f (Point f a) #

# Orphan instances

 Source # Methods_phi :: RealFloat n => Lens' (V3 n) (Angle n) Source # Source # Methods_theta :: RealFloat n => Lens' (V3 n) (Angle n) Source # Source # Methods_r :: RealFloat n => Lens' (V3 n) n Source # Source # Methodstransform :: Transformation (V (V3 n)) (N (V3 n)) -> V3 n -> V3 n #