AC-Vector-Fancy-2.1.0: Fancy type system stuff for AC-VectorSource codeContentsIndex
Data.Vector.Fancy
Description
Various facilities for dealing with vectors generically.
Synopsis
class VectorAxis vector axis where
get_coord :: axis -> vector -> Scalar
set_coord :: axis -> Scalar -> vector -> vector
class Project lo hi where
orthographic_down :: hi -> (lo, Scalar)
orthographic_up :: (lo, Scalar) -> hi
perspective_down :: hi -> (lo, Scalar)
perspective_up :: (lo, Scalar) -> hi
Documentation
class VectorAxis vector axis whereSource
Class for generically reading/writing vector coordinates.
Methods
get_coord :: axis -> vector -> ScalarSource
Read from the specified coordinate axis.
set_coord :: axis -> Scalar -> vector -> vectorSource
Replace the existing value of the given coordinate axis.
show/hide Instances
class Project lo hi whereSource
This class relates two vector types having consecutive sizes.
Methods
orthographic_down :: hi -> (lo, Scalar)Source
Reduce number of dimensions by one. (Return the dropped dimension as a Scalar.)
orthographic_up :: (lo, Scalar) -> hiSource
Increase number of dimensions by one. (Supply value for new dimension as a Scalar.)
perspective_down :: hi -> (lo, Scalar)Source
Perspective-project to N-1 dimensions. (Also return the distance from the camera as a Scalar.)
perspective_up :: (lo, Scalar) -> hiSource
Inverse-perspective project into N+1 dimension. (Supply the distance from the camera as a Scalar.)
show/hide Instances
Produced by Haddock version 2.6.1