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

Copyright(c) 2011 diagrams-lib team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellNone
LanguageHaskell2010

Diagrams.ThreeD.Types

Contents

Description

Basic types for three-dimensional Euclidean space.

Synopsis

3D Euclidean space

data R3

The three-dimensional Euclidean vector space R^3.

Constructors

R3 !Double !Double !Double 

r3 :: (Double, Double, Double) -> R3

Construct a 3D vector from a triple of components.

unr3 :: R3 -> (Double, Double, Double)

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

mkR3 :: Double -> Double -> Double -> R3

Curried version of r3.

type P3 = Point R3

Points in R^3.

p3 :: (Double, Double, Double) -> P3

Construct a 3D point from a triple of coordinates.

unp3 :: P3 -> (Double, Double, Double)

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

mkP3 :: Double -> Double -> Double -> P3

Curried version of r3.

type T3 = Transformation R3

Transformations in R^3.

Directions in 3D

data Direction

A Direction represents directions in R3. The constructor is not exported; Directions can be used with fromDirection and the lenses provided by its instances.

direction :: R3 -> Direction

direction v is the direction in which v points. Returns an unspecified value when given the zero vector as input.

fromDirection :: Direction -> R3

fromDirection d is the unit vector in the direction d.

angleBetweenDirs :: Direction -> Direction -> Angle

compute the positive angle between the two directions in their common plane

other coördinate systems

class Spherical t where

Types which can be expressed in spherical 3D coordinates, as a triple (r,θ,φ), where θ is rotation about the Z axis, and φ is the angle from the Z axis.

Methods

spherical :: Iso' t (Double, Angle, Angle)

Instances

class Cylindrical t where

Types which can be expressed in cylindrical 3D coordinates.

class HasPhi t where

The class of types with at least two angle coordinates, the second called _phi.

Minimal complete definition

Nothing

Methods

_phi :: Lens' t Angle