|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.MoreMath
public class MoreMath
MoreMath provides functions that are not part of the standard Math class.
Functions: asinh(float x) - hyperbolic arcsine sinh(float x) - hyperbolic sine Need to Implement: Function Definition Hyperbolic cosine (eˆx+eˆ-x)/2 Hyperbolic tangent (eˆx-eˆ-x)/(eˆx+eˆ-x) Hyperbolic arc cosine 2 log (sqrt((x+1)/2) + sqrt((x-1)/2)) Hyperbolic arc tangent (log (1+x) - log (1-x))/2
Field Summary | |
---|---|
static double |
EQUIVALENT_TOLERANCE
|
static float |
HALF_PI
Math.PI/2 |
static double |
HALF_PI_D
Math.PI/2 |
static float |
TWO_PI
2*Math.PI |
static double |
TWO_PI_D
2*Math.PI |
Method Summary | |
---|---|
static boolean |
approximately_equal(double a,
double b)
Checks if a ~= b. |
static boolean |
approximately_equal(double a,
double b,
double epsilon)
Checks if a ~= b. |
static boolean |
approximately_equal(float a,
float b,
float epsilon)
Checks if a ~= b. |
static double |
asinh(double x)
Hyperbolic arcsin. |
static float |
asinh(float x)
Hyperbolic arcsin. |
static int |
BuildInteger(byte[] bytevec,
boolean MSBFirst)
Build int out of bytes. |
static int |
BuildInteger(byte[] bytevec,
int offset,
boolean MSBFirst)
Build int out of bytes. |
static int |
BuildIntegerBE(byte[] bytevec)
Build int out of bytes (in big endian order). |
static int |
BuildIntegerBE(byte[] bytevec,
int offset)
Build int out of bytes (in big endian order). |
static int |
BuildIntegerLE(byte[] bytevec)
Build int out of bytes (in little endian order). |
static int |
BuildIntegerLE(byte[] bytevec,
int offset)
Build int out of bytes (in little endian order). |
static long |
BuildLong(byte[] bytevec,
boolean MSBFirst)
Build long out of bytes. |
static long |
BuildLong(byte[] bytevec,
int offset,
boolean MSBFirst)
Build long out of bytes. |
static long |
BuildLongBE(byte[] bytevec)
Build long out of bytes (in big endian order). |
static long |
BuildLongBE(byte[] bytevec,
int offset)
Build long out of bytes (in big endian order). |
static long |
BuildLongLE(byte[] bytevec)
Build long out of bytes (in little endian order). |
static long |
BuildLongLE(byte[] bytevec,
int offset)
Build long out of bytes (in little endian order). |
static short |
BuildShort(byte[] bytevec,
boolean MSBFirst)
Build short out of bytes. |
static short |
BuildShort(byte[] bytevec,
int offset,
boolean MSBFirst)
Build short out of bytes. |
static short |
BuildShortBE(byte[] bytevec,
boolean MSBFirst)
Build short out of bytes (in big endian order). |
static short |
BuildShortBE(byte[] bytevec,
int offset)
Build short out of bytes (in big endian order). |
static short |
BuildShortLE(byte[] bytevec,
boolean MSBFirst)
Build short out of bytes (in little endian order). |
static short |
BuildShortLE(byte[] bytevec,
int offset)
Build short out of bytes (in little endian order). |
static boolean |
even(int x)
Check if number is even. |
static boolean |
even(long x)
Check if number is even. |
static boolean |
even(short x)
Check if number is even. |
static double |
justLessThan(double val,
double lessThan,
double howMuchLess)
Return value just less than provided value, in positive and negative terms. |
static double |
latJLT90(double val)
lat just less than 90 degrees. |
static boolean |
odd(int x)
Check if number is odd. |
static boolean |
odd(long x)
Check if number is odd. |
static boolean |
odd(short x)
Check if number is odd. |
static int |
sign(double x)
Return sign of number. |
static int |
sign(float x)
Return sign of number. |
static int |
sign(int x)
Return sign of number. |
static int |
sign(long x)
Return sign of number. |
static int |
sign(short x)
Return sign of number. |
static int |
signedToInt(byte b)
Converts a byte in the range of -128 to 127 to an int in the range 0 - 255. |
static int |
signedToInt(short w)
Converts a short in the range of -32768 to 32767 to an int in the range 0 - 65535. |
static long |
signedToLong(int x)
Convert an int in the range of -2147483648 to 2147483647 to a long in the range 0 to 4294967295. |
static int |
wordToByte(int w)
Converts an int in the range of 0 - 65535 to an int in the range of 0 - 255. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final transient float TWO_PI
public static final transient double TWO_PI_D
public static final transient float HALF_PI
public static final transient double HALF_PI_D
public static final double EQUIVALENT_TOLERANCE
Method Detail |
---|
public static final boolean approximately_equal(double a, double b, double epsilon)
a
- doubleb
- doubleepsilon
- the allowable error
public static final boolean approximately_equal(double a, double b)
a
- doubleb
- double
public static final boolean approximately_equal(float a, float b, float epsilon)
a
- floatb
- floatepsilon
- the allowable error
public static final float asinh(float x)
Hyperbolic arc sine: log (x+sqrt(1+x^2))
x
- float
public static final double asinh(double x)
Hyperbolic arc sine: log (x+sqrt(1+x^2))
x
- double
public static final int sign(short x)
x
- short
public static final int sign(int x)
x
- int
public static final int sign(long x)
x
- long
public static final int sign(float x)
x
- float
public static final int sign(double x)
x
- double
public static final boolean odd(short x)
x
- short
public static final boolean odd(int x)
x
- int
public static final boolean odd(long x)
x
- long
public static final boolean even(short x)
x
- short
public static final boolean even(int x)
x
- int
public static final boolean even(long x)
x
- long
public static final int signedToInt(byte b)
b
- (-128 <= b <= 127)
public static final int signedToInt(short w)
w
- (-32768 <= b <= 32767)
public static final long signedToLong(int x)
x
- (-2147483648 <= x <= 2147483647)
public static final int wordToByte(int w)
w
- int (0 <= w <= 65535)
public static final short BuildShortBE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offset
public static final short BuildShortLE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offset
public static final short BuildShort(byte[] bytevec, int offset, boolean MSBFirst)
bytevec
- bytesoffset
- byte offsetMSBFirst
- BE or LE?
public static final short BuildShortBE(byte[] bytevec, boolean MSBFirst)
bytevec
- bytesMSBFirst
- BE or LE?
public static final short BuildShortLE(byte[] bytevec, boolean MSBFirst)
bytevec
- bytesMSBFirst
- BE or LE?
public static final short BuildShort(byte[] bytevec, boolean MSBFirst)
bytevec
- bytesMSBFirst
- BE or LE?
public static final int BuildIntegerBE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offset
public static final int BuildIntegerLE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offset
public static final int BuildInteger(byte[] bytevec, int offset, boolean MSBFirst)
bytevec
- bytesoffset
- byte offsetMSBFirst
- BE or LE?
public static final int BuildIntegerBE(byte[] bytevec)
bytevec
- bytes
public static final int BuildIntegerLE(byte[] bytevec)
bytevec
- bytes
public static final int BuildInteger(byte[] bytevec, boolean MSBFirst)
bytevec
- bytesMSBFirst
- BE or LE?
public static final long BuildLongBE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offset
public static final long BuildLongLE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offset
public static final long BuildLong(byte[] bytevec, int offset, boolean MSBFirst)
bytevec
- bytesoffset
- byte offsetMSBFirst
- BE or LE?
public static final long BuildLongBE(byte[] bytevec)
bytevec
- bytes
public static final long BuildLongLE(byte[] bytevec)
bytevec
- bytes
public static final long BuildLong(byte[] bytevec, boolean MSBFirst)
bytevec
- bytesMSBFirst
- BE or LE?
public static double latJLT90(double val)
val
- lat value to test
public static double justLessThan(double val, double lessThan, double howMuchLess)
val
- value to testlessThan
- abs value to test againsthowMuchLess
- how much to move val to zero based on comparison to
less than
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |