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

Diagrams.ThreeD.Types

Description

Basic types for three-dimensional Euclidean space.

Synopsis

# 3D Euclidean space

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

Construct a 3D vector from a triple of components.

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

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

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

Curried version of r3.

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

Construct a 3D point from a triple of coordinates.

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

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

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

Curried version of r3.

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

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

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

project u v computes the projection of v onto u.

r3SphericalIso :: RealFloat n => Iso' (V3 n) (n, Angle n, Angle n) #

r3CylindricalIso :: RealFloat n => Iso' (V3 n) (n, Angle n, n) #

data V3 a #

A 3-dimensional vector

Constructors

 V3 !a !a !a
Instances

type P3 = Point V3 #

class R1 (t :: Type -> Type) where #

A space that has at least 1 basis vector _x.

Methods

_x :: Lens' (t a) a #

>>> V1 2 ^._x
2

>>> V1 2 & _x .~ 3
V1 3

Instances
 Instance detailsDefined in Linear.V1 Methods_x :: Lens' (Identity a) a # Instance detailsDefined in Linear.V4 Methods_x :: Lens' (V4 a) a # Instance detailsDefined in Linear.V3 Methods_x :: Lens' (V3 a) a # Instance detailsDefined in Linear.V2 Methods_x :: Lens' (V2 a) a # Instance detailsDefined in Linear.V1 Methods_x :: Lens' (V1 a) a # R1 f => R1 (Point f) Instance detailsDefined in Linear.Affine Methods_x :: Lens' (Point f a) a #

class R1 t => R2 (t :: Type -> Type) where #

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

Minimal complete definition

_xy

Methods

_y :: Lens' (t a) a #

>>> V2 1 2 ^._y
2

>>> V2 1 2 & _y .~ 3
V2 1 3


_xy :: Lens' (t a) (V2 a) #

Instances
 Instance detailsDefined in Linear.V4 Methods_y :: Lens' (V4 a) a #_xy :: Lens' (V4 a) (V2 a) # Instance detailsDefined in Linear.V3 Methods_y :: Lens' (V3 a) a #_xy :: Lens' (V3 a) (V2 a) # Instance detailsDefined in Linear.V2 Methods_y :: Lens' (V2 a) a #_xy :: Lens' (V2 a) (V2 a) # R2 f => R2 (Point f) Instance detailsDefined in Linear.Affine Methods_y :: Lens' (Point f a) a #_xy :: Lens' (Point f a) (V2 a) #

class R2 t => R3 (t :: Type -> Type) where #

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

Methods

_z :: Lens' (t a) a #

>>> V3 1 2 3 ^. _z
3


_xyz :: Lens' (t a) (V3 a) #

Instances
 Instance detailsDefined in Linear.V4 Methods_z :: Lens' (V4 a) a #_xyz :: Lens' (V4 a) (V3 a) # Instance detailsDefined in Linear.V3 Methods_z :: Lens' (V3 a) a #_xyz :: Lens' (V3 a) (V3 a) # R3 f => R3 (Point f) Instance detailsDefined in Linear.Affine Methods_z :: Lens' (Point f a) a #_xyz :: Lens' (Point f a) (V3 a) #

# Orphan instances

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