tnt-vec2

0.0.4 • Public • Published

tnt-vec2

A simple ES6 vector2 class

This Vector2 class is probably not the fastest around, but is very easy in use. For example for quick prototyping of games. For a high performance alternative that can do many calculations in for example a render loop, I'd like to redirect you to the awesome gl-matrix by toji.

tnt-vec2 methods

  • length()
  • lerp( vec2, factor )
  • dot( vec2 )
  • normalize()
  • cross( vec2 )
  • rotate( deg )
  • add( vec2|number )
  • sub( vec2|number )
  • mul( vec2|number )
  • div( vec2|number )
  • abs()
  • equals( vec2 )

Package Sidebar

Install

npm i tnt-vec2

Weekly Downloads

0

Version

0.0.4

License

ISC

Last publish

Collaborators

  • rein