public class MathMiscUtils
extends java.lang.Object
Constructor and Description |
---|
MathMiscUtils() |
Modifier and Type | Method and Description |
---|---|
static double[] |
calcCentroidPolygon(java.util.ArrayList<java.awt.geom.Point2D> polyPoints) |
static double[] |
calcCentroidPolygonPoint(java.util.ArrayList<java.awt.Point> polyPoints) |
static double |
clamp(double val,
double min,
double max) |
static java.util.ArrayList<java.awt.geom.Point2D> |
dilatePolygon(java.util.ArrayList<java.awt.geom.Point2D> polyPoints,
double growByValue)
Dilation of a polygon by 'x'.
|
static java.util.ArrayList<java.awt.Point> |
dilatePolygonPoint(java.util.ArrayList<java.awt.Point> polyPoints,
double growByValue) |
static double |
filterDeadZone(double xx,
double deadZone) |
static double |
filterDeadZone(double xx,
double deadZone,
double maxValue)
Implements a deadZone filter.
|
static float |
filterDeadZone(float xx,
float deadZone) |
static float |
filterDeadZone(float xx,
float deadZone,
float maxValue) |
static void |
main(java.lang.String[] args) |
static double |
parseEngineeringModeToDouble(java.lang.String engValue) |
static double |
parseEngineeringRadix2ModeToDouble(java.lang.String engValue) |
static java.lang.String |
parseToEngineeringNotation(double val,
int decimalHouses) |
static java.lang.String |
parseToEngineeringRadix2Notation(double val,
int decimalHouses)
IEEE 1541 recommends:
a set of units to refer to quantities used in digital electronics and
computing:
bit (symbol 'b'), a binary digit;
byte (symbol 'B'), a set of adjacent bits (usually, but not
necessarily, eight) operated on as a group;
octet (symbol 'o'), a group of eight bits;
a set of prefixes to indicate binary multiples of the aforesaid
units:
kibi (symbol 'Ki'), 210 = 1024;
mebi (symbol 'Mi'), 220 = 1048576;
gibi (symbol 'Gi'), 230 = 1073741824;
tebi (symbol 'Ti'), 240 = 1099511627776;
pebi (symbol 'Pi'), 250 = 1125899906842624;
exbi (symbol 'Ei'), 260 = 1152921504606846976;
zebi (symbol 'Zi'), 270 = 11805916207174113034241;
yobi (symbol 'Yi'), 280 = 1208925819614629174706176;
that the first part of the binary prefix is pronounced as the
analogous SI prefix, and the second part is pronounced as bee;
that SI prefixes are not used to indicate binary multiples.
|
static double |
pointLineDistance(double px,
double py,
double lx1,
double ly1,
double lx2,
double ly2) |
static double |
pointLineDistance(java.awt.geom.Point2D point,
java.awt.geom.Line2D line) |
static double |
round(double val,
int decimalHouses) |
static float |
round(float val,
int decimalHouses) |
public static double round(double val, int decimalHouses)
val
- decimalHouses
- public static float round(float val, int decimalHouses)
val
- decimalHouses
- public static double pointLineDistance(double px, double py, double lx1, double ly1, double lx2, double ly2)
public static double pointLineDistance(java.awt.geom.Point2D point, java.awt.geom.Line2D line)
public static double[] calcCentroidPolygonPoint(java.util.ArrayList<java.awt.Point> polyPoints)
public static double[] calcCentroidPolygon(java.util.ArrayList<java.awt.geom.Point2D> polyPoints)
public static java.util.ArrayList<java.awt.Point> dilatePolygonPoint(java.util.ArrayList<java.awt.Point> polyPoints, double growByValue)
public static java.util.ArrayList<java.awt.geom.Point2D> dilatePolygon(java.util.ArrayList<java.awt.geom.Point2D> polyPoints, double growByValue)
polyPoints
- growByValue
- Value to grow (+) or shrink (-).public static java.lang.String parseToEngineeringNotation(double val, int decimalHouses)
val
- decimalHouses
- public static double parseEngineeringModeToDouble(java.lang.String engValue)
engValue
- public static java.lang.String parseToEngineeringRadix2Notation(double val, int decimalHouses)
IEEE 1541 recommends:
The bi part of the prefix comes from the word binary, so for example, kibibyte means a kilobinary byte, that is 1024 bytes.
Note the capital 'K' for the kibi- symbol: while the symbol for the analogous SI prefix kilo- is a small 'k', a capital 'K' has been selected for consistency with the other prefixes and with the widespread use of the misspelled SI prefix (as in 'KB').
IEEE 1541 is closely related to Amendment 2 to IEC International Standard IEC 60027-2, except the latter uses 'bit' as the symbol for bit, as opposed to 'b'.
Today the harmonized ISO/IEC IEC 80000-13:2008 - Quantities and units -- Part 13: Information science and technology standard cancels and replaces subclauses 3.8 and 3.9 of IEC 60027-2:2005 (those related to Information theory and Prefixes for binary multiples).
val
- decimalHouses
- public static double parseEngineeringRadix2ModeToDouble(java.lang.String engValue)
engValue
- public static double filterDeadZone(double xx, double deadZone, double maxValue)
...................
........^..........
........|..........
....max +----/.....
........|.../|.....
.----/dz|--/-+--->.
..../...|....max...
.../....|..........
........|..........
...................
xx
- deadZone
- In teh picture 'dz'maxValue
- public static double filterDeadZone(double xx, double deadZone)
xx
- deadZone
- #filterDeadZone(double, double, double)}.
public static float filterDeadZone(float xx, float deadZone, float maxValue)
xx
- deadZone
- maxValue
- #filterDeadZone(double, double, double)}.
public static float filterDeadZone(float xx, float deadZone)
xx
- deadZone
- #filterDeadZone(double, double, double)}.
public static double clamp(double val, double min, double max)
public static void main(java.lang.String[] args)
Copyright © 2004-2014 FEUP-LSTS and Neptus developers. All Rights Reserved.