GithubHelp home page GithubHelp logo

node-vec3's Introduction

vec3

NPM version Build Status

3D vector math with robust unit tests.

Usage

var v = require('vec3');

var v1 = v(1, 2, 3);
console.log(v1); // prints "(1, 2, 3)"
var v2 = v1.offset(0, 0, 1);
console.log(v2); // prints "(1, 2, 4)"

Or:

var Vec3 = require('vec3').Vec3;

var v1 = new Vec3(1, 2, 3);
// etc...

More available functions are listed below in Test Coverage.

Test Coverage

v()
    ✓ no args
    ✓ x, y, z
    ✓ array
    ✓ object
    ✓ string coords
    ✓ deserialize
    ✓ invalid deserialize

  vec3
    ✓ rounded
    ✓ round
    ✓ floored
    ✓ floor
    ✓ offset
    ✓ translate
    ✓ plus
    ✓ minus
    ✓ scaled
    ✓ abs
    ✓ distanceTo
    ✓ equals
    ✓ toString
    ✓ clone
    ✓ add
    ✓ subtract
    ✓ multiply
    ✓ divide
    ✓ set
    ✓ modulus
    ✓ volume
    ✓ min
    ✓ max
    ✓ update
    ✓ norm
    ✓ dot
    ✓ cross
    ✓ unit
    ✓ normalize
    ✓ scale
    ✓ xyDistanceTo
    ✓ xzDistanceTo
    ✓ yzDistanceTo
    ✓ innerProduct
    ✓ manhattanDistanceTo
    ✓ toArray


  39 passing

More functions welcome in the form of pull requests.

History

See History

node-vec3's People

Contributors

andrewrk avatar anonchan avatar bendingbender avatar dependabot-preview[bot] avatar dependabot[bot] avatar firejoust avatar icetank avatar iczero avatar idanho avatar kamesa7 avatar karang avatar lleyton avatar rom1504 avatar thedudefromci avatar wraithgar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.