SG-1.0: Small geometry library for dealing with vectors and collision detectionSource codeContentsIndex
Data.SG.Geometry.ThreeDim
Description
A module with types to use in a 3D system, and various helper functions. Several more functions are available for use in the Data.SG.Geometry module.
Synopsis
newtype Point3' a = Point3 (a, a, a)
data Rel3' a = Rel3 (a, a, a) a
makeRel3 :: Num a => (a, a, a) -> Rel3' a
data Line3' a = Line3 {
getLineStart3 :: Point3' a
getLineDir3 :: Rel3' a
}
Documentation
newtype Point3' a Source
A point in 3D space.
Constructors
Point3 (a, a, a)
show/hide Instances
data Rel3' a Source
A relative vector (free vector) in 3D space. The triple is the x, y, z components, and the last item is the squared magnitude of the vector, which is stored with it to speed up various operations. It is suggested you use makeRel3 to create one of these, unless the magnitude is easily apparent, e.g. Rel3 (0, 1, 1) 2
Constructors
Rel3 (a, a, a) a
show/hide Instances
makeRel3 :: Num a => (a, a, a) -> Rel3' aSource
Constructs a Rel3' vector
data Line3' a Source
A line in 3D space. A line is a point and a free vector indicating direction. A line may be treated by a function as either finite (taking the magnitude of the free vector as the length) or infinite (ignoring the magnitude of the direction vector).
Constructors
Line3
getLineStart3 :: Point3' a
getLineDir3 :: Rel3' a
show/hide Instances
Produced by Haddock version 2.6.0