Vectory
JavaScript vector math library
Install / Use
/learn @DonKarlssonSan/VectoryREADME
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
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
