public void setPrecision (double precision) { if (null != _polar) _polar.setPrecision(precision); if (null != _cartesian) _cartesian.setPrecision(precision); }
public void setPrecision (double precision) { if (null != _polar) _polar.setPrecision(precision); if (null != _cartesian) _cartesian.setPrecision(precision); }
private void updateCartesian () { if (null != _cartesian) return; if (null == _polar) return; // from WorldWind: ElipsoidalGlobe.geodeticToCartesian double latitude = getLatitudeRadians(); double cosLat = Math.cos(latitude); double sinLat = Math.sin(latitude); double longitude = getLongitudeRadians(); double cosLon = Math.cos(longitude); double sinLon = Math.sin(longitude); double elevation = (_elevationUsed ? getElevation() : 0.0); // Get the radius (in meters) of the vertical in prime meridian double rpm = WGS84_EQUATORIAL_RADIUS / Math.sqrt(1.0 - WGS84_ES * sinLat * sinLat); // Y axis is the axis of rotation, just like in WorldWind. double x = (rpm + elevation) * cosLat * sinLon; double z = (rpm + elevation) * cosLat * cosLon; double y = (rpm * (1.0 - WGS84_ES) + elevation) * sinLat; _cartesian = new Vector(x, y, z); _cartesian.setPrecision(_polar.getPrecision()); }
private void updateCartesian () { if (null != _cartesian) return; if (null == _polar) return; // from WorldWind: ElipsoidalGlobe.geodeticToCartesian double latitude = getLatitudeRadians(); double cosLat = Math.cos(latitude); double sinLat = Math.sin(latitude); double longitude = getLongitudeRadians(); double cosLon = Math.cos(longitude); double sinLon = Math.sin(longitude); double elevation = (_elevationUsed ? getElevation() : 0.0); // Get the radius (in meters) of the vertical in prime meridian double rpm = WGS84_EQUATORIAL_RADIUS / Math.sqrt(1.0 - WGS84_ES * sinLat * sinLat); // Y axis is the axis of rotation, just like in WorldWind. double x = (rpm + elevation) * cosLat * sinLon; double z = (rpm + elevation) * cosLat * cosLon; double y = (rpm * (1.0 - WGS84_ES) + elevation) * sinLat; _cartesian = new Vector(x, y, z); _cartesian.setPrecision(_polar.getPrecision()); }
_polar.setPrecision(_cartesian.getPrecision());
_polar.setPrecision(_cartesian.getPrecision());