public class Utilities
extends java.lang.Object
| Constructor and Description |
|---|
Utilities() |
| Modifier and Type | Method and Description |
|---|---|
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 java.lang.String |
encodeHTML(java.lang.String str)
Encodes a string for HTML output.
|
static double |
maxInArray(double[] d)
Find the maximum value in 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)
Determines the extremum values in an array of doubles.
|
static java.lang.Object |
newInstance(java.lang.String cls,
java.lang.String pkg)
Create an object of a given class.
|
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.
|
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 pointpublic static double[] minMaxInArray(double[] d)
d - An array of doublespublic static int maxInArray(int[] d)
d - The 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 array.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 stringpublic 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.public static java.lang.Object newInstance(java.lang.String cls,
java.lang.String pkg)
public static java.lang.String encodeHTML(java.lang.String str)
str - The input string.