linear-1.20.4: Linear Algebra

Copyright(C) 2012-2015 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell98

Linear.Plucker

Contents

Description

Plücker coordinates for lines in 3d homogeneous space.

Synopsis

Documentation

data Plucker a Source

Plücker coordinates for lines in a 3-dimensional space.

Constructors

Plucker !a !a !a !a !a !a 

Instances

Monad Plucker Source 
Functor Plucker Source 
MonadFix Plucker Source 
Applicative Plucker Source 
Foldable Plucker Source 
Traversable Plucker Source 
Generic1 Plucker Source 
Distributive Plucker Source 
Representable Plucker Source 
MonadZip Plucker Source 
Serial1 Plucker Source 
Traversable1 Plucker Source 
Apply Plucker Source 
Bind Plucker Source 
Foldable1 Plucker Source 
Eq1 Plucker Source 
Ord1 Plucker Source 
Read1 Plucker Source 
Show1 Plucker Source 
Additive Plucker Source 
Metric Plucker Source 
Trace Plucker Source 
Affine Plucker Source 
Unbox a => Vector Vector (Plucker a) Source 
Unbox a => MVector MVector (Plucker a) Source 
Eq a => Eq (Plucker a) Source 
Floating a => Floating (Plucker a) Source 
Fractional a => Fractional (Plucker a) Source 
Num a => Num (Plucker a) Source 
Ord a => Ord (Plucker a) Source 
Read a => Read (Plucker a) Source 
Show a => Show (Plucker a) Source 
Ix a => Ix (Plucker a) Source 
Generic (Plucker a) Source 
Storable a => Storable (Plucker a) Source 
Binary a => Binary (Plucker a) Source 
Serial a => Serial (Plucker a) Source 
Serialize a => Serialize (Plucker a) Source 
NFData a => NFData (Plucker a) Source 
Hashable a => Hashable (Plucker a) Source 
Unbox a => Unbox (Plucker a) Source 
Ixed (Plucker a) Source 
Epsilon a => Epsilon (Plucker a) Source 
FunctorWithIndex (E Plucker) Plucker Source 
FoldableWithIndex (E Plucker) Plucker Source 
TraversableWithIndex (E Plucker) Plucker Source 
Each (Plucker a) (Plucker b) a b Source 
type Rep1 Plucker Source 
type Rep Plucker = E Plucker Source 
type Diff Plucker = Plucker Source 
data MVector s (Plucker a) = MV_Plucker !Int (MVector s a) Source 
type Rep (Plucker a) Source 
data Vector (Plucker a) = V_Plucker !Int (Vector a) Source 
type Index (Plucker a) = E Plucker Source 
type IxValue (Plucker a) = a Source 

squaredError :: (Eq a, Num a) => Plucker a -> a Source

Valid Plücker coordinates p will have squaredError p == 0

That said, floating point makes a mockery of this claim, so you may want to use nearZero.

isotropic :: Epsilon a => Plucker a -> Bool Source

Checks if the line is near-isotropic (isotropic vectors in this quadratic space represent lines in real 3d space).

(><) :: Num a => Plucker a -> Plucker a -> a infixl 5 Source

This isn't th actual metric because this bilinear form gives rise to an isotropic quadratic space

plucker :: Num a => V4 a -> V4 a -> Plucker a Source

Given a pair of points represented by homogeneous coordinates generate Plücker coordinates for the line through them, directed from the second towards the first.

plucker3D :: Num a => V3 a -> V3 a -> Plucker a Source

Given a pair of 3D points, generate Plücker coordinates for the line through them, directed from the second towards the first.

Operations on lines

parallel :: Epsilon a => Plucker a -> Plucker a -> Bool Source

Checks if two lines are parallel.

intersects :: (Epsilon a, Ord a) => Plucker a -> Plucker a -> Bool Source

Checks if two lines intersect (or nearly intersect).

data LinePass Source

Describe how two lines pass each other.

Constructors

Coplanar

The lines are coplanar (parallel or intersecting).

Clockwise

The lines pass each other clockwise (right-handed screw)

Counterclockwise

The lines pass each other counterclockwise (left-handed screw).

passes :: (Epsilon a, Num a, Ord a) => Plucker a -> Plucker a -> LinePass Source

Check how two lines pass each other. passes l1 l2 describes l2 when looking down l1.

quadranceToOrigin :: Fractional a => Plucker a -> a Source

The minimum squared distance of a line from the origin.

closestToOrigin :: Fractional a => Plucker a -> V3 a Source

The point where a line is closest to the origin.

isLine :: Epsilon a => Plucker a -> Bool Source

Not all 6-dimensional points correspond to a line in 3D. This predicate tests that a Plücker coordinate lies on the Grassmann manifold, and does indeed represent a 3D line.

