New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vectory-lib

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vectory-lib

Vector Math Library

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status

vectory

vectory is a JavaScript vector math library written in ES6.

Install

npm install vectory-lib

Using vectory, some examples

First you need to load vectory. Note that vectory is just the name of the lib, but the JavaScript class is called Vector and the module is called vectory-lib.

import Vector from 'vectory-lib';

Adding with v1.add(v2). Does not change v1.

let v1 = new Vector(2, 3);
let v2 = new Vector(4, 5);

let sum = v1.add(v2);
console.log(sum.x); // 6
console.log(sum.y); // 8

Adding with v1.addTo(v2). Changes v1.

let v1 = new Vector(2, 3);
let v2 = new Vector(4, 5);

v1.addTo(v2);
console.log(v1.x); // 6
console.log(v1.y); // 8

Developing

git clone https://github.com/DonKarlssonSan/vectory.git
cd vectory
npm install

Thanks

Thanks to Keith Peters for his awesome Youtube channel Coding Math. This library is more or less the code from Episode 7 - Vectors Part 2

Keywords

FAQs

Package last updated on 26 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc