public class MoreMath
extends java.lang.Object
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
Modifier and Type | Field and Description |
---|---|
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
|
Modifier and Type | Method and Description |
---|---|
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 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 double |
sinh(double x)
Hyperbolic sin.
|
static float |
sinh(float x)
Hyperbolic sin.
|
static int |
wordToByte(int w)
Converts an int in the range of 0 - 65535 to an int in the
range of 0 - 255.
|
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
public static final boolean approximately_equal(double a, double b, double epsilon)
a
- doubleb
- doubleepsilon
- the allowable errorpublic static final boolean approximately_equal(double a, double b)
a
- doubleb
- doublepublic static final boolean approximately_equal(float a, float b, float epsilon)
a
- floatb
- floatepsilon
- the allowable errorpublic static final float asinh(float x)
Hyperbolic arc sine: log (x+sqrt(1+x^2))
x
- floatpublic static final double asinh(double x)
Hyperbolic arc sine: log (x+sqrt(1+x^2))
x
- doublepublic static final float sinh(float x)
Hyperbolic sine: (e^x-e^-x)/2
x
- floatpublic static final double sinh(double x)
Hyperbolic sine: (e^x-e^-x)/2
x
- doublepublic static final int sign(short x)
x
- shortpublic static final int sign(int x)
x
- intpublic static final int sign(long x)
x
- longpublic static final int sign(float x)
x
- floatpublic static final int sign(double x)
x
- doublepublic static final boolean odd(short x)
x
- shortpublic static final boolean odd(int x)
x
- intpublic static final boolean odd(long x)
x
- longpublic static final boolean even(short x)
x
- shortpublic static final boolean even(int x)
x
- intpublic static final boolean even(long x)
x
- longpublic 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 offsetpublic static final short BuildShortLE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offsetpublic 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 offsetpublic static final int BuildIntegerLE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offsetpublic 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
- bytespublic static final int BuildIntegerLE(byte[] bytevec)
bytevec
- bytespublic 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 offsetpublic static final long BuildLongLE(byte[] bytevec, int offset)
bytevec
- bytesoffset
- byte offsetpublic 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
- bytespublic static final long BuildLongLE(byte[] bytevec)
bytevec
- bytespublic static final long BuildLong(byte[] bytevec, boolean MSBFirst)
bytevec
- bytesMSBFirst
- BE or LE?Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details