Skip to content

Latest commit

 

History

History
41 lines (22 loc) · 366 Bytes

readme.md

File metadata and controls

41 lines (22 loc) · 366 Bytes

V2

2D vector arithmetic for Node and the browser.

Usage


radToDeg(1) // 57.29578

degToRad(57.29578) // 1

vecToRad({ x: 0, y: 0 }) // 0

vecToRad(0) // { x: 0, y: 0 }

normalize({ x: 10, y: 5 }) // { x: 1, y: 0.5 }

random()

add()

subtract()

multiply()

distance()

direction()

average()

center()

lerp()

lerpCurveSegment()

lerpCurve()