gloss- Painless 2D vector graphics, animations and simulations.

Safe HaskellNone



Point and vector arithmetic

Vectors aren't numbers according to Haskell, because they don't support all numeric operations sensibly. We define component-wise addition, subtraction, and negation along with scalar multiplication in this module, which is intended to be imported qualified.



type Point = (Float, Float) #

A point on the x-y plane.

(+) :: Point -> Point -> Point infixl 6 Source #

Add two vectors, or add a vector to a point.

(-) :: Point -> Point -> Point infixl 6 Source #

Subtract two vectors, or subtract a vector from a point.

(*) :: Float -> Point -> Point infixl 7 Source #

Multiply a scalar by a vector.

negate :: Point -> Point Source #

Negate a vector.