cobot-0.1.1.8: Computational biology toolkit to collaborate with researchers in constructive protein engineering
Safe HaskellSafe-Inferred
LanguageHaskell2010

Bio.Utils.Geometry

Synopsis

Documentation

type R = Float Source #

Default floating point type, switch here to move to Doubles

type V3R = V3 R Source #

Defalut type of 3D vectors

data Ray a Source #

Ray has an origin and a direction

Constructors

Ray 

Fields

class AffineTransformable a where Source #

Affine transformations for vectors and sets of vectors

Methods

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

Instances details
AffineTransformable V3R Source #

We can apply affine transformations to vectors

Instance details

Defined in Bio.Utils.Geometry

Methods

rotate :: V3R -> R -> V3R -> V3R Source #

rotateR :: Ray V3R -> R -> V3R -> V3R Source #

translate :: V3R -> V3R -> V3R Source #

Functor f => AffineTransformable (f V3R) Source #

If we have any collection of vectors, than we can transform it too

Instance details

Defined in Bio.Utils.Geometry

Methods

rotate :: V3R -> R -> f V3R -> f V3R Source #

rotateR :: Ray V3R -> R -> f V3R -> f V3R Source #

translate :: V3R -> f V3R -> f V3R Source #

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

Methods

nearZero :: a -> Bool #

Determine if a quantity is near zero.

Instances

Instances details
Epsilon CDouble
abs a <= 1e-12
Instance details

Defined in Linear.Epsilon

Methods

nearZero :: CDouble -> Bool #

Epsilon CFloat
abs a <= 1e-6
Instance details

Defined in Linear.Epsilon

Methods

nearZero :: CFloat -> Bool #

Epsilon Double
abs a <= 1e-12
Instance details

Defined in Linear.Epsilon

Methods

nearZero :: Double -> Bool #

Epsilon Float
abs a <= 1e-6
Instance details

Defined in Linear.Epsilon

Methods

nearZero :: Float -> Bool #

(Epsilon a, RealFloat a) => Epsilon (Complex a) 
Instance details

Defined in Linear.Epsilon

Methods

nearZero :: Complex a -> Bool #

Epsilon a => Epsilon (Plucker a) 
Instance details

Defined in Linear.Plucker

Methods

nearZero :: Plucker a -> Bool #

(RealFloat a, Epsilon a) => Epsilon (Quaternion a) 
Instance details

Defined in Linear.Quaternion

Methods

nearZero :: Quaternion a -> Bool #

Epsilon (V0 a) 
Instance details

Defined in Linear.V0

Methods

nearZero :: V0 a -> Bool #

Epsilon a => Epsilon (V1 a) 
Instance details

Defined in Linear.V1

Methods

nearZero :: V1 a -> Bool #

Epsilon a => Epsilon (V2 a) 
Instance details

Defined in Linear.V2

Methods

nearZero :: V2 a -> Bool #

Epsilon a => Epsilon (V3 a) 
Instance details

Defined in Linear.V3

Methods

nearZero :: V3 a -> Bool #

Epsilon a => Epsilon (V4 a) 
Instance details

Defined in Linear.V4

Methods

nearZero :: V4 a -> Bool #

(Dim n, Epsilon a) => Epsilon (V n a) 
Instance details

Defined in Linear.V

Methods

nearZero :: V n a -> Bool #

zoRay :: V3R -> Ray V3R Source #

Zero-origin ray

cross :: Num a => V3 a -> V3 a -> V3 a #

cross product

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

norm :: (Metric f, Floating a) => f a -> a #

Compute the norm of a vector in a metric space

normalize :: (Floating a, Metric f, Epsilon a) => f a -> f a #

Normalize a Metric functor to have unit norm. This function does not change the functor if its norm is 0 or 1.

distance :: (Metric f, Floating a) => f a -> f a -> a #

Compute the distance between two vectors in a metric space

angle :: V3R -> V3R -> R Source #

Measure angle between vectors

dihedral :: V3R -> V3R -> V3R -> V3R -> R Source #

Measure dihedral between four points by https://math.stackexchange.com/a/47084

svd3 :: M33 R -> SVD (M33 R) Source #

Singular value decomposition for 3x3 matricies