public final class Util
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static double[] |
coord(double[] unit)
Convert a unit vector to the corresponding coordinates.
|
static void |
coord(double[] unit,
double[] coord)
Convert a unit vector to the corresponding coordinates.
|
static double[] |
coord(double x,
double y,
double z) |
static double |
sphdist(double lon1,
double lat1,
double lon2,
double lat2)
Distance between two points on a unit sphere.
|
static double |
sphdistDeg(double lon1,
double lat1,
double lon2,
double lat2)
Distance between two points on a unit sphere with angles in degres.
|
static double[] |
unit(double[] coord)
Convert a coordinate pair to unit vectors
|
static void |
unit(double[] coord,
double[] unitV)
Convert a coordinate pair to unit vectors.
|
static double[] |
unit(double ra,
double dec)
Convert a coordinate pair to unit vectors
|
public static double[] unit(double ra, double dec)
ra
- The longitude like coordinate in radians.dec
- The latitude like coordinate in radians.public static double[] unit(double[] coord)
coord
- The input coordinatespublic static void unit(double[] coord, double[] unitV)
coord
- A double[2] vector of coordinates.unitV
- A pre-allocated double[3] unit vector. The values
of this vector will be changed on output.public static double[] coord(double[] unit)
unit
- A double[3] unit vector.public static double[] coord(double x, double y, double z)
public static void coord(double[] unit, double[] coord)
unit
- A double[3] unit vector.coord
- A double[2] vector to hold
the output coordinates.public static double sphdist(double lon1, double lat1, double lon2, double lat2)
public static double sphdistDeg(double lon1, double lat1, double lon2, double lat2)