brillo-1.13.3: Painless 2D vector graphics, animations, and simulations powered by GLFW
Safe HaskellSafe-Inferred
LanguageGHC2021

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

Documentation

type Point = (Float, Float) #

(+) :: 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.