Package cds.healpix
Interface Projection
- All Known Implementing Classes:
Healpix
public interface Projection
Define a projection of spherical coordinates (in the unit sphere) to the Euclidean plane, together
with the reverse operation.
Remark: we use arrays instead of objects because HEALPix is a low level library focused on
performances. Accessing an element in an array is faster than accessing a class attribute.
- Author:
- F.-X. Pineau
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Index of the lattitude in the array containing the result of an unproject method.static final int
Index of the longitude in the array containing the result of an unproject method.static final int
Index of the x coordinate in the array containing the result of a project method.static final int
Index of the y coordinate in the array containing the result of a project method. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
project
(double lonRad, double latRad) Project the given spherical coordinates into the Euclidean plane.void
project
(double lonRad, double latRad, double[] resultXY) Seeproject(double, double)
with the result stored in the given array.double[]
unproject
(double x, double y) Reverse projection: we look for spherical coordinates from their projected coordinates (project(double, double)
.void
unproject
(double x, double y, double[] resultLonLat) Seeunproject(double, double)
with the result stored in the given array.
-
Field Details
-
LON_INDEX
static final int LON_INDEXIndex of the longitude in the array containing the result of an unproject method.- See Also:
-
LAT_INDEX
static final int LAT_INDEXIndex of the lattitude in the array containing the result of an unproject method.- See Also:
-
X_INDEX
static final int X_INDEXIndex of the x coordinate in the array containing the result of a project method.- See Also:
-
Y_INDEX
static final int Y_INDEXIndex of the y coordinate in the array containing the result of a project method.- See Also:
-
-
Method Details
-
project
double[] project(double lonRad, double latRad) Project the given spherical coordinates into the Euclidean plane.- Parameters:
lonRad
- longitude in radians (the accepted value range is implementation dependent)latRad
- latitude in [-pi/2, pi/2] radians- Returns:
- the projection of the given spherical coordinate into the Euclidean plane.
The x and y coordinate are stored in the returned array at indices
X_INDEX
andY_INDEX
respectively. The range of possible value for x and y is implementation dependent.
-
project
void project(double lonRad, double latRad, double[] resultXY) Seeproject(double, double)
with the result stored in the given array.- Parameters:
lonRad
- seeproject(double, double)
latRad
- seeproject(double, double)
resultXY
- array used to store the result. Must be of size >= 2.
-
unproject
double[] unproject(double x, double y) Reverse projection: we look for spherical coordinates from their projected coordinates (project(double, double)
.- Parameters:
x
- the x coordinate of the projected spherical point we are looking for, the accepted value range is implementation dependenty
- the y coordinate of the projected spherical point we are looking for, must be in [-2, 2].- Returns:
- the spherical coordinates leading to the given projection coordinates.
The lon and lat coordinate are stored in the returned array at indices
LON_INDEX
andLAT_INDEX
respectively. Lat is in [-pi/2, pi/2] radians, lon is also in radians but it possible value range is implementation dependent).
-
unproject
void unproject(double x, double y, double[] resultLonLat) Seeunproject(double, double)
with the result stored in the given array.- Parameters:
x
-unproject(double, double)
y
-unproject(double, double)
resultLonLat
- array used to store the result. Must be of size >= 2.
-