@math.gl/geospatial
Advanced tools
Comparing version 3.0.0-alpha.4 to 3.0.0-alpha.5
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
194275
1695
0
+ Addedmath.gl@3.0.0-alpha.5(transitive)
- Removedmath.gl@3.0.0-alpha.4(transitive)
Updatedmath.gl@3.0.0-alpha.5