Copyright | 2014 Edward Kmett Charles Durham [2015..2020] Trevor L. McDonell |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Trevor L. McDonell <trevor.mcdonell@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.Array.Accelerate.Linear.Plucker
Description
Plücker coordinates for lines in 3d homogeneous space.
Synopsis
- data Plucker a = Plucker !a !a !a !a !a !a
- pattern Plucker_ :: Elt a => Exp a -> Exp a -> Exp a -> Exp a -> Exp a -> Exp a -> Exp (Plucker a)
- squaredError :: forall a. Num a => Exp (Plucker a) -> Exp a
- isotropic :: Epsilon a => Exp (Plucker a) -> Exp Bool
- (><) :: forall a. Num a => Exp (Plucker a) -> Exp (Plucker a) -> Exp a
- plucker :: forall a. Num a => Exp (V4 a) -> Exp (V4 a) -> Exp (Plucker a)
- plucker3D :: forall a. Num a => Exp (V3 a) -> Exp (V3 a) -> Exp (Plucker a)
- data LinePass
- pattern Clockwise_ :: HasCallStack => Exp LinePass
- pattern Counterclockwise_ :: HasCallStack => Exp LinePass
- pattern Coplanar_ :: HasCallStack => Exp LinePass
- parallel :: Epsilon a => Exp (Plucker a) -> Exp (Plucker a) -> Exp Bool
- intersects :: (Epsilon a, Ord a) => Exp (Plucker a) -> Exp (Plucker a) -> Exp Bool
- passes :: (Epsilon a, Ord a) => Exp (Plucker a) -> Exp (Plucker a) -> Exp LinePass
- quadranceToOrigin :: Fractional a => Exp (Plucker a) -> Exp a
- closestToOrigin :: Fractional a => Exp (Plucker a) -> Exp (V3 a)
- isLine :: Epsilon a => Exp (Plucker a) -> Exp Bool
- p01 :: Elt a => Lens' (Exp (Plucker a)) (Exp a)
- p02 :: Elt a => Lens' (Exp (Plucker a)) (Exp a)
- p03 :: Elt a => Lens' (Exp (Plucker a)) (Exp a)
- p10 :: Num a => Lens' (Exp (Plucker a)) (Exp a)
- p12 :: Elt a => Lens' (Exp (Plucker a)) (Exp a)
- p13 :: Num a => Lens' (Exp (Plucker a)) (Exp a)
- p20 :: Num a => Lens' (Exp (Plucker a)) (Exp a)
- p21 :: Num a => Lens' (Exp (Plucker a)) (Exp a)
- p23 :: Elt a => Lens' (Exp (Plucker a)) (Exp a)
- p30 :: Num a => Lens' (Exp (Plucker a)) (Exp a)
- p31 :: Elt a => Lens' (Exp (Plucker a)) (Exp a)
- p32 :: Num a => Lens' (Exp (Plucker a)) (Exp a)
Documentation
Plücker coordinates for lines in a 3-dimensional space.
Constructors
Plucker !a !a !a !a !a !a |
Instances
pattern Plucker_ :: Elt a => Exp a -> Exp a -> Exp a -> Exp a -> Exp a -> Exp a -> Exp (Plucker a) Source #
squaredError :: forall a. Num a => Exp (Plucker a) -> Exp 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 => Exp (Plucker a) -> Exp Bool Source #
Checks if the line is near-isotropic (isotropic vectors in this quadratic space represent lines in real 3D space).
(><) :: forall a. Num a => Exp (Plucker a) -> Exp (Plucker a) -> Exp a infixl 5 Source #
This isn't the actual metric because this bilinear form gives rise to an isotropic quadratic space.
plucker :: forall a. Num a => Exp (V4 a) -> Exp (V4 a) -> Exp (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 :: forall a. Num a => Exp (V3 a) -> Exp (V3 a) -> Exp (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
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). |
Instances
Eq LinePass | |
Show LinePass | |
Generic LinePass | |
Eq LinePass Source # | |
Elt LinePass Source # | |
type Rep LinePass | |
Defined in Linear.Plucker type Rep LinePass = D1 (MetaData "LinePass" "Linear.Plucker" "linear-1.21.1-GSRtap511Ww6RirKx1xviJ" False) (C1 (MetaCons "Coplanar" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Clockwise" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Counterclockwise" PrefixI False) (U1 :: Type -> Type))) | |
type EltR LinePass | |
Defined in Data.Array.Accelerate.Linear.Plucker |
pattern Clockwise_ :: HasCallStack => Exp LinePass Source #
pattern Counterclockwise_ :: HasCallStack => Exp LinePass Source #
parallel :: Epsilon a => Exp (Plucker a) -> Exp (Plucker a) -> Exp Bool Source #
Checks if two lines are parallel.
intersects :: (Epsilon a, Ord a) => Exp (Plucker a) -> Exp (Plucker a) -> Exp Bool Source #
Checks if two lines intersect (or nearly intersect).
passes :: (Epsilon a, Ord a) => Exp (Plucker a) -> Exp (Plucker a) -> Exp LinePass Source #
Check how two lines pass each other. passes l1 l2
describes l2
when
looking down l1
.
quadranceToOrigin :: Fractional a => Exp (Plucker a) -> Exp a Source #
The minimum squared distance of a line from the origin.
closestToOrigin :: Fractional a => Exp (Plucker a) -> Exp (V3 a) Source #
The point where a line is closest to the origin.
isLine :: Epsilon a => Exp (Plucker a) -> Exp 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.
Basis elements
p10 :: Num a => Lens' (Exp (Plucker a)) (Exp 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) ap20
::Num
a =>Lens'
(Plucker
a) ap30
::Num
a =>Lens'
(Plucker
a) ap32
::Num
a =>Lens'
(Plucker
a) ap13
::Num
a =>Lens'
(Plucker
a) ap21
::Num
a =>Lens'
(Plucker
a) a
p13 :: Num a => Lens' (Exp (Plucker a)) (Exp 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) ap20
::Num
a =>Lens'
(Plucker
a) ap30
::Num
a =>Lens'
(Plucker
a) ap32
::Num
a =>Lens'
(Plucker
a) ap13
::Num
a =>Lens'
(Plucker
a) ap21
::Num
a =>Lens'
(Plucker
a) a
p20 :: Num a => Lens' (Exp (Plucker a)) (Exp 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) ap20
::Num
a =>Lens'
(Plucker
a) ap30
::Num
a =>Lens'
(Plucker
a) ap32
::Num
a =>Lens'
(Plucker
a) ap13
::Num
a =>Lens'
(Plucker
a) ap21
::Num
a =>Lens'
(Plucker
a) a
p21 :: Num a => Lens' (Exp (Plucker a)) (Exp 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) ap20
::Num
a =>Lens'
(Plucker
a) ap30
::Num
a =>Lens'
(Plucker
a) ap32
::Num
a =>Lens'
(Plucker
a) ap13
::Num
a =>Lens'
(Plucker
a) ap21
::Num
a =>Lens'
(Plucker
a) a
p30 :: Num a => Lens' (Exp (Plucker a)) (Exp 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) ap20
::Num
a =>Lens'
(Plucker
a) ap30
::Num
a =>Lens'
(Plucker
a) ap32
::Num
a =>Lens'
(Plucker
a) ap13
::Num
a =>Lens'
(Plucker
a) ap21
::Num
a =>Lens'
(Plucker
a) a
p32 :: Num a => Lens' (Exp (Plucker a)) (Exp 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) ap20
::Num
a =>Lens'
(Plucker
a) ap30
::Num
a =>Lens'
(Plucker
a) ap32
::Num
a =>Lens'
(Plucker
a) ap13
::Num
a =>Lens'
(Plucker
a) ap21
::Num
a =>Lens'
(Plucker
a) a