|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.utility.Maths
public final class Maths
Static functions arround maths manipulation.
Method Summary | |
---|---|
static float |
curveValue(float value,
float dest,
float speed)
Apply progressive modifications to a value. |
static float |
fixBetween(float value,
float min,
float max)
Fix a value between an interleave. |
static int |
fixBetween(int value,
int min,
int max)
Fix a value between an interleave. |
static int |
getDistance(int x1,
int y1,
int x2,
int y2)
Get integer distance of two points. |
static Point2D |
intersection(java.awt.geom.Line2D l1,
java.awt.geom.Line2D l2)
Get the intersection point of two lines. |
static long |
nano()
Get the current time in nano second. |
static int |
random(int min,
int max)
Get a random value contained in specified interleave. |
static long |
time()
Get the current time in millisecond. |
static float |
wrapFloat(float value,
float min,
float max)
Wrap value (keep value bewteen min and max). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int fixBetween(int value, int min, int max)
value
- value to fix.min
- minimum value.max
- maximum value.
public static float fixBetween(float value, float min, float max)
value
- value to fix.min
- minimum value.max
- maximum value.
public static float curveValue(float value, float dest, float speed)
value
- value.dest
- value to reach.speed
- effect speed.
public static Point2D intersection(java.awt.geom.Line2D l1, java.awt.geom.Line2D l2)
l1
- first line.l2
- second line.
public static int getDistance(int x1, int y1, int x2, int y2)
x1
- point 1 x.y1
- point 1 y.x2
- point 2 x.y2
- point 2 y.
public static float wrapFloat(float value, float min, float max)
value
- input value.min
- minimum value (included).max
- maximum value (excluded).
public static int random(int min, int max)
min
- minimum value (included).max
- maximum value (included).
public static long time()
public static long nano()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |