Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

math.gl

Package Overview
Dependencies
Maintainers
5
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

math.gl - npm Package Compare versions

Comparing version 1.0.0-alpha.8 to 1.0.0

dist-es6/vector.js

64

dist-es6/math-array.js

@@ -54,3 +54,3 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

import { config, formatValue, equals as _equals, checkNumber } from './common';
import { config, formatValue, equals as _equals } from './common';

@@ -80,4 +80,3 @@ var MathArray = function (_extendableBuiltin2) {

}
this.check();
return this;
return this.check();
}

@@ -94,4 +93,3 @@ }, {

}
this.check();
return this;
return this.check();
}

@@ -106,4 +104,3 @@ }, {

}
this.check();
return this;
return this.check();
}

@@ -166,44 +163,29 @@ }, {

}
// Modifiers
}, {
key: 'length',
value: function length() {
return Math.sqrt(this.lengthSquared());
}
}, {
key: 'lengthSquared',
value: function lengthSquared() {
var length = 0;
if (length !== 0) {
for (var i = 0; i < this.ELEMENTS; ++i) {
length += this[i] * this[i];
}
key: 'negate',
value: function negate() {
for (var i = 0; i < this.ELEMENTS; ++i) {
this[i] = -this[i];
}
return checkNumber(this);
return this.check();
}
}, {
key: 'distance',
value: function distance(mathArray) {
return Math.sqrt(this.distanceSquared(mathArray));
}
}, {
key: 'distanceSquared',
value: function distanceSquared(mathArray) {
var length = 0;
key: 'inverse',
value: function inverse() {
for (var i = 0; i < this.ELEMENTS; ++i) {
var dist = this[i] - mathArray[i];
length += dist * dist;
this[i] = 1 / this[i];
}
return checkNumber(length);
return this.check();
}
}, {
key: 'normalize',
value: function normalize() {
var length = this.length();
if (length !== 0) {
for (var i = 0; i < this.ELEMENTS; ++i) {
this[i] /= length;
}
key: 'lerp',
value: function lerp(vector, coeff) {
for (var i = 0; i < this.ELEMENTS; ++i) {
var coord = this[i];
this[i] = coord + coeff * (vector[0] - coord);
}
this.check();
return this;
return this.check();
}

@@ -240,2 +222,2 @@

export default MathArray;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tYXRoLWFycmF5LmpzIl0sIm5hbWVzIjpbImNvbmZpZyIsImZvcm1hdFZhbHVlIiwiZXF1YWxzIiwiY2hlY2tOdW1iZXIiLCJNYXRoQXJyYXkiLCJTdWJjbGFzcyIsImNvbnN0cnVjdG9yIiwiY2xvbmUiLCJjb3B5IiwiY2hlY2siLCJhcnJheSIsImkiLCJFTEVNRU5UUyIsImFyZ3MiLCJvZmZzZXQiLCJmb3JtYXRTdHJpbmciLCJvcHRzIiwic3RyaW5nIiwicHJpbnRUeXBlcyIsIm5hbWUiLCJGbG9hdDMyQXJyYXkiLCJsZW5ndGgiLCJNYXRoIiwic3FydCIsImxlbmd0aFNxdWFyZWQiLCJtYXRoQXJyYXkiLCJkaXN0YW5jZVNxdWFyZWQiLCJkaXN0IiwidmFsaWQiLCJOdW1iZXIiLCJpc0Zpbml0ZSIsImRlYnVnIiwidmFsaWRhdGUiLCJFcnJvciIsIkFycmF5Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxTQUFRQSxNQUFSLEVBQWdCQyxXQUFoQixFQUE2QkMsaUJBQTdCLEV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iZXIuaXNGaW5pdGUoYXJyYXlbaV0pO1xuICAgIH1cbiAgICByZXR1cm4gdmFsaWQ7XG4gIH1cblxuICBjaGVjayhhcnJheSA9IHRoaXMpIHtcbiAgICBpZiAoY29uZmlnLmRlYnVnICYmICF0aGlzLnZhbGlkYXRlKGFycmF5KSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkICR7dGhpcy5jb25zdHJ1Y3Rvci5uYW1lfWApO1xuICAgIH1cbiAgICByZXR1cm4gdGhpcztcbiAgfVxufVxuIl19

@@ -56,2 +56,4 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var IDENTITY_QUATERNION = [0, 0, 0, 1];
export function validateQuaternion(q) {

@@ -328,4 +330,9 @@ return q.length === 4 && Number.isFinite(q[0]) && Number.isFinite(q[1]) && Number.isFinite(q[2]) && Number.isFinite(q[3]);

key: 'slerp',
value: function slerp(a, b, t) {
quat_slerp(this, a, b, t);
value: function slerp(_ref) {
var _ref$start = _ref.start,
start = _ref$start === undefined ? IDENTITY_QUATERNION : _ref$start,
target = _ref.target,
ratio = _ref.ratio;
quat_slerp(this, start, target, ratio);
this.check();

@@ -377,2 +384,2 @@ return this;

export default Quaternion;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9xdWF0ZXJuaW9uLmpzIl0sIm5hbWVzIjpbIk1hdGhBcnJheSIsImNoZWNrTnVtYmVyIiwicXVhdF9mcm9tTWF0MyIsInF1YXRfaWRlbnRpdHkiLCJxdWF0X2xlbmd0aCIsInF1YXRfc3F1YXJlZExlb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TtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxuXG4gIC8vIFNjYWxlcyBhIHF1YXQgYnkgYSBzY2FsYXIgbnVtYmVyXG4gIHNjYWxlKGIpIHtcbiAgICBxdWF0X3NjYWxlKHRoaXMsIHRoaXMsIGIpO1xuICAgIHRoaXMuY2hlY2soKTtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxuXG4gIC8vIFNldCB0aGUgY29tcG9uZW50cyBvZiBhIHF1YXQgdG8gdGhlIGdpdmVuIHZhbHVlc1xuICBzZXQoaSwgaiwgaywgbCkge1xuICAgIHF1YXRfc2V0KHRoaXMsIGksIGosIGssIGwpO1xuICAgIHRoaXMuY2hlY2soKTtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxuXG4gIC8vIFNldHMgYSBxdWF0IGZyb20gdGhlIGdpdmVuIGFuZ2xlIGFuZCByb3RhdGlvbiBheGlzLCB0aGVuIHJldHVybnMgaXQuXG4gIHNldEF4aXNBbmdsZShheGlzLCByYWQpIHtcbiAgICBxdWF0X3NldEF4aXNBbmdsZSh0aGlzLCBheGlzLCByYWQpO1xuICAgIHRoaXMuY2hlY2soKTtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxuXG4gIC8vIFBlcmZvcm1zIGEgc3BoZXJpY2FsIGxpbmVhciBpbnRlcnBvbGF0aW9uIGJldHdlZW4gdHdvIHF1YXRcbiAgc2xlcnAoe3N0YXJ0ID0gSURFTlRJVFlfUVVBVEVSTklPTiwgdGFyZ2V0LCByYXRpb30pIHtcbiAgICBxdWF0X3NsZXJwKHRoaXMsIHN0YXJ0LCB0YXJnZXQsIHJhdGlvKTtcbiAgICB0aGlzLmNoZWNrKCk7XG4gICAgcmV0dXJuIHRoaXM7XG4gIH1cbn1cbiJdfQ==

@@ -35,4 +35,2 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

import vec3_set from 'gl-vec3/set';
import vec3_length from 'gl-vec3/length';
import vec3_distance from 'gl-vec3/distance';
import vec3_angle from 'gl-vec3/angle';

@@ -45,8 +43,3 @@ import vec3_add from 'gl-vec3/add';

import vec3_scaleAndAdd from 'gl-vec3/scaleAndAdd';
import vec3_negate from 'gl-vec3/negate';
import vec3_inverse from 'gl-vec3/inverse';
import vec3_normalize from 'gl-vec3/normalize';
import vec3_dot from 'gl-vec3/dot';
import vec3_cross from 'gl-vec3/cross';
import vec3_lerp from 'gl-vec3/lerp';
import vec3_rotateX from 'gl-vec3/rotateX';

@@ -83,9 +76,2 @@ import vec3_rotateY from 'gl-vec3/rotateY';

// fromArray(array) {
// if (array instanceof Vector3) {
// return array;
// }
// return new Vector3(...array);
// }
_createClass(Vector3, [{

@@ -102,24 +88,9 @@ key: 'set',

}, {
key: 'length',
key: 'angle',
/* eslint-enable no-multi-spaces, brace-style, no-return-assign */
value: function length() {
return vec3_length(this);
}
}, {
key: 'distance',
value: function distance(vector) {
return vec3_distance(this, vector);
}
}, {
key: 'angle',
value: function angle(vector) {
return vec3_angle(this, vector);
}
}, {
key: 'dot',
value: function dot(vector) {
return vec3_dot(this, vector);
}

@@ -241,20 +212,2 @@ // MODIFIERS

}, {
key: 'negate',
value: function negate() {
vec3_negate(this, this);
return this.check();
}
}, {
key: 'inverse',
value: function inverse() {
vec3_inverse(this, this);
return this.check();
}
}, {
key: 'normalize',
value: function normalize() {
vec3_normalize(this, this);
return this.check();
}
}, {
key: 'cross',

@@ -266,8 +219,2 @@ value: function cross(vector) {

}, {
key: 'lerp',
value: function lerp(vector, coeff) {
vec3_lerp(this, this, vector, coeff);
return this.check();
}
}, {
key: 'rotateX',

@@ -390,2 +337,2 @@ value: function rotateX(_ref) {

export default Vector3;
//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AuLi5hcmdzKTtcbiAgICByZXR1cm4gdGhpcy5jaGVjaygpO1xuICB9XG5cbiAgLy8gVEJEIC0gZG8gd2UgcmVhbGx5IG5lZWQgdGhlc2U/XG4gIGRpdmlkZSguLi52ZWN0b3JzKSB7XG4gICAgZm9yIChjb25zdCB2ZWN0b3Igb2YgdmVjdG9ycykge1xuICAgICAgdmVjM19kaXZpZGUodGhpcywgdGhpcywgdmVjdG9yKTtcbiAgICB9XG4gICAgcmV0dXJuIHRoaXMuY2hlY2soKTtcbiAgfVxuXG4gIHNjYWxlQW5kQWRkKHZlY3Rvciwgc2NhbGUpIHtcbiAgICB2ZWMzX3NjYWxlQW5kQWRkKHRoaXMsIHRoaXMsIHZlY3Rvciwgc2NhbGUpO1xuICAgIHJldHVybiB0aGlzLmNoZWNrKCk7XG4gIH1cbn1cbiJdfQ==

@@ -83,4 +83,3 @@ 'use strict';

}
this.check();
return this;
return this.check();
}

@@ -97,4 +96,3 @@ }, {

}
this.check();
return this;
return this.check();
}

@@ -109,4 +107,3 @@ }, {

}
this.check();
return this;
return this.check();
}

@@ -169,44 +166,29 @@ }, {

}
// Modifiers
}, {
key: 'length',
value: function length() {
return Math.sqrt(this.lengthSquared());
}
}, {
key: 'lengthSquared',
value: function lengthSquared() {
var length = 0;
if (length !== 0) {
for (var i = 0; i < this.ELEMENTS; ++i) {
length += this[i] * this[i];
}
key: 'negate',
value: function negate() {
for (var i = 0; i < this.ELEMENTS; ++i) {
this[i] = -this[i];
}
return (0, _common.checkNumber)(this);
return this.check();
}
}, {
key: 'distance',
value: function distance(mathArray) {
return Math.sqrt(this.distanceSquared(mathArray));
}
}, {
key: 'distanceSquared',
value: function distanceSquared(mathArray) {
var length = 0;
key: 'inverse',
value: function inverse() {
for (var i = 0; i < this.ELEMENTS; ++i) {
var dist = this[i] - mathArray[i];
length += dist * dist;
this[i] = 1 / this[i];
}
return (0, _common.checkNumber)(length);
return this.check();
}
}, {
key: 'normalize',
value: function normalize() {
var length = this.length();
if (length !== 0) {
for (var i = 0; i < this.ELEMENTS; ++i) {
this[i] /= length;
}
key: 'lerp',
value: function lerp(vector, coeff) {
for (var i = 0; i < this.ELEMENTS; ++i) {
var coord = this[i];
this[i] = coord + coeff * (vector[0] - coord);
}
this.check();
return this;
return this.check();
}

@@ -243,2 +225,2 @@

exports.default = MathArray;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tYXRoLWFycmF5LmpzIl0sIm5hbWVzIjpbIk1hdGhBcnJheSIsIlN1YmNsYXNzIiwiY29uc3RydWN0b3IiLCJjbG9uZSIsImNvcHkiLCJjaGVjayIsImFycmF5IiwiaSIsIkVMRU1FTlRTIiwiYXJncyIsIm9mZnNldCIsImZvcm1hdFN0cmluZyIsIm9wdHMiLCJzdHJpbmciLCJwcmludFR5cGVzIiwibmFtZSIsIkZsb2F0MzJBcnJheSIsImxlbmd0aCIsIk1hdGgiLCJzcXJ0IiwibGVuZ3RoU3F1YXJlZCIsIm1hdGhBcnJheSIsImRpc3RhbmNlU3F1YXJlZCIsImRpc3QiLCJ2YWxpZCIsIk51bWJlciIsImlzRmluaXRlIiwiZGVidWciLCJ2YWxpZGF0ZSIsIkVycm9yIiwiQXJyYXkiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBb0JBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0VBcEJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztJQUlxQkEsUzs7Ozs7Ozs7Ozs7NEJBRVg7QUFDTixVQUFNQyxXQUFXLEtBQUtDLFdBQXRCO0FBQ0EsVUFBTUMsUUFBUSxJQUFJRixRQUFKLEdBQWVHLElBQWYsQ0FBb0IsSUFBcEIsQ0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7XG4gICAgfVxuICAgIHJldHVybiB0aGlzO1xuICB9XG59XG4iXX0=

@@ -129,2 +129,4 @@ 'use strict';

var IDENTITY_QUATERNION = [0, 0, 0, 1];
function validateQuaternion(q) {

@@ -401,4 +403,9 @@ return q.length === 4 && Number.isFinite(q[0]) && Number.isFinite(q[1]) && Number.isFinite(q[2]) && Number.isFinite(q[3]);

key: 'slerp',
value: function slerp(a, b, t) {
(0, _slerp2.default)(this, a, b, t);
value: function slerp(_ref) {
var _ref$start = _ref.start,
start = _ref$start === undefined ? IDENTITY_QUATERNION : _ref$start,
target = _ref.target,
ratio = _ref.ratio;
(0, _slerp2.default)(this, start, target, ratio);
this.check();

@@ -450,2 +457,2 @@ return this;

exports.default = Quaternion;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9xdWF0ZXJuaW9uLmpzIl0sIm5hbWVzIjpbInZhbGlkYXRlUXVhdGVybmlvbiIsInEiLCJsZW5ndGgiLCJOdW1iZXIiLCJpc0Zpbml0ZSIsIlF1YXRlcm5pb24iLCJ4IiwieSIsInoiLCJ3IiwiQXJyYXkiLCJpc0FycmF5IiwiYXJndW1lbnRzIiwiY29weSIsInNldCIsIm0iLCJjaGVjayIsImEiLCJiIiwidW5kZWZpbmVkIiwiRXJyb3IiLCJ2ZWN0b3JBIiwidmVjdG9yQiIsInQiLCJyYWQiLCJpIiwiaiIsImsiLCJsIiwiYXhpcyIsInZhbHVlIl0sIm1hcHBpbmdzIjoiOzs7Ozs7OztRQStDZ0JBLGtCLEdBQUFBLGtCOztBQTNCaEI7Ozs7QUFDQTs7QUFJQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBRUE7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs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QW5nbGUodGhpcywgYXhpcywgcmFkKTtcbiAgICB0aGlzLmNoZWNrKCk7XG4gICAgcmV0dXJuIHRoaXM7XG4gIH1cblxuICAvLyBQZXJmb3JtcyBhIHNwaGVyaWNhbCBsaW5lYXIgaW50ZXJwb2xhdGlvbiBiZXR3ZWVuIHR3byBxdWF0XG4gIHNsZXJwKHtzdGFydCA9IElERU5USVRZX1FVQVRFUk5JT04sIHRhcmdldCwgcmF0aW99KSB7XG4gICAgcXVhdF9zbGVycCh0aGlzLCBzdGFydCwgdGFyZ2V0LCByYXRpbyk7XG4gICAgdGhpcy5jaGVjaygpO1xuICAgIHJldHVybiB0aGlzO1xuICB9XG59XG4iXX0=

@@ -21,10 +21,2 @@ 'use strict';

var _length = require('gl-vec3/length');
var _length2 = _interopRequireDefault(_length);
var _distance = require('gl-vec3/distance');
var _distance2 = _interopRequireDefault(_distance);
var _angle = require('gl-vec3/angle');

@@ -58,18 +50,2 @@

var _negate = require('gl-vec3/negate');
var _negate2 = _interopRequireDefault(_negate);
var _inverse = require('gl-vec3/inverse');
var _inverse2 = _interopRequireDefault(_inverse);
var _normalize = require('gl-vec3/normalize');
var _normalize2 = _interopRequireDefault(_normalize);
var _dot = require('gl-vec3/dot');
var _dot2 = _interopRequireDefault(_dot);
var _cross = require('gl-vec3/cross');

@@ -79,6 +55,2 @@

var _lerp = require('gl-vec3/lerp');
var _lerp2 = _interopRequireDefault(_lerp);
var _rotateX = require('gl-vec3/rotateX');

@@ -153,9 +125,2 @@

// fromArray(array) {
// if (array instanceof Vector3) {
// return array;
// }
// return new Vector3(...array);
// }
_createClass(Vector3, [{

@@ -172,24 +137,9 @@ key: 'set',

}, {
key: 'length',
key: 'angle',
/* eslint-enable no-multi-spaces, brace-style, no-return-assign */
value: function length() {
return (0, _length2.default)(this);
}
}, {
key: 'distance',
value: function distance(vector) {
return (0, _distance2.default)(this, vector);
}
}, {
key: 'angle',
value: function angle(vector) {
return (0, _angle2.default)(this, vector);
}
}, {
key: 'dot',
value: function dot(vector) {
return (0, _dot2.default)(this, vector);
}

@@ -311,20 +261,2 @@ // MODIFIERS

}, {
key: 'negate',
value: function negate() {
(0, _negate2.default)(this, this);
return this.check();
}
}, {
key: 'inverse',
value: function inverse() {
(0, _inverse2.default)(this, this);
return this.check();
}
}, {
key: 'normalize',
value: function normalize() {
(0, _normalize2.default)(this, this);
return this.check();
}
}, {
key: 'cross',

@@ -336,8 +268,2 @@ value: function cross(vector) {

}, {
key: 'lerp',
value: function lerp(vector, coeff) {
(0, _lerp2.default)(this, this, vector, coeff);
return this.check();
}
}, {
key: 'rotateX',

@@ -460,2 +386,2 @@ value: function rotateX(_ref) {

exports.default = Vector3;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy92ZWN0b3IzLmpzIl0sIm5hbWVzIjpbInZhbGlkYXRlVmVjdG9yMyIsIk9SSUdJTiIsInYiLCJsZW5ndGgiLCJOdW1iZXIiLCJpc0Zpbml0ZSIsIlZlY3RvcjMiLCJ4IiwieSIsInoiLCJBcnJheSIsImlzQXJyYXkiLCJhcmd1bWVudHMiLCJjb3B5Iiwic2V0IiwiY2hlY2siLCJ2ZWN0b3IiLCJ2ZWN0b3JzIiwic2NhbGUiLCJjb2VmZiIsInJhZGlhbnMiLCJvcmlnaW4iLCJvcGVyYXRpb24iLCJhcmdzIiwidmFsdWUiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O1FBK0NnQkEsZSxHQUFBQSxlOztBQTNCaEI7Ozs7QUFDQTs7QUFJQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7Ozs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N0b3IpO1xuICAgIH1cbiAgICByZXR1cm4gdGhpcy5jaGVjaygpO1xuICB9XG5cbiAgc2NhbGVBbmRBZGQodmVjdG9yLCBzY2FsZSkge1xuICAgIHZlYzNfc2NhbGVBbmRBZGQodGhpcywgdGhpcywgdmVjdG9yLCBzY2FsZSk7XG4gICAgcmV0dXJuIHRoaXMuY2hlY2soKTtcbiAgfVxufVxuIl19
{
"name": "math.gl",
"description": "Class wrappers for gl-matrix",
"description": "Array-based 3D Math Classes optimized for WebGL applications",
"license": "MIT",
"version": "1.0.0-alpha.8",
"version": "1.0.0",
"keywords": [

@@ -7,0 +7,0 @@ "webgl",

@@ -18,75 +18,45 @@ <p align="right">

<h1 align="center">math.gl | <a href="https://uber-web.github.io/math.gl">Docs</a></h1>
Array-based ES6 math classes built on the amazing [gl-matrix](http://glmatrix.net/) and THREE.js math libraries.
# math.gl
math.gl is an `Array`-based JavaScript 3D math library. In spite of its name it has no hard WebGL dependencies, but however both API and design are focused on focused on the needs of typical WebGL applications
## Overview
math.gl is a JavaScript math library primarily intended to support WebGL applications. It is a generic library but was developed as a companion for [luma.gl](http://uber.github.io/luma.gl/) and [deck.gl](http://uber.github.io/deck.gl/).
math.gl contains a set of classes (Matrix4 etc) to complement the procedural interface of gl-matrix. It also imports a limited subset of the standard `gl-matrix` functions (to keep bundle size down), these can be used in parallel with the classes.
## Who is this for?
JavaScript WebGL programmers who:
* Need a great JavaScript math library for basic computional geometry purposes.
* like the functionality offered by the gl-matrix library
* need tree-shaking support
* want to use object orientated math programming style (ability to chain operations).
* want optional extra error checking
* do not need to support old (pre-IE10) browsers.
## Features
- **Array-based**
- All math objects can be used directly with any Javascript function that expects array arguments. No need to call `toArray` or similar.
This is a short list of feature high-lights to show what math.gl is about.
- **Error checking** to assist in debugging.
- Can be disabled when performance is critical.
- **Array-based Classes** - All math.gl classes (like `Vector3`, `Matrix4`) are subclasses of the built-in JavaScript `Array` class. This means that they can be used directly with any Javascript function that e.g. expects plain JavaScript `Array` arguments for Vectors, which is increasingly common.
- **WebGL-friendly**
- Matrices: while all accessors, `toString()` etc are row-major. Matrices are organized internally in the layout expected by WebGL (an array of contiguous floats in column-major order),
- `toArray` and `fromArray` functions take optional offsets allowing copying directly to and from vertex attribute arrays.
- GLSL math functions (radians, sin etc) made available in JavaScript and work both on scalars and vectors / math objects.
- **Debug Friendly** - JavaScript math can be frustrating to code and debug. math.gl offers **optional** error checking after every math operation which makes quick work of locating coding errors and bad data. Also, strong "printing support" (`toString`) simplifies debugging.
- **WebGL Support** - Matrices are stored internally in the format required by WebGL (array of contiguous values in column-major order), while exposing the more "natural" row-major API to the JavaScript programmer (e.g. through accessors, printing using `toString()` etc).
# Design Notes
- **Documentation** - Some JavaScript 3D math libraries come with reference documentation only. If you are new to 3D programming it can be hard to know where to start. math.gl comes with articles that try to show you the big picture and get you quickly up-to-speed on the mathematical concepts and the math.gl classes that support them.
- Math objects are `Arrays` - All math objects are subclasses of the built-in JavaScript `Array` class, which means that class instances can be used wherever an array is expected. I.e. these classes are not wrappers of `Array`s, they **are** `Array`s, just with additional methods.
- **Size Conscious** - A math library can quickly get big as a various classed and functions keep getting added. But for many 3D applications, only a few basic operations are necessary. math.gl has made a choices to restrict itself to a set of classes and functions that are likely to be most important in WebGL applications. The intention is to position math.gl as a "mid-size" 3D math library: reasonably full featured, but small enough that unless you are targeting a very small final bundle for your application, its size should not be a big concern.
- Focuses on needs of WebGL based applications and basic computational geometry, which includes 4x4 matrices, 2, 3 and 4 dimensional vectors and quaternions. May grow to include other classes, but is not intended to become a general math library.
## Supported Browsers and Node Versions
# History
math.gl is only supported on "evergreen" browsers, such as Chrome, Safari, Firefox, Edge etc. While not evergreen, IE11 should support the math.gl distribution's transpiled code, but Internet Explorer < 10 will not work. math.gl also works on recent versions of Node.js (tested on v6+).
- Started out as a set of object oriented wrappers for the procedural [gl-matrix](http://glmatrix.net/) library.
> Disclaimer: These restrictions are both due to real technical limitations with math.gl's `Array`subclassing approach, as well as a conscious decision by the maintainers to limit the support matrix for the library. So, if your application needs to support non-evergreen browsers, math.gl is unlikely to be the right choice for you. A good alternative option could be to use e.g. `gl-matrix` directly.
# Roadmap
## History
- Additional classes and functions. This library might grow beyond just providing `gl-matrix` wrappers if additional classes are deemed valuable for the target user group.
math.gl was developed as a companion 3D math library for the luma.gl and deck.gl WebGL frameworks, and the precursors of the math.gl classes were in fact part of luma.gl v4.0, but have now been broken out in this separate library.
In spite of its roots, the intention is that math.gl should be able to serve a general purpose 3D math library, and be used either directly or as a "starting point" by other projects with similar needs.
## Documentation
The [gl-matrix docs](http://glmatrix.net/docs/) are a good start.
## Attribution
math.gl heavily inspired by, and includes code, documentation and ideas from some of the most proven open source JavaScript math libraries, the awesome [`gl-matrix`](http://glmatrix.net/) and the THREE.js math library. Those libraries encouraged reuse which enabled math.gl to be built, and naturally math.gl does the same!
## API differences with gl-matrix
The class API is intentionally designed to remain intuitively similar to the wrapped `gl-matrix` procedures, usually just removing the first one or two parameters from each function (the out argument and the first input arguments, both are implictly set to this), and exposes the remaining arguments in the same order as the gl-matrix api.
## License
Only in a few cases where `gl-matrix` methods take a long list arguments (e.g. `mat4.perspective`, `mat4.ortho` etc) or return multiple values (e.g. `quat.getAxisRotation`) do methods provide a modified API that is more natural for modern ES6 applications to use, e.g. using named parameters, or collecting all results in one returned object.
Also, for transforming vectors with matrices, the `transformVector*` methods are offered in the matrix classes, instead of on the vector classes. They also (optionally) auto allocate the result vectors.
## Caveats
A technical caveat is that JavaScript `Array` subclassing, which is fundamental to the design of this library, is only supported on "evergreen" browsers, such as Chrome, Safari, Firefox, Edge etc, i.e. no Internet Explorer < 10 ([details](https://github.com/loganfsmyth/babel-plugin-transform-builtin-extend)).
If this is not acceptable, math.gl is not the right choice for you. As a fallback, you can always use `gl-matrix` directly.
MIT license. The libraries that math.gl are built on are also all open source and MIT licensed.

@@ -21,3 +21,3 @@ // Copyright (c) 2017 Uber Technologies, Inc.

import {config, formatValue, equals, checkNumber} from './common';
import {config, formatValue, equals} from './common';

@@ -37,4 +37,3 @@ export default class MathArray extends Array {

}
this.check();
return this;
return this.check();
}

@@ -46,4 +45,3 @@

}
this.check();
return this;
return this.check();
}

@@ -55,4 +53,3 @@

}
this.check();
return this;
return this.check();
}

@@ -107,38 +104,24 @@

length() {
return Math.sqrt(this.lengthSquared());
}
// Modifiers
lengthSquared() {
let length = 0;
if (length !== 0) {
for (let i = 0; i < this.ELEMENTS; ++i) {
length += this[i] * this[i];
}
negate() {
for (let i = 0; i < this.ELEMENTS; ++i) {
this[i] = -this[i];
}
return checkNumber(this);
return this.check();
}
distance(mathArray) {
return Math.sqrt(this.distanceSquared(mathArray));
}
distanceSquared(mathArray) {
let length = 0;
inverse() {
for (let i = 0; i < this.ELEMENTS; ++i) {
const dist = this[i] - mathArray[i];
length += dist * dist;
this[i] = 1 / this[i];
}
return checkNumber(length);
return this.check();
}
normalize() {
const length = this.length();
if (length !== 0) {
for (let i = 0; i < this.ELEMENTS; ++i) {
this[i] /= length;
}
lerp(vector, coeff) {
for (let i = 0; i < this.ELEMENTS; ++i) {
const coord = this[i];
this[i] = coord + coeff * (vector[0] - coord);
}
this.check();
return this;
return this.check();
}

@@ -145,0 +128,0 @@

@@ -48,2 +48,4 @@ // Copyright (c) 2017 Uber Technologies, Inc.

const IDENTITY_QUATERNION = [0, 0, 0, 1];
export function validateQuaternion(q) {

@@ -255,4 +257,4 @@ return q.length === 4 &&

// Performs a spherical linear interpolation between two quat
slerp(a, b, t) {
quat_slerp(this, a, b, t);
slerp({start = IDENTITY_QUATERNION, target, ratio}) {
quat_slerp(this, start, target, ratio);
this.check();

@@ -259,0 +261,0 @@ return this;

@@ -27,4 +27,2 @@ // Copyright (c) 2017 Uber Technologies, Inc.

import vec3_set from 'gl-vec3/set';
import vec3_length from 'gl-vec3/length';
import vec3_distance from 'gl-vec3/distance';
import vec3_angle from 'gl-vec3/angle';

@@ -37,8 +35,3 @@ import vec3_add from 'gl-vec3/add';

import vec3_scaleAndAdd from 'gl-vec3/scaleAndAdd';
import vec3_negate from 'gl-vec3/negate';
import vec3_inverse from 'gl-vec3/inverse';
import vec3_normalize from 'gl-vec3/normalize';
import vec3_dot from 'gl-vec3/dot';
import vec3_cross from 'gl-vec3/cross';
import vec3_lerp from 'gl-vec3/lerp';
import vec3_rotateX from 'gl-vec3/rotateX';

@@ -66,9 +59,2 @@ import vec3_rotateY from 'gl-vec3/rotateY';

// fromArray(array) {
// if (array instanceof Vector3) {
// return array;
// }
// return new Vector3(...array);
// }
set(x, y, z) {

@@ -90,10 +76,2 @@ vec3_set(this, x, y, z);

length() {
return vec3_length(this);
}
distance(vector) {
return vec3_distance(this, vector);
}
angle(vector) {

@@ -103,6 +81,2 @@ return vec3_angle(this, vector);

dot(vector) {
return vec3_dot(this, vector);
}
// MODIFIERS

@@ -140,17 +114,2 @@

negate() {
vec3_negate(this, this);
return this.check();
}
inverse() {
vec3_inverse(this, this);
return this.check();
}
normalize() {
vec3_normalize(this, this);
return this.check();
}
cross(vector) {

@@ -161,7 +120,2 @@ vec3_cross(this, this, vector);

lerp(vector, coeff) {
vec3_lerp(this, this, vector, coeff);
return this.check();
}
rotateX({radians, origin = ORIGIN}) {

@@ -168,0 +122,0 @@ vec3_rotateX(this, this, origin, radians);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc