public class ToolBox extends Object
| Constructor and Description |
|---|
ToolBox() |
| Modifier and Type | Method and Description |
|---|---|
static double |
getAngle(double sx,
double cx)
Determines an angle in degrees based on sin and cos of the angle.
|
static int |
getMax(int[] array)
Returns maximum value from the input array.
|
static int |
getMin(int i,
int j,
int k,
int l)
Uses Math.min method to determine the minimum of the four input values.
|
static String |
getTime(long elapsed)
Uses DateFormat to format the input value to hours, minutes, seconds and
mili seconds.
|
static String |
getTwoDecimalPlaces(double value)
Uses DecimalFormat to format the value.
|
static double[][] |
initArray(int width,
int height)
Initial value will be Double.MIN_VALUE.
|
static double[][] |
resizeArray(double[][] original,
int x,
int y,
int offsetX,
int offsetY)
Creates new array enlongated by x and y and fills it with
old walues at offsetX, offsetY.
|
static BufferedImage |
resizeImage(Image original,
int x,
int y,
int offsetX,
int offsetY)
Creates new a image enlarged by x and y and draws old image
at offsetX, offsetY.
|
public static int getMax(int[] array)
array - Input array.public static String getTime(long elapsed)
elapsed - Elapsed time in miliseconds.public static int getMin(int i,
int j,
int k,
int l)
i - first numberj - second numberk - third nubmerl - fourth numberpublic static double getAngle(double sx,
double cx)
sx - Sinus xcx - Cosinus xpublic static String getTwoDecimalPlaces(double value)
value - Double value to convert to string.public static BufferedImage resizeImage(Image original, int x, int y, int offsetX, int offsetY)
original - Original image to be stretched.x - Widht enlargement.y - Height enlargement.offsetX - Offset for original picture to be drawn at x-axis.offsetY - Offset for original picture to be drawn at y-axis.public static double[][] resizeArray(double[][] original,
int x,
int y,
int offsetX,
int offsetY)
original - Original array to be lengthened.x - Width enlargement.y - Height enlargement.offsetX - Offset for original data at x-axis.offsetY - Offset for original data at y-axis.public static double[][] initArray(int width,
int height)
Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.