Portability | portable |
---|---|
Stability | provisional |
Maintainer | Edward Kmett <[email protected]> |
Safe Haskell | Trustworthy |
Linear.Affine
Description
Operations on affine spaces.
Documentation
class Additive (Diff p) => Affine p whereSource
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@
Methods
(.-.) :: Num a => p a -> p a -> Diff p aSource
Get the difference between two points as a vector offset.
(.+^) :: Num a => p a -> Diff p a -> p aSource
Add a vector offset to a point.
(.-^) :: Num a => p a -> Diff p a -> p aSource
Subtract a vector offset from a point.
Instances
Affine [] | |
Affine Complex | |
Affine ZipList | |
Affine Maybe | |
Affine IntMap | |
Affine Identity | |
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 -> aSource
Compute the quadrance of the difference (the square of the distance)
distanceA :: (Floating a, Foldable (Diff p), Affine p) => p a -> p a -> aSource
Distance between two points in an affine space
A handy wrapper to help distinguish points from vectors at the type level
Constructors
P (f a) |
Instances
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) | |
Apply f => Apply (Point f) | |
Bind f => Bind (Point f) | |
Additive f => Additive (Point f) | |
Metric f => Metric (Point f) | |
Core f => Core (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) | |
Storable (f a) => Storable (Point f a) | |
Epsilon (f a) => Epsilon (Point f a) |