|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcontrol.lang.Math
public class Math
Provides some simple math functions.
JControl devices are limited in computation rate and precision, so some useful mathematical functions are approximated with tables.
all |
Method Summary | |
---|---|
static int |
cos(int op)
Look-up table cosine function. |
static int |
rnd(int mod)
Returns a pseudo random number. |
static int |
scale(int value,
int source,
int dest)
Rule of proportion. |
static int |
sin(int op)
Look-up table sine function. |
static int |
sqrt(int op)
Look-up table square root. |
Methods inherited from class java.lang.Object |
---|
clone, equals, notifyAll, wait |
Method Detail |
---|
public static int cos(int op)
op
- function argument in degrees (range 0 ... 360)
public static int rnd(int mod)
mod
- the range for the random number (1...mod
-1), 0 for full 15 bit range
public static int scale(int value, int source, int dest)
y=scale(x,a,b)
is equal to y=x*b/a
.
value
- the value to scale (range -32768 ... 32767)source
- the divisor (range -32768 ... 32767)dest
- the multiplicant (range -32768 ... 32767)
public static int sin(int op)
op
- function argument in degrees (range 0 ... 360)
public static int sqrt(int op)
op
- value to extract the root from (range: 0 ... 32767)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |