gov.nasa.worldwind.globe

## Interface Globe

• All Known Implementing Classes:
BasicGlobe, GlobeWgs84

`public interface Globe`
Planet or celestial object that can be modeled by an ellipsoid. Implementations of this interface specify the ellipsoidal parameters and projection appropriate for a specific planet or celestial object.

A globe uses the Cartesian coordinate system specified by its `GeographicProjection`. All Cartesian coordinates and elevations are in meters.

• ### Method Summary

All Methods
Modifier and Type Method and Description
`Matrix4` ```cameraToCartesianTransform(Camera camera, Matrix4 result)```
`LookAt` ```cameraToLookAt(Camera camera, LookAt result)```
`Position` ```cartesianToGeographic(double x, double y, double z, Position result)```
Converts a Cartesian point to a geographic position.
`Matrix4` ```cartesianToLocalTransform(double x, double y, double z, Matrix4 result)```
`Vec3` ```geographicToCartesian(double latitude, double longitude, double altitude, Vec3 result)```
Converts a geographic position to Cartesian coordinates.
`float[]` ```geographicToCartesianGrid(Sector sector, int numLat, int numLon, double[] elevations, Vec3 origin, float[] result, int stride, int pos)```
`Vec3` ```geographicToCartesianNormal(double latitude, double longitude, Vec3 result)```
`Matrix4` ```geographicToCartesianTransform(double latitude, double longitude, double altitude, Matrix4 result)```
`double` `getEccentricitySquared()`
Indicates the eccentricity squared parameter of the globe's ellipsoid.
`double` `getEquatorialRadius()`
Indicates the radius in meters of the globe's ellipsoid at the equator.
`double` `getPolarRadius()`
Indicates the radius in meters of the globe's ellipsoid at the poles.
`GeographicProjection` `getProjection()`
Indicates the geographic projection used by this globe.
`double` ```getRadiusAt(double latitude, double longitude)```
Indicates the radius in meters of the globe's ellipsoid at a specified location.
`Tessellator` `getTessellator()`
`double` `horizonDistance(double eyeAltitude)`
Indicates the distance to the globe's horizon from a specified eye altitude.
`double` ```horizonDistance(double eyeAltitude, double objectAltitude)```
Indicates the distance to an object passing over the globe's horizon from a specified eye altitude.
`boolean` ```intersect(Line line, Vec3 result)```
Computes the first intersection of this globe with a specified line.
`Camera` ```lookAtToCamera(LookAt lookAt, Camera result)```
`Matrix4` ```lookAtToCartesianTransform(LookAt lookAt, Matrix4 result)```
`void` `setProjection(GeographicProjection projection)`
Sets the geographic projection used by this globe.
`void` `setTessellator(Tessellator tessellator)`
• ### Method Detail

`double getEquatorialRadius()`
Indicates the radius in meters of the globe's ellipsoid at the equator.
Returns:
the radius at the equator, in meters.

`double getPolarRadius()`
Indicates the radius in meters of the globe's ellipsoid at the poles.
Returns:
the radius at the poles, in meters.

```double getRadiusAt(double latitude,
double longitude)```
Indicates the radius in meters of the globe's ellipsoid at a specified location.
Parameters:
`latitude` - the location's latitude in degrees
`longitude` - the location's longitude in degrees
Returns:
the radius in meters of the globe's ellipsoid at the specified location
• #### getEccentricitySquared

`double getEccentricitySquared()`
Indicates the eccentricity squared parameter of the globe's ellipsoid. This is equivalent to ```2*f - f*f```, where `f` is the ellipsoid's flattening parameter.
Returns:
the eccentricity squared parameter of the globe's ellipsoid.
• #### getProjection

`GeographicProjection getProjection()`
Indicates the geographic projection used by this globe. The projection specifies this globe's Cartesian coordinate system.
Returns:
the globe's projection
• #### setProjection

`void setProjection(GeographicProjection projection)`
Sets the geographic projection used by this globe. The projection specifies this globe's Cartesian coordinate system.
Parameters:
`projection` - the projection to use
Throws:
`java.lang.IllegalArgumentException` - if the projection is null
• #### getTessellator

`Tessellator getTessellator()`
Returns:
• #### setTessellator

`void setTessellator(Tessellator tessellator)`
Parameters:
`tessellator` -
• #### geographicToCartesian

```Vec3 geographicToCartesian(double latitude,
double longitude,
double altitude,
Vec3 result)```
Converts a geographic position to Cartesian coordinates. This globe's projection specifies the Cartesian coordinate system.
Parameters:
`latitude` - the position's latitude in degrees
`longitude` - the position's longitude in degrees
`altitude` - the position's altitude in meters
`result` - a pre-allocated `Vec3` in which to store the computed X, Y and Z Cartesian coordinates
Returns:
the result argument, set to the computed Cartesian coordinates
Throws:
`java.lang.IllegalArgumentException` - if the result is null
• #### geographicToCartesianNormal

```Vec3 geographicToCartesianNormal(double latitude,
double longitude,
Vec3 result)```
Parameters:
`latitude` -
`longitude` -
`result` -
Returns:
Throws:
`java.lang.IllegalArgumentException` - if the result is null
• #### geographicToCartesianTransform

```Matrix4 geographicToCartesianTransform(double latitude,
double longitude,
double altitude,
Matrix4 result)```
Parameters:
`latitude` -
`longitude` -
`altitude` -
`result` -
Returns:
Throws:
`java.lang.IllegalArgumentException` - if the result is null
• #### geographicToCartesianGrid

```float[] geographicToCartesianGrid(Sector sector,
int numLat,
int numLon,
double[] elevations,
Vec3 origin,
float[] result,
int stride,
int pos)```
Parameters:
`sector` -
`numLat` -
`numLon` -
`elevations` -
`origin` -
`result` -
`stride` -
`pos` -
Returns:
Throws:
`java.lang.IllegalArgumentException` - if any argument is null,
• #### cartesianToGeographic

```Position cartesianToGeographic(double x,
double y,
double z,
Position result)```
Converts a Cartesian point to a geographic position. This globe's projection specifies the Cartesian coordinate system.
Parameters:
`x` - the Cartesian point's X component
`y` - the Cartesian point's Y component
`z` - the Cartesian point's Z component
`result` - a pre-allocated `Position` in which to store the computed geographic position
Returns:
the result argument, set to the computed geographic position
Throws:
`java.lang.IllegalArgumentException` - if the result is null
• #### cartesianToLocalTransform

```Matrix4 cartesianToLocalTransform(double x,
double y,
double z,
Matrix4 result)```
• #### cameraToCartesianTransform

```Matrix4 cameraToCartesianTransform(Camera camera,
Matrix4 result)```
• #### cameraToLookAt

```LookAt cameraToLookAt(Camera camera,
LookAt result)```
• #### lookAtToCartesianTransform

```Matrix4 lookAtToCartesianTransform(LookAt lookAt,
Matrix4 result)```
• #### lookAtToCamera

```Camera lookAtToCamera(LookAt lookAt,
Camera result)```
• #### horizonDistance

`double horizonDistance(double eyeAltitude)`
Indicates the distance to the globe's horizon from a specified eye altitude. The result of this method is undefined if the eye altitude is negative.
Parameters:
`eyeAltitude` - the eye altitude in meters
Returns:
the distance in meters
• #### horizonDistance

```double horizonDistance(double eyeAltitude,
double objectAltitude)```
Indicates the distance to an object passing over the globe's horizon from a specified eye altitude. This computes the distance at which a point at objectAltitude is on the threshold of passing beyond the globe's horizon, and would thereafter be occluded by the globe. The result of this method is undefined if either altitude is negative.
Parameters:
`eyeAltitude` - the eye altitude in meters
`objectAltitude` - the object altitude in meters
Returns:
the distance in meters
• #### intersect

```boolean intersect(Line line,
Vec3 result)```
Computes the first intersection of this globe with a specified line. The line is interpreted as a ray; intersection points behind the line's origin are ignored.
Parameters:
`line` - the line to intersect with this globe
`result` - a pre-allocated `Vec3` in which to return the computed point
Returns:
true if the ray intersects the globe, otherwise false
Throws:
`java.lang.IllegalArgumentException` - If either argument is null