Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 901 Bytes

README.md

File metadata and controls

35 lines (23 loc) · 901 Bytes

@4bitlabs/vec2 License NPM Version NPM Downloads

A simple collection of functions for working with two-component vectors.

Installing

$ npm install --save @4bitlabs/vec2

Documentation

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}`,
);