org.jscience.astronomy.solarsystem.coordinates
Class CoordinatesUtils

java.lang.Object
  extended by org.jscience.astronomy.solarsystem.coordinates.CoordinatesUtils

public final class CoordinatesUtils
extends java.lang.Object


Method Summary
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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unit

public static double[] unit(double ra,
                            double dec)
Convert a coordinate pair to unit vectors

Parameters:
ra - The longitude like coordinate in radians.
dec - The latitude like coordinate in radians.
Returns:
A double[3] unit vector corresponding to the coordinates.

unit

public static double[] unit(double[] coord)
Convert a coordinate pair to unit vectors

Parameters:
coord - The input coordinates
Returns:
A double[3] unit vector corresponding to the coordinates.

unit

public static void unit(double[] coord,
                        double[] unitV)
Convert a coordinate pair to unit vectors. The user supplies the array to be filled, assumed to be a vector of length 3. are created in this version.

Parameters:
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.

coord

public static double[] coord(double[] unit)
Convert a unit vector to the corresponding coordinates.

Parameters:
unit - A double[3] unit vector.
Returns:
A double[2] coordinate vector.

coord

public static void coord(double[] unit,
                         double[] coord)
Convert a unit vector to the corresponding coordinates.

Parameters:
unit - A double[3] unit vector.
coord - A double[2] vector to hold the output coordinates.

sphdist

public static double sphdist(double lon1,
                             double lat1,
                             double lon2,
                             double lat2)
Distance between two points on a unit sphere.


sphdistDeg

public static double sphdistDeg(double lon1,
                                double lat1,
                                double lon2,
                                double lat2)
Distance between two points on a unit sphere with angles in degres.