Socket
Socket
Sign inDemoInstall

@math.gl/geospatial

Package Overview
Dependencies
Maintainers
4
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@math.gl/geospatial - npm Package Compare versions

Comparing version 3.1.3 to 3.2.0-alpha.1

src/ellipsoid/ellipsoid.d.ts

40

dist/es5/ellipsoid/ellipsoid.js

@@ -18,3 +18,3 @@ "use strict";

var _math = require("math.gl");
var _core = require("@math.gl/core");

@@ -31,8 +31,8 @@ var vec3 = _interopRequireWildcard(require("gl-matrix/vec3"));

var scratchVector = new _math.Vector3();
var scratchNormal = new _math.Vector3();
var scratchK = new _math.Vector3();
var scratchPosition = new _math.Vector3();
var scratchHeight = new _math.Vector3();
var scratchCartesian = new _math.Vector3();
var scratchVector = new _core.Vector3();
var scratchNormal = new _core.Vector3();
var scratchK = new _core.Vector3();
var scratchPosition = new _core.Vector3();
var scratchHeight = new _core.Vector3();
var scratchCartesian = new _core.Vector3();
var wgs84;

@@ -54,13 +54,13 @@

(0, _classCallCheck2["default"])(this, Ellipsoid);
(0, _math.assert)(x >= 0.0);
(0, _math.assert)(y >= 0.0);
(0, _math.assert)(z >= 0.0);
this.radii = new _math.Vector3(x, y, z);
this.radiiSquared = new _math.Vector3(x * x, y * y, z * z);
this.radiiToTheFourth = new _math.Vector3(x * x * x * x, y * y * y * y, z * z * z * z);
this.oneOverRadii = new _math.Vector3(x === 0.0 ? 0.0 : 1.0 / x, y === 0.0 ? 0.0 : 1.0 / y, z === 0.0 ? 0.0 : 1.0 / z);
this.oneOverRadiiSquared = new _math.Vector3(x === 0.0 ? 0.0 : 1.0 / (x * x), y === 0.0 ? 0.0 : 1.0 / (y * y), z === 0.0 ? 0.0 : 1.0 / (z * z));
(0, _core.assert)(x >= 0.0);
(0, _core.assert)(y >= 0.0);
(0, _core.assert)(z >= 0.0);
this.radii = new _core.Vector3(x, y, z);
this.radiiSquared = new _core.Vector3(x * x, y * y, z * z);
this.radiiToTheFourth = new _core.Vector3(x * x * x * x, y * y * y * y, z * z * z * z);
this.oneOverRadii = new _core.Vector3(x === 0.0 ? 0.0 : 1.0 / x, y === 0.0 ? 0.0 : 1.0 / y, z === 0.0 ? 0.0 : 1.0 / z);
this.oneOverRadiiSquared = new _core.Vector3(x === 0.0 ? 0.0 : 1.0 / (x * x), y === 0.0 ? 0.0 : 1.0 / (y * y), z === 0.0 ? 0.0 : 1.0 / (z * z));
this.minimumRadius = Math.min(x, y, z);
this.maximumRadius = Math.max(x, y, z);
this.centerToleranceSquared = _math._MathUtils.EPSILON1;
this.centerToleranceSquared = _core._MathUtils.EPSILON1;

@@ -124,3 +124,3 @@ if (this.radiiSquared.z !== 0) {

value: function eastNorthUpToFixedFrame(origin) {
var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _math.Matrix4();
var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _core.Matrix4();
return (0, _ellipsoidTransform["default"])(this, 'east', 'north', 'up', origin, result);

@@ -131,3 +131,3 @@ }

value: function localFrameToFixedFrame(firstAxis, secondAxis, thirdAxis, origin) {
var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new _math.Matrix4();
var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new _core.Matrix4();
return (0, _ellipsoidTransform["default"])(this, firstAxis, secondAxis, thirdAxis, origin, result);

@@ -192,4 +192,4 @@ }

var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0];
(0, _math.assert)((0, _math.equals)(this.radii.x, this.radii.y, _math._MathUtils.EPSILON15));
(0, _math.assert)(this.radii.z > 0);
(0, _core.assert)((0, _core.equals)(this.radii.x, this.radii.y, _core._MathUtils.EPSILON15));
(0, _core.assert)(this.radii.z > 0);
scratchPosition.from(position);

