🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@math.gl/geospatial

Package Overview
Dependencies
Maintainers
2
Versions
70
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

to
3.0.0-alpha.5

8

dist/es5/ellipsoid/ellipsoid.js

@@ -35,2 +35,3 @@ "use strict";

var scratchHeight = new _math.Vector3();
var scratchCartesian = new _math.Vector3();
var wgs84;

@@ -103,3 +104,4 @@

var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
var point = this.scaleToGeodeticSurface(cartesian, scratchPosition);
scratchCartesian.from(cartesian);
var point = this.scaleToGeodeticSurface(scratchCartesian, scratchPosition);

@@ -112,6 +114,6 @@ if (!point) {

var h = scratchHeight;
h.copy(cartesian).subtract(point);
h.copy(scratchCartesian).subtract(point);
var longitude = Math.atan2(normal.y, normal.x);
var latitude = Math.asin(normal.z);
var height = Math.sign(vec3.dot(h, cartesian)) * vec3.length(h);
var height = Math.sign(vec3.dot(h, scratchCartesian)) * vec3.length(h);
return (0, _typeUtils.toCartographicFromRadians)([longitude, latitude, height], result);

@@ -118,0 +120,0 @@ }

@@ -12,2 +12,3 @@ import { Vector3, Matrix4, toRadians, toDegrees, assert, equals, _MathUtils } from 'math.gl';

const scratchHeight = new Vector3();
const scratchCartesian = new Vector3();
let wgs84;

@@ -67,3 +68,4 @@ export default class Ellipsoid {

let result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
const point = this.scaleToGeodeticSurface(cartesian, scratchPosition);
scratchCartesian.from(cartesian);
const point = this.scaleToGeodeticSurface(scratchCartesian, scratchPosition);

@@ -76,6 +78,6 @@ if (!point) {

const h = scratchHeight;
h.copy(cartesian).subtract(point);
h.copy(scratchCartesian).subtract(point);
const longitude = Math.atan2(normal.y, normal.x);
const latitude = Math.asin(normal.z);
const height = Math.sign(vec3.dot(h, cartesian)) * vec3.length(h);
const height = Math.sign(vec3.dot(h, scratchCartesian)) * vec3.length(h);
return toCartographicFromRadians([longitude, latitude, height], result);

@@ -82,0 +84,0 @@ }

@@ -15,2 +15,3 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";

var scratchHeight = new Vector3();
var scratchCartesian = new Vector3();
var wgs84;

@@ -85,3 +86,4 @@

var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
var point = this.scaleToGeodeticSurface(cartesian, scratchPosition);
scratchCartesian.from(cartesian);
var point = this.scaleToGeodeticSurface(scratchCartesian, scratchPosition);

@@ -94,6 +96,6 @@ if (!point) {

var h = scratchHeight;
h.copy(cartesian).subtract(point);
h.copy(scratchCartesian).subtract(point);
var longitude = Math.atan2(normal.y, normal.x);
var latitude = Math.asin(normal.z);
var height = Math.sign(vec3.dot(h, cartesian)) * vec3.length(h);
var height = Math.sign(vec3.dot(h, scratchCartesian)) * vec3.length(h);
return toCartographicFromRadians([longitude, latitude, height], result);

@@ -100,0 +102,0 @@ }

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

},
"version": "3.0.0-alpha.4",
"version": "3.0.0-alpha.5",
"keywords": [

@@ -37,5 +37,5 @@ "webgl",

"gl-matrix": "^3.0.0",
"math.gl": "3.0.0-alpha.4"
"math.gl": "3.0.0-alpha.5"
},
"gitHead": "90158f9659da040d75517b7f07c169fd0d015577"
"gitHead": "ed165ad1fd1461c74e7f9b765c7a264d8132a312"
}

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

const scratchHeight = new Vector3();
const scratchCartesian = new Vector3();

@@ -102,3 +103,4 @@ let wgs84;

cartesianToCartographic(cartesian, result = [0, 0, 0]) {
const point = this.scaleToGeodeticSurface(cartesian, scratchPosition);
scratchCartesian.from(cartesian);
const point = this.scaleToGeodeticSurface(scratchCartesian, scratchPosition);

@@ -112,7 +114,7 @@ if (!point) {

const h = scratchHeight;
h.copy(cartesian).subtract(point);
h.copy(scratchCartesian).subtract(point);
const longitude = Math.atan2(normal.y, normal.x);
const latitude = Math.asin(normal.z);
const height = Math.sign(vec3.dot(h, cartesian)) * vec3.length(h);
const height = Math.sign(vec3.dot(h, scratchCartesian)) * vec3.length(h);

@@ -119,0 +121,0 @@ return toCartographicFromRadians([longitude, latitude, height], result);

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