npm install https://github.com/omedusyo/arithmetic-2d.git
import { Point, Vector } from "arithmetic-2d";
The types Distance, Angle[radian], Angle[degree] are just Number.
Point : Num, Num -> Point
Vector : Num, Num -> Point
Point.show : Point -> String
Vector.show : Point -> String
Point.eq : Point, Point -> Bool
Vector.eq : Vector, Vector -> Bool
Point.add : Point, Vector -> Point
Point.sub : Point, Point -> Vector
Vector.zero : Vector
Vector.add : Vector, Vector -> Vector
Vector.scale : Number, Vector -> Vector
Vector.neg : Vector -> Vector
Vector.sub : Vector, Vector -> Vector
Point.distance : Point, Point -> Distance
// assumes non-zero vector as input
Vector.normalize : Vector -> Vector
Vector.innerProduct : Vector, Vector -> Number
Vector.norm : Vector, Vector -> Distance
Vector.angleRad : Vector, Vector -> Angle[radian]
Vector.angleDeg : Vector, Vector -> Angle[degree]