@@ -196,0 +196,0 @@ var z = scratchPosition.z * (1 - this.squaredXOverSquaredZ);

@@ -8,6 +8,6 @@ "use strict";

var _math = require("math.gl");
var _core = require("@math.gl/core");
var EPSILON14 = 1e-14;
var scratchOrigin = new _math.Vector3();
var scratchOrigin = new _core.Vector3();
var VECTOR_PRODUCT_LOCAL_FRAME = {

@@ -60,16 +60,16 @@ up: {

var scratchAxisVectors = {
east: new _math.Vector3(),
north: new _math.Vector3(),
up: new _math.Vector3(),
west: new _math.Vector3(),
south: new _math.Vector3(),
down: new _math.Vector3()
east: new _core.Vector3(),
north: new _core.Vector3(),
up: new _core.Vector3(),
west: new _core.Vector3(),
south: new _core.Vector3(),
down: new _core.Vector3()
};
var scratchVector1 = new _math.Vector3();
var scratchVector2 = new _math.Vector3();
var scratchVector3 = new _math.Vector3();
var scratchVector1 = new _core.Vector3();
var scratchVector2 = new _core.Vector3();
var scratchVector3 = new _core.Vector3();
function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
var thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
(0, _math.assert)(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
(0, _core.assert)(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
var firstAxisVector;

@@ -79,3 +79,3 @@ var secondAxisVector;

var origin = scratchOrigin.copy(cartesianOrigin);
var atPole = (0, _math.equals)(origin.x, 0.0, EPSILON14) && (0, _math.equals)(origin.y, 0.0, EPSILON14);
var atPole = (0, _core.equals)(origin.x, 0.0, EPSILON14) && (0, _core.equals)(origin.y, 0.0, EPSILON14);

@@ -82,0 +82,0 @@ if (atPole) {

@@ -10,12 +10,12 @@ "use strict";

var _math = require("math.gl");
var _core = require("@math.gl/core");
var vec3 = _interopRequireWildcard(require("gl-matrix/vec3"));
var scratchVector = new _math.Vector3();
var scaleToGeodeticSurfaceIntersection = new _math.Vector3();
var scaleToGeodeticSurfaceGradient = new _math.Vector3();
var scratchVector = new _core.Vector3();
var scaleToGeodeticSurfaceIntersection = new _core.Vector3();
var scaleToGeodeticSurfaceGradient = new _core.Vector3();
function scaleToGeodeticSurface(cartesian, ellipsoid) {
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new _math.Vector3();
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new _core.Vector3();
var oneOverRadii = ellipsoid.oneOverRadii,

@@ -75,3 +75,3 @@ oneOverRadiiSquared = ellipsoid.oneOverRadiiSquared,

correction = func / derivative;
} while (Math.abs(func) > _math._MathUtils.EPSILON12);
} while (Math.abs(func) > _core._MathUtils.EPSILON12);

@@ -78,0 +78,0 @@ return scratchVector.scale([xMultiplier, yMultiplier, zMultiplier]).to(result);

@@ -14,3 +14,3 @@ "use strict";

var _math = require("math.gl");
var _core = require("@math.gl/core");

@@ -23,22 +23,22 @@ var _constants = require("./constants");

var scratchVector = new _math.Vector3();
var scratchVector = new _core.Vector3();
function fromCartographic(cartographic, vector) {
function fromCartographic(cartographic, result) {
var map = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
if ((0, _math.isArray)(cartographic)) {
vector[0] = map(cartographic[0]);
vector[1] = map(cartographic[1]);
vector[2] = cartographic[2];
if ((0, _core.isArray)(cartographic)) {
result[0] = map(cartographic[0]);
result[1] = map(cartographic[1]);
result[2] = cartographic[2];
} else if ('longitude' in cartographic) {
vector[0] = map(cartographic.longitude);
vector[1] = map(cartographic.latitude);
vector[2] = cartographic.height;
result[0] = map(cartographic.longitude);
result[1] = map(cartographic.latitude);
result[2] = cartographic.height;
} else {
vector[0] = map(cartographic.x);
vector[1] = map(cartographic.y);
vector[2] = cartographic.z;
result[0] = map(cartographic.x);
result[1] = map(cartographic.y);
result[2] = cartographic.z;
}
return vector;
return result;
}

@@ -48,3 +48,3 @@

var vector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scratchVector;
return fromCartographic(cartographic, vector, _math.config.cartographicRadians ? noop : _math.toRadians);
return fromCartographic(cartographic, vector, _core.config._cartographicRadians ? noop : _core.toRadians);
}

@@ -54,3 +54,3 @@

var vector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scratchVector;
return fromCartographic(cartographic, vector, _math.config.cartographicRadians ? _math.toDegrees : noop);
return fromCartographic(cartographic, vector, _core.config._cartographicRadians ? _core.toDegrees : noop);
}

@@ -61,3 +61,3 @@

if ((0, _math.isArray)(cartographic)) {
if ((0, _core.isArray)(cartographic)) {
cartographic[0] = map(vector[0]);

@@ -80,7 +80,7 @@ cartographic[1] = map(vector[1]);

function toCartographicFromRadians(vector, cartographic) {
return toCartographic(vector, cartographic, _math.config.cartographicRadians ? noop : _math.toDegrees);
return toCartographic(vector, cartographic, _core.config._cartographicRadians ? noop : _core.toDegrees);
}
function toCartographicFromDegrees(vector, cartographic) {
return toCartographic(vector, cartographic, _math.config.cartographicRadians ? _math.toRadians : noop);
return toCartographic(vector, cartographic, _core.config._cartographicRadians ? _core.toRadians : noop);
}

@@ -87,0 +87,0 @@

@@ -1,2 +0,2 @@

import { Vector3, Matrix4, toRadians, toDegrees, assert, equals, _MathUtils } from 'math.gl';
import { Vector3, Matrix4, toRadians, toDegrees, assert, equals, _MathUtils } from '@math.gl/core';
import * as vec3 from 'gl-matrix/vec3';

@@ -3,0 +3,0 @@ import { WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z } from '../constants';

@@ -1,2 +0,2 @@

import { Vector3, assert, equals as equalsEpsilon } from 'math.gl';
import { Vector3, assert, equals as equalsEpsilon } from '@math.gl/core';
const EPSILON14 = 1e-14;

@@ -3,0 +3,0 @@ const scratchOrigin = new Vector3();

@@ -1,2 +0,2 @@

import { Vector3, assert, _MathUtils } from 'math.gl';
import { Vector3, assert, _MathUtils } from '@math.gl/core';
import * as vec3 from 'gl-matrix/vec3';

@@ -3,0 +3,0 @@ const scratchVector = new Vector3();

@@ -1,2 +0,2 @@

import { Vector3, isArray, toRadians, toDegrees, config } from 'math.gl';
import { Vector3, isArray, toRadians, toDegrees, config } from '@math.gl/core';
import { WGS84_CONSTANTS } from './constants';

@@ -7,24 +7,24 @@

const scratchVector = new Vector3();
export function fromCartographic(cartographic, vector, map = noop) {
export function fromCartographic(cartographic, result, map = noop) {
if (isArray(cartographic)) {
vector[0] = map(cartographic[0]);
vector[1] = map(cartographic[1]);
vector[2] = cartographic[2];
result[0] = map(cartographic[0]);
result[1] = map(cartographic[1]);
result[2] = cartographic[2];
} else if ('longitude' in cartographic) {
vector[0] = map(cartographic.longitude);
vector[1] = map(cartographic.latitude);
vector[2] = cartographic.height;
result[0] = map(cartographic.longitude);
result[1] = map(cartographic.latitude);
result[2] = cartographic.height;
} else {
vector[0] = map(cartographic.x);
vector[1] = map(cartographic.y);
vector[2] = cartographic.z;
result[0] = map(cartographic.x);
result[1] = map(cartographic.y);
result[2] = cartographic.z;
}
return vector;
return result;
}
export function fromCartographicToRadians(cartographic, vector = scratchVector) {
return fromCartographic(cartographic, vector, config.cartographicRadians ? noop : toRadians);
return fromCartographic(cartographic, vector, config._cartographicRadians ? noop : toRadians);
}
export function fromCartographicToDegrees(cartographic, vector = scratchVector) {
return fromCartographic(cartographic, vector, config.cartographicRadians ? toDegrees : noop);
return fromCartographic(cartographic, vector, config._cartographicRadians ? toDegrees : noop);
}

@@ -49,6 +49,6 @@ export function toCartographic(vector, cartographic, map = noop) {

export function toCartographicFromRadians(vector, cartographic) {
return toCartographic(vector, cartographic, config.cartographicRadians ? noop : toDegrees);
return toCartographic(vector, cartographic, config._cartographicRadians ? noop : toDegrees);
}
export function toCartographicFromDegrees(vector, cartographic) {
return toCartographic(vector, cartographic, config.cartographicRadians ? toRadians : noop);
return toCartographic(vector, cartographic, config._cartographicRadians ? toRadians : noop);
}

@@ -55,0 +55,0 @@ export function isWGS84(vector) {

import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import { Vector3, Matrix4, toRadians, toDegrees, assert, equals, _MathUtils } from 'math.gl';
import { Vector3, Matrix4, toRadians, toDegrees, assert, equals, _MathUtils } from '@math.gl/core';
import * as vec3 from 'gl-matrix/vec3';

@@ -6,0 +6,0 @@ import { WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z } from '../constants';

@@ -1,2 +0,2 @@

import { Vector3, assert, equals as equalsEpsilon } from 'math.gl';
import { Vector3, assert, equals as equalsEpsilon } from '@math.gl/core';
var EPSILON14 = 1e-14;

@@ -3,0 +3,0 @@ var scratchOrigin = new Vector3();

@@ -1,2 +0,2 @@

import { Vector3, assert, _MathUtils } from 'math.gl';
import { Vector3, assert, _MathUtils } from '@math.gl/core';
import * as vec3 from 'gl-matrix/vec3';

@@ -3,0 +3,0 @@ var scratchVector = new Vector3();

@@ -1,2 +0,2 @@

import { Vector3, isArray, toRadians, toDegrees, config } from 'math.gl';
import { Vector3, isArray, toRadians, toDegrees, config } from '@math.gl/core';
import { WGS84_CONSTANTS } from './constants';

@@ -9,28 +9,28 @@

var scratchVector = new Vector3();
export function fromCartographic(cartographic, vector) {
export function fromCartographic(cartographic, result) {
var map = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
if (isArray(cartographic)) {
vector[0] = map(cartographic[0]);
vector[1] = map(cartographic[1]);
vector[2] = cartographic[2];
result[0] = map(cartographic[0]);
result[1] = map(cartographic[1]);
result[2] = cartographic[2];
} else if ('longitude' in cartographic) {
vector[0] = map(cartographic.longitude);
vector[1] = map(cartographic.latitude);
vector[2] = cartographic.height;
result[0] = map(cartographic.longitude);
result[1] = map(cartographic.latitude);
result[2] = cartographic.height;
} else {
vector[0] = map(cartographic.x);
vector[1] = map(cartographic.y);
vector[2] = cartographic.z;
result[0] = map(cartographic.x);
result[1] = map(cartographic.y);
result[2] = cartographic.z;
}
return vector;
return result;
}
export function fromCartographicToRadians(cartographic) {
var vector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scratchVector;
return fromCartographic(cartographic, vector, config.cartographicRadians ? noop : toRadians);
return fromCartographic(cartographic, vector, config._cartographicRadians ? noop : toRadians);
}
export function fromCartographicToDegrees(cartographic) {
var vector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scratchVector;
return fromCartographic(cartographic, vector, config.cartographicRadians ? toDegrees : noop);
return fromCartographic(cartographic, vector, config._cartographicRadians ? toDegrees : noop);
}

@@ -57,6 +57,6 @@ export function toCartographic(vector, cartographic) {

export function toCartographicFromRadians(vector, cartographic) {
return toCartographic(vector, cartographic, config.cartographicRadians ? noop : toDegrees);
return toCartographic(vector, cartographic, config._cartographicRadians ? noop : toDegrees);
}
export function toCartographicFromDegrees(vector, cartographic) {
return toCartographic(vector, cartographic, config.cartographicRadians ? toRadians : noop);
return toCartographic(vector, cartographic, config._cartographicRadians ? toRadians : noop);
}

@@ -63,0 +63,0 @@ export function isWGS84(vector) {

@@ -8,3 +8,3 @@ {

},
"version": "3.1.3",
"version": "3.2.0-alpha.1",
"keywords": [

@@ -27,2 +27,3 @@ "webgl",

},
"types": "src/index.js",
"main": "dist/es5/index.js",

@@ -37,6 +38,6 @@ "module": "dist/esm/index.js",

"@babel/runtime": "^7.0.0",
"@math.gl/core": "3.1.3",
"@math.gl/core": "3.2.0-alpha.1",
"gl-matrix": "^3.0.0"
},
"gitHead": "51993e1f66ea6ccff5977f2d1466e636917061c9"
"gitHead": "f342933ca13fa606bd60ac82bb24bb2959b13b32"
}

@@ -5,3 +5,3 @@ // This file is derived from the Cesium math library under Apache 2 license

/* eslint-disable */
import {Vector3, Matrix4, toRadians, toDegrees, assert, equals, _MathUtils} from 'math.gl';
import {Vector3, Matrix4, toRadians, toDegrees, assert, equals, _MathUtils} from '@math.gl/core';
import * as vec3 from 'gl-matrix/vec3';

@@ -8,0 +8,0 @@

@@ -1,2 +0,2 @@

import {Vector3, assert, equals as equalsEpsilon} from 'math.gl';
import {Vector3, assert, equals as equalsEpsilon} from '@math.gl/core';

@@ -3,0 +3,0 @@ const EPSILON14 = 1e-14;

/* eslint-disable */
import {Vector3, assert, _MathUtils} from 'math.gl';
import {Vector3, assert, _MathUtils} from '@math.gl/core';
import * as vec3 from 'gl-matrix/vec3';

@@ -4,0 +4,0 @@

// This file is derived from the Cesium math library under Apache 2 license
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
import {Vector3, isArray, toRadians, toDegrees, config} from 'math.gl';
import {Vector3, isArray, toRadians, toDegrees, config} from '@math.gl/core';
import {WGS84_CONSTANTS} from './constants';

@@ -11,25 +11,25 @@

export function fromCartographic(cartographic, vector, map = noop) {
export function fromCartographic(cartographic, result, map = noop) {
if (isArray(cartographic)) {
vector[0] = map(cartographic[0]);
vector[1] = map(cartographic[1]);
vector[2] = cartographic[2];
result[0] = map(cartographic[0]);
result[1] = map(cartographic[1]);
result[2] = cartographic[2];
} else if ('longitude' in cartographic) {
vector[0] = map(cartographic.longitude);
vector[1] = map(cartographic.latitude);
vector[2] = cartographic.height;
result[0] = map(cartographic.longitude);
result[1] = map(cartographic.latitude);
result[2] = cartographic.height;
} else {
vector[0] = map(cartographic.x);
vector[1] = map(cartographic.y);
vector[2] = cartographic.z;
result[0] = map(cartographic.x);
result[1] = map(cartographic.y);
result[2] = cartographic.z;
}
return vector;
return result;
}
export function fromCartographicToRadians(cartographic, vector = scratchVector) {
return fromCartographic(cartographic, vector, config.cartographicRadians ? noop : toRadians);
return fromCartographic(cartographic, vector, config._cartographicRadians ? noop : toRadians);
}
export function fromCartographicToDegrees(cartographic, vector = scratchVector) {
return fromCartographic(cartographic, vector, config.cartographicRadians ? toDegrees : noop);
return fromCartographic(cartographic, vector, config._cartographicRadians ? toDegrees : noop);
}

@@ -55,7 +55,7 @@

export function toCartographicFromRadians(vector, cartographic) {
return toCartographic(vector, cartographic, config.cartographicRadians ? noop : toDegrees);
return toCartographic(vector, cartographic, config._cartographicRadians ? noop : toDegrees);
}
export function toCartographicFromDegrees(vector, cartographic) {
return toCartographic(vector, cartographic, config.cartographicRadians ? toRadians : noop);
return toCartographic(vector, cartographic, config._cartographicRadians ? toRadians : noop);
}

@@ -62,0 +62,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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