You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var latitude = 45.0;
var longitude = 90;
var cartographic = Cesium.Cartographic.fromDegrees(longitude,latitude);
var cartesian = Cesium.Ellipsoid.WGS84.cartographicToCartesian(cartographic,new Cesium.Cartesian3());
var surfaceNormal = Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(cartesian,new Cesium.Cartesian3());
cartographic.height= 2000000;
var cartesian2 = Cesium.Ellipsoid.WGS84.cartographicToCartesian(cartographic,new Cesium.Cartesian3());
var surfaceNormal2 = Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(cartesian2,new Cesium.Cartesian3());
//log 'false'
console.log(Cesium.Cartesian3.equalsEpsilon(surfaceNormal,surfaceNormal2, Cesium.Math.EPSILON8));
However, Ellipsoid.geodeticSurfaceNormalCartographic returns accurate result in this case:
var cartographic = Cesium.Cartographic.fromDegrees(longitude,latitude);
var surfaceNormalFromCartographic = Cesium.Ellipsoid.WGS84.geodeticSurfaceNormalCartographic(cartographic);
cartographic.height= 2000000;
var surfaceNormalFromCartographic2 = Cesium.Ellipsoid.WGS84.geodeticSurfaceNormalCartographic(cartographic);
//log 'true'
console.log(Cesium.Cartesian3.equalsEpsilon(surfaceNormalFromCartographic,surfaceNormalFromCartographic2, Cesium.Math.EPSILON8));
The text was updated successfully, but these errors were encountered:
Not really. Maybe additional parameter that explicitly indicates if the input value is on the surface.
Anyway, please consider reviewing of the code that currently uses this function (js and glsl). I saw some places where the input is not necessarily on the ellipsoid surface.
I believe that for most of the needs the bias is not significant, but there can be places in which this could lead to error
I encountered this while working on #4622.
Sandcastle for this issue
The following code log
false
to console:However,
Ellipsoid.geodeticSurfaceNormalCartographic
returns accurate result in this case:The text was updated successfully, but these errors were encountered: