woSource.math
Class MathI
java.lang.Object
|
+--woSource.math.MathI
- public class MathI
- extends java.lang.Object
WO class of basic math operations
|
Field Summary |
static double |
PI
|
static int |
X
|
static int |
Y
|
static int |
Z
|
|
Constructor Summary |
MathI()
|
|
Method Summary |
static double |
abs(double x)
|
static float |
abs(float x)
|
static int |
abs(int x)
|
static double |
acos(double theta)
|
static float |
acos(float theta)
|
static double |
asin(double theta)
|
static float |
asin(float theta)
|
static double |
atan(double theta)
|
static float |
atan(float theta)
|
static double |
cos(double theta)
|
static float |
cos(float theta)
|
static double |
cube(double x)
|
static float |
cube(float x)
|
static int |
cube(int x)
|
static double |
cubic_rt(double a1,
double a2,
double a3)
|
static float |
cubic_rt(float a1,
float a2,
float a3)
function to calc the three solutions to the cubic equation:
x*x*x + a1*x*x + a2*x + a3 = 0
since two solutions may be imaginary, set up a dmatrix {3x2} (each
solution, real and imag parts) to hold the solution values
returns only the largest real root |
static double |
cubrt(double x)
lame java math lib doesn't have cube root |
static float |
cubrt(float x)
|
static double |
exp(double x)
|
static float |
exp(float x)
|
static int |
Int(double x)
|
static int |
Int(float x)
the default (int) function simply truncates any decimal
points: (int)(1.9) = 1. |
static double |
ln(double x)
|
static float |
ln(float x)
|
static double |
log(double x)
|
static float |
log(float x)
|
static double |
log10(double x)
lame java math lib doesn't even have log_base_10 |
static float |
log10(float x)
|
static double |
max(double x,
double y)
|
static float |
max(float x,
float y)
|
static float |
max(float x,
float y,
float z)
|
static int |
max(int x,
int y)
|
static int |
max(int x,
int y,
int z)
|
static double |
min(double x,
double y)
|
static float |
min(float x,
float y)
|
static float |
min(float x,
float y,
float z)
|
static int |
min(int x,
int y)
|
static int |
min(int x,
int y,
int z)
|
static int |
rem(int x,
int y)
|
static double |
sin(double theta)
|
static float |
sin(float theta)
|
static double |
sqr(double x)
|
static float |
sqr(float x)
|
static int |
sqr(int x)
|
static double |
sqrt(double x)
math does not have float version |
static float |
sqrt(float x)
|
static double |
tan(double theta)
|
static float |
tan(float theta)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
X
public static final int X
Y
public static final int Y
Z
public static final int Z
PI
public static final double PI
MathI
public MathI()
abs
public static double abs(double x)
abs
public static float abs(float x)
abs
public static int abs(int x)
rem
public static int rem(int x,
int y)
sin
public static double sin(double theta)
sin
public static float sin(float theta)
cos
public static double cos(double theta)
cos
public static float cos(float theta)
tan
public static double tan(double theta)
tan
public static float tan(float theta)
asin
public static double asin(double theta)
asin
public static float asin(float theta)
acos
public static double acos(double theta)
acos
public static float acos(float theta)
atan
public static double atan(double theta)
atan
public static float atan(float theta)
max
public static int max(int x,
int y)
max
public static float max(float x,
float y)
max
public static double max(double x,
double y)
max
public static float max(float x,
float y,
float z)
min
public static float min(float x,
float y,
float z)
max
public static int max(int x,
int y,
int z)
min
public static int min(int x,
int y,
int z)
min
public static int min(int x,
int y)
min
public static float min(float x,
float y)
min
public static double min(double x,
double y)
exp
public static double exp(double x)
exp
public static float exp(float x)
log
public static double log(double x)
log
public static float log(float x)
ln
public static double ln(double x)
ln
public static float ln(float x)
Int
public static int Int(float x)
- the default (int) function simply truncates any decimal
points: (int)(1.9) = 1. This function rounds to nearest int
Int
public static int Int(double x)
sqr
public static double sqr(double x)
sqr
public static float sqr(float x)
sqr
public static int sqr(int x)
cube
public static double cube(double x)
cube
public static float cube(float x)
cube
public static int cube(int x)
sqrt
public static double sqrt(double x)
- math does not have float version
sqrt
public static float sqrt(float x)
cubrt
public static double cubrt(double x)
- lame java math lib doesn't have cube root
cubrt
public static float cubrt(float x)
log10
public static double log10(double x)
- lame java math lib doesn't even have log_base_10
log10
public static float log10(float x)
cubic_rt
public static float cubic_rt(float a1,
float a2,
float a3)
- function to calc the three solutions to the cubic equation:
x*x*x + a1*x*x + a2*x + a3 = 0
since two solutions may be imaginary, set up a dmatrix {3x2} (each
solution, real and imag parts) to hold the solution values
returns only the largest real root
cubic_rt
public static double cubic_rt(double a1,
double a2,
double a3)