Maintainer | diagrams-discuss@googlegroups.com |
---|---|

Safe Haskell | None |

A type for *points* (as distinct from vectors).

- newtype Point v = P v
- origin :: AdditiveGroup v => Point v
- (*.) :: VectorSpace v => Scalar v -> Point v -> Point v

# Points

newtype Point v

`Point`

is a newtype wrapper around vectors used to represent
points, so we don't get them mixed up. The distinction between
vectors and points is important: translations affect points, but
leave vectors unchanged. Points are instances of the
`AffineSpace`

class from Data.AffineSpace.

P v |

Functor Point | |

Typeable1 Point | |

Eq v => Eq (Point v) | |

(Typeable (Point v), Data v) => Data (Point v) | |

(Eq (Point v), Ord v) => Ord (Point v) | |

Read v => Read (Point v) | |

Show v => Show (Point v) | |

(AdditiveGroup (Diff (Point v)), AdditiveGroup v) => AffineSpace (Point v) | |

(VectorSpace (V (Point v)), VectorSpace v) => HasOrigin (Point v) | |

(HasLinearMap (V (Point v)), HasLinearMap v) => Transformable (Point v) | |

(Ord (Scalar (V (Point v))), VectorSpace (V (Point v)), Ord (Scalar v), VectorSpace v) => Traced (Point v) | The trace of a single point is the empty trace, |

(InnerSpace (V (Point v)), OrderedField (Scalar (V (Point v))), OrderedField (Scalar v), InnerSpace v) => Enveloped (Point v) | |

Newtype (Point v) v |

origin :: AdditiveGroup v => Point v

The origin of the vector space `v`

.

(*.) :: VectorSpace v => Scalar v -> Point v -> Point v

Scale a point by a scalar.