simple-affine-space-0.1: A simple library for affine and vector spaces.

Copyright(c) Antony Courtney and Henrik Nilsson Yale University 2003
LicenseBSD-style (see the LICENSE file in the distribution)
Maintainerivan.perez@keera.co.uk
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe
LanguageHaskell98

Data.AffineSpace

Description

Affine space type relation.

Synopsis

Documentation

class (Floating a, VectorSpace v a) => AffineSpace p v a | p -> v, v -> a where #

Affine Space type relation.

An affine space is a set (type) p, and an associated vector space v over a field a.

Minimal complete definition

origin, (.+^), (.-.)

Methods

origin :: p #

Origin of the affine space.

(.+^) :: p -> v -> p infix 6 #

Addition of affine point and vector.

(.-^) :: p -> v -> p infix 6 #

Subtraction of affine point and vector.

(.-.) :: p -> p -> v infix 6 #

Subtraction of two points in the affine space, giving a vector.

distance :: p -> p -> a #

Distance between two points in the affine space, same as the norm of the vector they form (see '(.-.)'.

Instances
RealFloat a => AffineSpace (Point3 a) (Vector3 a) a # 
Instance details

Defined in Data.Point3

Methods

origin :: Point3 a #

(.+^) :: Point3 a -> Vector3 a -> Point3 a #

(.-^) :: Point3 a -> Vector3 a -> Point3 a #

(.-.) :: Point3 a -> Point3 a -> Vector3 a #

distance :: Point3 a -> Point3 a -> a #

RealFloat a => AffineSpace (Point2 a) (Vector2 a) a # 
Instance details

Defined in Data.Point2

Methods

origin :: Point2 a #

(.+^) :: Point2 a -> Vector2 a -> Point2 a #

(.-^) :: Point2 a -> Vector2 a -> Point2 a #

(.-.) :: Point2 a -> Point2 a -> Vector2 a #

distance :: Point2 a -> Point2 a -> a #