Stability | experimental |
---|---|

Maintainer | conal@conal.net, andygill@ku.edu |

Safe Haskell | None |

Affine spaces.

- class AdditiveGroup (Diff p) => AffineSpace p where
- (.-^) :: AffineSpace p => p -> Diff p -> p
- distanceSq :: (AffineSpace p, v ~ Diff p, InnerSpace v) => p -> p -> Scalar v
- distance :: (AffineSpace p, v ~ Diff p, InnerSpace v, s ~ Scalar v, Floating (Scalar v)) => p -> p -> s
- alerp :: (AffineSpace p, VectorSpace (Diff p)) => p -> p -> Scalar (Diff p) -> p

# Documentation

class AdditiveGroup (Diff p) => AffineSpace p whereSource

AffineSpace Double | |

AffineSpace Float | |

(AdditiveGroup (Diff (Ratio a)), Integral a) => AffineSpace (Ratio a) | |

(AdditiveGroup (Diff (a -> p)), AffineSpace p) => AffineSpace (a -> p) | |

(AdditiveGroup (Diff (p, q)), AffineSpace p, AffineSpace q) => AffineSpace (p, q) | |

(AdditiveGroup (Diff (p, q, r)), AffineSpace p, AffineSpace q, AffineSpace r) => AffineSpace (p, q, r) |

(.-^) :: AffineSpace p => p -> Diff p -> pSource

Point minus vector

distanceSq :: (AffineSpace p, v ~ Diff p, InnerSpace v) => p -> p -> Scalar vSource

Square of the distance between two points. Sometimes useful for
efficiency. See also `distance`

.

distance :: (AffineSpace p, v ~ Diff p, InnerSpace v, s ~ Scalar v, Floating (Scalar v)) => p -> p -> sSource

Distance between two points. See also `distanceSq`

.

alerp :: (AffineSpace p, VectorSpace (Diff p)) => p -> p -> Scalar (Diff p) -> pSource

Affine linear interpolation. Varies from `p`

to `p'`

as `s`

varies
from 0 to 1. See also `lerp`

(on vector spaces).