/** * Converts a geographic position to Cartesian coordinates. This globe's projection specifies the Cartesian * coordinate system. * * @param latitude the position's latitude in degrees * @param longitude the position's longitude in degrees * @param altitude the position's altitude in meters * @param result a pre-allocated {@link Vec3} in which to store the computed X, Y and Z Cartesian coordinates * * @return the result argument, set to the computed Cartesian coordinates * * @throws IllegalArgumentException if the result is null */ public Vec3 geographicToCartesian(double latitude, double longitude, double altitude, Vec3 result) { if (result == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Globe", "geographicToCartesian", "missingResult")); } return this.projection.geographicToCartesian(this, latitude, longitude, altitude, result); }