Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type R = Float
- type V3R = V3 R
- data Ray a = Ray {
- _origin :: a
- _direction :: a
- class AffineTransformable a where
- class Num a => Epsilon a where
- zoRay :: V3R -> Ray V3R
- cross :: Num a => V3 a -> V3 a -> V3 a
- dot :: (Metric f, Num a) => f a -> f a -> a
- norm :: (Metric f, Floating a) => f a -> a
- normalize :: (Floating a, Metric f, Epsilon a) => f a -> f a
- distance :: (Metric f, Floating a) => f a -> f a -> a
- angle :: V3R -> V3R -> R
- dihedral :: V3R -> V3R -> V3R -> V3R -> R
- svd3 :: M33 R -> SVD (M33 R)
Documentation
class AffineTransformable a where Source #
Affine transformations for vectors and sets of vectors
rotate :: V3R -> R -> a -> a Source #
Rotate an object around the vector by some angle
rotateR :: Ray V3R -> R -> a -> a Source #
Rotate an object around the ray by some angle
translate :: V3R -> a -> a Source #
Translocate an object by some vectors
Instances
AffineTransformable V3R Source # | We can apply affine transformations to vectors |
Functor f => AffineTransformable (f V3R) Source # | If we have any collection of vectors, than we can transform it too |
class Num a => Epsilon a where #
Provides a fairly subjective test to see if a quantity is near zero.
>>>
nearZero (1e-11 :: Double)
False
>>>
nearZero (1e-17 :: Double)
True
>>>
nearZero (1e-5 :: Float)
False
>>>
nearZero (1e-7 :: Float)
True
Instances
Epsilon Double |
|
Defined in Linear.Epsilon | |
Epsilon Float |
|
Defined in Linear.Epsilon | |
Epsilon CFloat |
|
Defined in Linear.Epsilon | |
Epsilon CDouble |
|
Defined in Linear.Epsilon | |
(Epsilon a, RealFloat a) => Epsilon (Complex a) | |
Defined in Linear.Epsilon | |
Epsilon a => Epsilon (Plucker a) | |
Defined in Linear.Plucker | |
(RealFloat a, Epsilon a) => Epsilon (Quaternion a) | |
Defined in Linear.Quaternion nearZero :: Quaternion a -> Bool # | |
Epsilon (V0 a) | |
Epsilon a => Epsilon (V4 a) | |
Epsilon a => Epsilon (V3 a) | |
Epsilon a => Epsilon (V2 a) | |
Epsilon a => Epsilon (V1 a) | |
(Dim n, Epsilon a) => Epsilon (V n a) | |
dot :: (Metric f, Num a) => f a -> f a -> a #
Compute the inner product of two vectors or (equivalently)
convert a vector f a
into a covector f a -> a
.
>>>
V2 1 2 `dot` V2 3 4
11
distance :: (Metric f, Floating a) => f a -> f a -> a #
Compute the distance between two vectors in a metric space