|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.leeds.ccg.andyt.grids.utilities.Utilities
public class Utilities
This class holds miscellaneous general utility methods
Constructor Summary | |
---|---|
Utilities()
Creates a new instance of Utilities |
Method Summary | |
---|---|
static double |
angle(double x1,
double y1,
double x2,
double y2)
Returns the clockwise angle in radians to the y axis of the line from x1, y1 to x2, y2 |
static java.lang.Object[] |
densityPlot(Grid2DSquareCellAbstract xGrid,
Grid2DSquareCellAbstract yGrid,
int divisions,
Grid2DSquareCellDoubleFactory gridFactory)
Returns a density plot of xGrid values against yGrid values. |
static double |
distance(double x1,
double y1,
double x2,
double y2)
Returns the distance between a pair of coordinates |
static void |
exportIntArray(int[] intArray,
java.io.File file)
Exports int[] |
static java.awt.geom.Point2D.Double[] |
getSamplePoints(java.awt.geom.Point2D.Double point,
double angle,
double maxDistance,
double samplingDistance,
double samplingAngle,
int numberOfSamples)
TODO: documentation |
static java.awt.geom.Point2D.Double[] |
getSamplePoints(java.awt.geom.Point2D.Double point,
double angle,
double maxDistance,
int numberOfSamplingDistances,
int numberOfSamplingAngles)
TODO: documentation |
static double |
getValueALittleBitLarger(double value)
TODO: documentation |
static double |
getValueALittleBitSmaller(double value)
TODO: documentation |
static int[] |
memoryAllocation(int bytes)
Returns an int[] Used as a temporary means of allocating memory |
static java.lang.String |
time(long time)
Returns a string identifying the number of hours, minutes, seconds and milliseconds for the input time in milliseconds. |
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 int[] memoryAllocation(int bytes)
bytes
- an approximate number of bytes to be allocated in arraypublic static void exportIntArray(int[] intArray, java.io.File file)
public static java.lang.String time(long time)
public static double getValueALittleBitLarger(double value)
public static double getValueALittleBitSmaller(double value)
public static java.awt.geom.Point2D.Double[] getSamplePoints(java.awt.geom.Point2D.Double point, double angle, double maxDistance, int numberOfSamplingDistances, int numberOfSamplingAngles)
point
- point at centre of samplingangle
- angle in radians to the vertical (y axis) for first samplingmaxDistance
- the maximum sampling distancenumberOfSamplingDistances
- the number of sampling distances upto
maxDistancenumberOfSamplingAngles
- sets how many samplesPoints to take at each
sample distance. Always the first sample is at angle from the vertical
or y-axis. The angles at which samples are taken are all the same.public static java.awt.geom.Point2D.Double[] getSamplePoints(java.awt.geom.Point2D.Double point, double angle, double maxDistance, double samplingDistance, double samplingAngle, int numberOfSamples)
public static final double distance(double x1, double y1, double x2, double y2)
x1
- - the x coordinte of one pointy1
- - the y coordinte of one pointx2
- - the x coordinte of another pointy2
- - the y coordinte of another pointpublic static final double angle(double x1, double y1, double x2, double y2)
x1
- - the x coordinte of one pointy1
- - the y coordinte of one pointx2
- - the x coordinte of another pointy2
- - the y coordinte of another pointpublic static java.lang.Object[] densityPlot(Grid2DSquareCellAbstract xGrid, Grid2DSquareCellAbstract yGrid, int divisions, Grid2DSquareCellDoubleFactory gridFactory)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |