nuǝW pǝuoᴉʇᴉsoԀ ʎlǝʌᴉʇɐƃǝN

    @r0neko/vector2lib

    1.0.0 • Public • Published

    vector2lib

    2D Vector Library for JavaScript.

    Installation

    vector2lib requires node.js v4+ to run.

    Install this package through npm(NodeJS Package Manager).

    $ npm install @r0neko/vector2lib

    Usage

    Instantiate the class by importing it.

    const Vector2 = require("@r0neko/vector2lib");
    
    let a = new Vector2(123, 456);
    
    console.log(a); // Vector2 { X: 123, Y: 456 }
    
    // basic addition
    a.Add(new Vector2(10, 20)); // or a.Add(10, 20);
    console.log(a); // Vector2 { X: 133, Y: 476 }

    You have some basic functions like Add, Multiply, Subtract, Angle, AngleDeg, Distance, DistanceSquared, Length, LengthSquared, Rotate and RotateDegrees.

    Install

    npm i @r0neko/vector2lib

    DownloadsWeekly Downloads

    4

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    3.95 kB

    Total Files

    3

    Last publish

    Collaborators

    • r0neko