Portability | non-portable |
---|---|

Stability | experimental |

Maintainer | Edward Kmett <ekmett@gmail.com> |

Safe Haskell | Trustworthy |

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

- data Plucker a = Plucker !a !a !a !a !a !a
- squaredError :: (Eq a, Num a) => Plucker a -> a
- isotropic :: Epsilon a => Plucker a -> Bool
- (><) :: Num a => Plucker a -> Plucker a -> a
- plucker :: Num a => V4 a -> V4 a -> Plucker a
- plucker3D :: Num a => V3 a -> V3 a -> Plucker a
- parallel :: Epsilon a => Plucker a -> Plucker a -> Bool
- intersects :: (Epsilon a, Ord a) => Plucker a -> Plucker a -> Bool
- data LinePass
- passes :: (Epsilon a, Num a, Ord a) => Plucker a -> Plucker a -> LinePass
- quadranceToOrigin :: Fractional a => Plucker a -> a
- closestToOrigin :: Fractional a => Plucker a -> V3 a
- isLine :: Epsilon a => Plucker a -> Bool
- data Coincides a where
- p01 :: Lens' (Plucker a) a
- p02 :: Lens' (Plucker a) a
- p03 :: Lens' (Plucker a) a
- p10 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a)
- p12 :: Lens' (Plucker a) a
- p13 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a)
- p20 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a)
- p21 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a)
- p23 :: Lens' (Plucker a) a
- p30 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a)
- p31 :: Lens' (Plucker a) a
- p32 :: (Functor f, Num a) => (a -> f a) -> Plucker a -> f (Plucker a)
- e01 :: E Plucker
- e02 :: E Plucker
- e03 :: E Plucker
- e12 :: E Plucker
- e31 :: E Plucker
- e23 :: E Plucker

# Documentation

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

Plucker !a !a !a !a !a !a |

Monad Plucker | |

Functor Plucker | |

MonadFix Plucker | |

Applicative Plucker | |

Foldable Plucker | |

Traversable Plucker | |

Generic1 Plucker | |

Distributive Plucker | |

Representable Plucker | |

MonadZip Plucker | |

Traversable1 Plucker | |

Foldable1 Plucker | |

Apply Plucker | |

Bind Plucker | |

Additive Plucker | |

Metric Plucker | |

Trace Plucker | |

Affine Plucker | |

Unbox a => Vector Vector (Plucker a) | |

Unbox a => MVector MVector (Plucker a) | |

Eq a => Eq (Plucker a) | |

Fractional a => Fractional (Plucker a) | |

Num a => Num (Plucker a) | |

Ord a => Ord (Plucker a) | |

Read a => Read (Plucker a) | |

Show a => Show (Plucker a) | |

Ix a => Ix (Plucker a) | |

Generic (Plucker a) | |

Storable a => Storable (Plucker a) | |

Unbox a => Unbox (Plucker a) | |

Ixed (Plucker a) | |

Epsilon a => Epsilon (Plucker a) | |

FunctorWithIndex (E Plucker) Plucker | |

FoldableWithIndex (E Plucker) Plucker | |

TraversableWithIndex (E Plucker) Plucker | |

Each (Plucker a) (Plucker b) a b |

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

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 -> BoolSource

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 -> aSource

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 aSource

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 aSource

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

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

Checks if two lines intersect (or nearly intersect).

Describe how two lines pass each other.

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 -> LinePassSource

Check how two lines pass each other. `passes l1 l2`

describes
`l2`

when looking down `l1`

.

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

The minimum squared distance of a line from the origin.

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

The point where a line is closest to the origin.

isLine :: Epsilon a => Plucker a -> BoolSource

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.

When lines are represented as Plücker coordinates, we have the
ability to check for both directed and undirected
equality. Undirected equality between `Line`

s (or a `Line`

and a
`Ray`

) checks that the two lines coincide in 3D space. Directed
equality, between two `Ray`

s, checks that two lines coincide in 3D,
and have the same direction. To accomodate these two notions of
equality, we use an `Eq`

instance on the `Coincides`

data type.

For example, to check the *directed* equality between two lines,
`p1`

and `p2`

, we write, `Ray p1 == Ray p2`

.

# Basis elements

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

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

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

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