License | BSD-style (see the file LICENSE) |
---|---|
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | provisional |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell98 |
Operations on affine spaces.
Documentation
class Additive (Diff p) => Affine p where Source
An affine space is roughly a vector space in which we have forgotten or at least pretend to have forgotten the origin.
a .+^ (b .-. a) = b@ (a .+^ u) .+^ v = a .+^ (u ^+^ v)@ (a .-. b) ^+^ v = (a .+^ v) .-. q@
(.-.) :: Num a => p a -> p a -> Diff p a infixl 6 Source
Get the difference between two points as a vector offset.
(.+^) :: Num a => p a -> Diff p a -> p a infixl 6 Source
Add a vector offset to a point.
(.-^) :: Num a => p a -> Diff p a -> p a infixl 6 Source
Subtract a vector offset from a point.
Affine [] | |
Affine Complex | |
Affine ZipList | |
Affine Maybe | |
Affine Identity | |
Affine IntMap | |
Affine Vector | |
Affine V0 | |
Affine V1 | |
Affine V2 | |
Affine V3 | |
Affine V4 | |
Affine Plucker | |
Affine Quaternion | |
Affine ((->) b) | |
Ord k => Affine (Map k) | |
(Eq k, Hashable k) => Affine (HashMap k) | |
Additive f => Affine (Point f) | |
Dim * n => Affine (V * n) |
qdA :: (Affine p, Foldable (Diff p), Num a) => p a -> p a -> a Source
Compute the quadrance of the difference (the square of the distance)
distanceA :: (Floating a, Foldable (Diff p), Affine p) => p a -> p a -> a Source
Distance between two points in an affine space
A handy wrapper to help distinguish points from vectors at the type level
P (f a) |
Monad f => Monad (Point f) | |
Functor f => Functor (Point f) | |
Applicative f => Applicative (Point f) | |
Foldable f => Foldable (Point f) | |
Traversable f => Traversable (Point f) | |
Generic1 (Point f) | |
Distributive f => Distributive (Point f) | |
Representable f => Representable (Point f) | |
Apply f => Apply (Point f) | |
Bind f => Bind (Point f) | |
Additive f => Additive (Point f) | |
Metric f => Metric (Point f) | |
R1 f => R1 (Point f) | |
R2 f => R2 (Point f) | |
R3 f => R3 (Point f) | |
R4 f => R4 (Point f) | |
Additive f => Affine (Point f) | |
Eq (f a) => Eq (Point f a) | |
Fractional (f a) => Fractional (Point f a) | |
Num (f a) => Num (Point f a) | |
Ord (f a) => Ord (Point f a) | |
Read (f a) => Read (Point f a) | |
Show (f a) => Show (Point f a) | |
Ix (f a) => Ix (Point f a) | |
Generic (Point f a) | |
Storable (f a) => Storable (Point f a) | |
Epsilon (f a) => Epsilon (Point f a) | |
type Rep1 (Point f) | |
type Rep (Point f) = Rep f | |
type Diff (Point f) = f | |
type Rep (Point f a) |