
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
3D vector math with robust unit tests.
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.
v()
✔ no args
✔ x, y, z
✔ array
✔ object
✔ string coords
✔ deserialize
✔ invalid deserialize
vec3
✔ isZero
✔ at
✔ xz
✔ xy
✔ yz
✔ xzy
✔ rounded
✔ round
✔ floored
✔ floor
✔ offset
✔ translate
✔ plus
✔ minus
✔ scaled
✔ abs
✔ distanceTo
✔ distanceSquared
✔ 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
50 passing (14ms)
More functions welcome in the form of pull requests.
See History
0.1.10
FAQs
3d vector math with good unit tests
The npm package vec3 receives a total of 6,918 weekly downloads. As such, vec3 popularity was classified as popular.
We found that vec3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.