0.1.1 • Published 10 years ago

x-vector v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

x-vector

Requirements

  • Node >= 6.0.0

Examples

var xvec = require('x-vector');
const DIMENSIONS = 3;
class Float64Vector extends Float64Array {
	constructor(...args) {super(DIMENSIONS); Object.assign(this, args);}
	get(position) {return this[position]}
	set(position, value) {this[position] = value}
	assign(vector) {Object.assign(this, vector)}
};
var Vector = new xvec.VectorSpace(Float64Vector, DIMENSIONS, xvec.NUMBER_OPERATIONS).Vector;
var a = new Vector(12, 34, 56);
var b = new Vector(13, 24, 35);
var c = new Vector(14, 15, 16);
console.log({
	'a + b + c': Vector.sum(a, b, c),
	'a · b': Vector.dot(a, b),
	'12 * a': Vector.multiply(a, 12)
});
0.1.1

10 years ago

0.1.0

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago