@pauliclark/color-selector
v0.0.1
Published
Angular 4 colour picker component
Downloads
4
Maintainers
Readme
bertie.vector
The vector object as used in the bertie 3D engine. For a reference to this class, check the autogenerated documentation
Install
npm install bertie.3d
Usage
var v1 = new bertie.vector(100,100,100);
var v2 = new bertie.vector(-100,-100,100);
console.log(v1.dotProduct(v2)); // -0.3333333333333333
v1.flip();
console.log(JSON.stringify(v1.directions)); // [-100,-100,-100]
v1.flip();
console.log(JSON.stringify(v1.directions)); // [100,100,100]
console.log(JSON.stringify(v1.unitVector())); // [-0.5773502691896257,-0.5773502691896257,-0.5773502691896257]
console.log(JSON.stringify(v1.angleBetween(v2))); // 1.0471975511965979
console.log(v1.getLength()); // 173.20508075688772
v1.add(v2);
console.log(JSON.stringify(v1.directions)); // [0,0,200]
v2.rotateX(Math.PI/2);
console.log(JSON.stringify(v2.directions)); // [-100,-100,-100]