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

Safe Haskell | None
Language | Haskell2010

Graphics.Gloss.Data.Point.Arithmetic

Description

## 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.

Synopsis

- type Point = (Float, Float)
- (+) :: Point -> Point -> Point
- (-) :: Point -> Point -> Point
- (*) :: Float -> Point -> Point
- negate :: Point -> Point

# Documentation

type Point = (Float, Float) #

A point on the x-y plane.

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

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

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

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

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

Multiply a scalar by a vector.

negate :: Point -> Point #

Negate a vector.