coincides :: (Epsilon a, Fractional a) => Plucker a -> Plucker a -> Bool Source

Checks if two lines coincide in space. In other words, undirected equality.

coincides' :: (Epsilon a, Fractional a, Ord a) => Plucker a -> Plucker a -> Bool Source

Checks if two lines coincide in space, and have the same orientation.

Basis elements

p01 :: Lens' (Plucker a) a Source

These elements form a basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p01 :: Lens' (Plucker a) a
p02 :: Lens' (Plucker a) a
p03 :: Lens' (Plucker a) a
p23 :: Lens' (Plucker a) a
p31 :: Lens' (Plucker a) a
p12 :: Lens' (Plucker a) a

p02 :: Lens' (Plucker a) a Source

These elements form a basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p01 :: Lens' (Plucker a) a
p02 :: Lens' (Plucker a) a
p03 :: Lens' (Plucker a) a
p23 :: Lens' (Plucker a) a
p31 :: Lens' (Plucker a) a
p12 :: Lens' (Plucker a) a

p03 :: Lens' (Plucker a) a Source

These elements form a basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p01 :: Lens' (Plucker a) a
p02 :: Lens' (Plucker a) a
p03 :: Lens' (Plucker a) a
p23 :: Lens' (Plucker a) a
p31 :: Lens' (Plucker a) a
p12 :: Lens' (Plucker a) a

p10 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a) Source

These elements form an alternate basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p10 :: Num a => Lens' (Plucker a) a
p20 :: Num a => Lens' (Plucker a) a
p30 :: Num a => Lens' (Plucker a) a
p32 :: Num a => Lens' (Plucker a) a
p13 :: Num a => Lens' (Plucker a) a
p21 :: Num a => Lens' (Plucker a) a

p12 :: Lens' (Plucker a) a Source

These elements form a basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p01 :: Lens' (Plucker a) a
p02 :: Lens' (Plucker a) a
p03 :: Lens' (Plucker a) a
p23 :: Lens' (Plucker a) a
p31 :: Lens' (Plucker a) a
p12 :: Lens' (Plucker a) a

p13 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a) Source

These elements form an alternate basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p10 :: Num a => Lens' (Plucker a) a
p20 :: Num a => Lens' (Plucker a) a
p30 :: Num a => Lens' (Plucker a) a
p32 :: Num a => Lens' (Plucker a) a
p13 :: Num a => Lens' (Plucker a) a
p21 :: Num a => Lens' (Plucker a) a

p20 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a) Source

These elements form an alternate basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p10 :: Num a => Lens' (Plucker a) a
p20 :: Num a => Lens' (Plucker a) a
p30 :: Num a => Lens' (Plucker a) a
p32 :: Num a => Lens' (Plucker a) a
p13 :: Num a => Lens' (Plucker a) a
p21 :: Num a => Lens' (Plucker a) a

p21 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a) Source

These elements form an alternate basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p10 :: Num a => Lens' (Plucker a) a
p20 :: Num a => Lens' (Plucker a) a
p30 :: Num a => Lens' (Plucker a) a
p32 :: Num a => Lens' (Plucker a) a
p13 :: Num a => Lens' (Plucker a) a
p21 :: Num a => Lens' (Plucker a) a

p23 :: Lens' (Plucker a) a Source

These elements form a basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p01 :: Lens' (Plucker a) a
p02 :: Lens' (Plucker a) a
p03 :: Lens' (Plucker a) a
p23 :: Lens' (Plucker a) a
p31 :: Lens' (Plucker a) a
p12 :: Lens' (Plucker a) a

p30 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a) Source

These elements form an alternate basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p10 :: Num a => Lens' (Plucker a) a
p20 :: Num a => Lens' (Plucker a) a
p30 :: Num a => Lens' (Plucker a) a
p32 :: Num a => Lens' (Plucker a) a
p13 :: Num a => Lens' (Plucker a) a
p21 :: Num a => Lens' (Plucker a) a

p31 :: Lens' (Plucker a) a Source

These elements form a basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p01 :: Lens' (Plucker a) a
p02 :: Lens' (Plucker a) a
p03 :: Lens' (Plucker a) a
p23 :: Lens' (Plucker a) a
p31 :: Lens' (Plucker a) a
p12 :: Lens' (Plucker a) a

p32 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a) Source

These elements form an alternate basis for the Plücker space, or the Grassmanian manifold Gr(2,V4).

p10 :: Num a => Lens' (Plucker a) a
p20 :: Num a => Lens' (Plucker a) a
p30 :: Num a => Lens' (Plucker a) a
p32 :: Num a => Lens' (Plucker a) a
p13 :: Num a => Lens' (Plucker a) a
p21 :: Num a => Lens' (Plucker a) a