@4bitlabs/vec2
v3.0.2
Published
A simple collection of functions for working with two-component vectors.
Readme
@4bitlabs/vec2
A simple collection of functions for working with two-component vectors.
Installing
$ npm install --save @4bitlabs/vec2Documentation
Full documentation for the library can be found here.
Basic Usage
import { type Vec2, vec2, toString, dot } from '@4bitlabs/vec2';
const v1: Vec2 = vec2(8.14, 10.1);
const v2: Vec2 = vec2(1.45, 3.92);
const result = dot(v1, v2);
console.log(
`The dot-product of ${toString(v1)} and ${toString(v2)} is ${result}`,
);