|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.math.MathUtil
public class MathUtil
Provides utility methods for various mathematical and physics operations.
API Stability: Beta; the main(String[]) method isn't staying.
Field Summary | |
---|---|
static float |
E
|
static float |
PI
|
Method Summary | |
---|---|
static float |
acos(float theta)
|
static float |
asin(float t)
|
static float |
atan(float theta)
|
static float |
atan2(float y,
float x)
|
static Vector |
calcCenterOfMass(Vector[] positions,
float[] masses)
Calculates the center of mass for a set of point masses in object space. |
static Matrix3 |
calcInertiaTensor(Vector[] positions,
float[] masses)
Calculates an inertia tensor from a set of point masses and their positions in object space. |
static float |
cos(float theta)
|
static void |
main(java.lang.String[] args)
Test method. |
static float |
sin(float t)
|
static float |
sqrt(float v)
|
static float |
tan(float theta)
|
static float |
toDegrees(float theta)
|
static float |
toRadians(float theta)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float E
public static final float PI
Method Detail |
---|
public static float sin(float t)
public static float cos(float theta)
public static float tan(float theta)
public static float asin(float t)
public static float acos(float theta)
public static float atan(float theta)
public static float atan2(float y, float x)
public static float sqrt(float v)
public static float toDegrees(float theta)
public static float toRadians(float theta)
public static Vector calcCenterOfMass(Vector[] positions, float[] masses)
positions
- the positions of the point masses.masses
- the masses of the point masses.
java.lang.IllegalArgumentException
- if positions and masses aren't the same
length or if the input arrays are empty.public static Matrix3 calcInertiaTensor(Vector[] positions, float[] masses)
positions
- the positions of the point masses.masses
- the masses of the point masses.
java.lang.IllegalArgumentException
- if positions and masses aren't the same
length or if the input arrays are empty.public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |