|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.roboticsAPI.geometricModel.math.MathUtils
public final class MathUtils
Utility class providing static helper methods for the mathematical classes.
Vector,
Matrix| Field Summary | |
|---|---|
static double |
DEFAULT_EPSILON
A small epsilon value that can be used in approximate equality comparisons, as provided by the equal methods. |
static double |
MILLIMETER_TO_METER_FACTOR
Factor for conversion from millimetre to meter. |
| Method Summary | |
|---|---|
static IRotation |
defensiveCopy(IRotation orig)
Returns an immutable AbstractRotation instance of the given
rotation. |
static ITransformation |
defensiveCopy(ITransformation orig)
Returns an immutable AbstractTransformation instance of the given
transformation. |
static boolean |
elementEqual(IRotation a,
IRotation b,
double epsilon)
Checks if two Rotations are approximately equal by checking the matrix representations for element-wise approximate equality. |
static boolean |
elementEqual(ITransformation a,
ITransformation b,
double epsilon)
Checks if two transformations are approximately equal. |
static boolean |
elementEqual(Matrix a,
Matrix b,
double epsilon)
Checks if the two matrices are element wise nearly equal. |
static boolean |
elementEqual(Point a,
Point b,
double epsilon)
Checks if the two points are element wise nearly equal. |
static boolean |
elementEqual(Vector a,
Vector b,
double epsilon)
Checks if the two vectors are element wise nearly equal. |
static boolean |
equal(double value1,
double value2,
double epsilon)
Checks if the two double values are nearly equal. |
static String |
format(double number)
Formats the number as a string with a default number of floating point digits; this formatting is independently from your Locale settings. |
static double |
toMeter(double mmValue)
Converts the specified distance in millimetre to a meter value. |
static double |
toMillimeter(double mValue)
Converts the specified distance in meter to a millimeter value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_EPSILON
equal methods.
equal(double, double, double),
elementEqual(Vector, Vector, double),
elementEqual(Matrix, Matrix, double),
Constant Field Valuespublic static final double MILLIMETER_TO_METER_FACTOR
| Method Detail |
|---|
public static boolean equal(double value1,
double value2,
double epsilon)
value1 - The first value.value2 - The second value.epsilon - the maximum tolerated difference between the values
|value1 - value2| < epsilon.
public static boolean elementEqual(Vector a,
Vector b,
double epsilon)
result = false;
For index = 0 to 2 do
result &&= |vector1(index) - vector2(index)| < epsilon
endFor
a - The first vector.b - The second vector.epsilon - the maximum tolerated difference between the respective
elements
false.Vector.equals(Object)
public static boolean elementEqual(Matrix a,
Matrix b,
double epsilon)
result = false;
For row = 0 to 2 do
For column = 0 to 2 do
result &&= |matrix1(row,column) - matrix2(row,column)| < epsilon
endFor - column
endFor - row
a - The first matrix.b - The second matrix.epsilon - the maximum tolerated difference between the respective
elements
false.Matrix.equals(Object)
public static boolean elementEqual(Point a,
Point b,
double epsilon)
elementEqual(Vector, Vector, double)
a - The first point.b - The second point.epsilon - the maximum tolerated difference between the respective
elements
false.Point.equals(Object)
public static boolean elementEqual(IRotation a,
IRotation b,
double epsilon)
elementEqual(Matrix, Matrix, double)
a - The first rotation.b - The second rotation.epsilon - the maximum tolerated difference between the respective matrix
elements
false.
public static boolean elementEqual(ITransformation a,
ITransformation b,
double epsilon)
elementEqual(Matrix, Matrix, double) and
elementEqual(Vector, Vector, double) ). A small epsilon
check is performed.
a - The first transformation.b - The second transformation.epsilon - the maximum tolerated difference between the respective matrix
elements
false.public static String format(double number)
Locale settings.
number - the number to be formatted
public static IRotation defensiveCopy(IRotation orig)
AbstractRotation instance of the given
rotation. If the given rotation is already of a known immutable type then
it is returned unchanged.
orig - The rotation whose value should be taken over.
AbstractRotation instance
IllegalArgumentException - if orig is nullpublic static ITransformation defensiveCopy(ITransformation orig)
AbstractTransformation instance of the given
transformation. If the given transformation is already of a known
immutable type then it is returned unchanged.
orig - The transformation whose value should be taken over.
AbstractTransformation instance
IllegalArgumentException - if orig is nullpublic static double toMeter(double mmValue)
mmValue - distance in millimetre
public static double toMillimeter(double mValue)
mValue - distance in meter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||