@4bitlabs/vec2
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @4bitlabs/vec2

Weekly Downloads

2

Version

2.0.0

License

ISC

Unpacked Size

19.4 kB

Total Files

15

Last publish

Collaborators

  • 32bitkid