|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object skyview.util.Utilities
public class Utilities
utlity functions to use with SkyView
Constructor Summary | |
---|---|
Utilities()
|
Method Summary | |
---|---|
static double |
adjustCoordX(double c)
Ensure that a value is in the region -PI to PI. |
static double |
adjustCoordY(double c)
Ensure that a value is in the approrpiate range from -PI/2 to PI/2. |
static double |
angularDistance(double cx1,
double cy1,
double cx2,
double cy2)
Calculates angular distance between two points on a sphere. |
static double[] |
average3dData(double[][] data)
Average a 2-D array over it's first dimension. |
static double |
convertNotation(java.lang.String str)
Handle exponential notation. |
static double |
maxInArray(double[] d)
Find the maximum value of a double array. |
static int |
maxInArray(int[] d)
Find the maximum value in an integer array |
static double |
minInArray(double[] d)
Find the minimum value of an array. |
static double[] |
minMaxInArray(double[] d)
The the extremum values in an array |
static java.lang.String |
sexagesimal(double value,
int precision)
Format a sexagesimal coordinate string. |
static int[] |
whereInArray(double[] d,
double searchValue)
Find the indices of a double array that are equal a given value. |
static int[] |
whereInArray(double[] d,
java.lang.String operation,
double searchValue)
Find the indices of a double array that satisfy the given criterion. |
static int[] |
whereNaNInArray(double[] d)
Find the indices of a double array that are NaNs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utilities()
Method Detail |
---|
public static double angularDistance(double cx1, double cy1, double cx2, double cy2)
cx1
- Longitude like coordinate of first pointcy1
- Latitude like coordinate of first pointcx2
- Longitude like coordinate of second pointcy1
- Latitude like coordinate of second point
public static double[] minMaxInArray(double[] d)
d
- An array of doubles
public static int maxInArray(int[] d)
d
- Array to be checked
public static double maxInArray(double[] d)
d
- The array to be checked
public static double minInArray(double[] d)
d
- The array to be checked.
public static double adjustCoordX(double c)
c
- The input value.
public static double adjustCoordY(double c)
(0, -91) -> (180, -89)but this only addresses the latitudes.
c
- The input value.
public static int[] whereNaNInArray(double[] d)
d
- The arraysearchValue
- Value searched for.
public static int[] whereInArray(double[] d, double searchValue)
d
- The arraysearchValue
- Value searched for.
public static int[] whereInArray(double[] d, java.lang.String operation, double searchValue)
d
- The arrayoperation
- Looking for equality, <, or >.searchValue
- Value searched for.
public static double convertNotation(java.lang.String str)
str
- Input string
public static java.lang.String sexagesimal(double value, int precision)
value
- A double precision value which is to be
converted to a string representation.
The user should convert
to hours prior to this call if needed.precision
- A integer value giving the precision to which
the value is to be shown.
public static double[] average3dData(double[][] data)
data
- The array to be averaged.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |