|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.joode.util.Math2D
public final class Math2D
Simple utility wrapping up a bunch of math operations so that the rest of the code doesn't have to look so cluttered.
| Method Summary | |
|---|---|
static Matrix2 |
abs(Matrix2 A)
Create the absolute version of a matrix |
static Vector2 |
abs(Vector2 a)
Make a vector absolute |
static void |
add(float[] A,
float[] B,
float[] res)
|
static Matrix2 |
add(Matrix2 A,
Matrix2 B)
Add two matricies |
static float |
clamp(float a,
float low,
float high)
Clamp a value |
static float |
cross(float[] A,
float[] B)
|
static Vector2 |
cross(float s,
Vector2 a)
Find the cross product of a vector and a float |
static Vector2 |
cross(Vector2 a,
float s)
Find the cross product of a vector and a float |
static float |
cross(Vector2 a,
Vector2 b)
Find the cross product of two vectors |
static float |
dot(float[] A,
float[] B)
|
static Vector2 |
getNormal(ROVector2 x,
ROVector2 y)
Get the normal of a line x y (or edge). |
static void |
mul(float[] A,
float scalar)
|
static Matrix2 |
mul(Matrix2 A,
Matrix2 B)
Multiple two matricies |
static Vector2 |
mul(Matrix2 A,
ROVector2 v)
Multiply a matrix by a vector |
static float |
norm(float[] A)
|
static void |
normalize(float[] A)
|
static Vector2 |
scale(ROVector2 a,
float scale)
Scale a vector by a given value |
static float |
sign(float x)
Check the sign of a value |
static void |
sub(float[] A,
float[] B,
float[] res)
|
static void |
sub(ROVector2 a,
ROVector2 b,
Vector2 passback)
Subtract one vector from another |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Vector2 scale(ROVector2 a,
float scale)
a - The vector to be scaledscale - The amount to scale the vector by
public static void sub(ROVector2 a,
ROVector2 b,
Vector2 passback)
a - The vector to be subtracted fromb - The vector to subtractpublic static float sign(float x)
x - The value to check
public static Vector2 mul(Matrix2 A,
ROVector2 v)
A - The matrix to be multipliedv - The vector to multiple by
public static Matrix2 mul(Matrix2 A,
Matrix2 B)
A - The first matrixB - The second matrix
public static Matrix2 abs(Matrix2 A)
A - The matrix to make absolute
public static Vector2 abs(Vector2 a)
a - The vector to make absolute
public static Matrix2 add(Matrix2 A,
Matrix2 B)
A - The first matrixB - The second matrix
public static float cross(Vector2 a,
Vector2 b)
a - The first vectorb - The second vector
public static Vector2 cross(float s,
Vector2 a)
s - The scalar floata - The vector to fidn the cross of
public static Vector2 cross(Vector2 a,
float s)
s - The scalar floata - The vector to fidn the cross of
public static float clamp(float a,
float low,
float high)
a - The original valuelow - The lower boundhigh - The upper bound
public static Vector2 getNormal(ROVector2 x,
ROVector2 y)
x - startingpoint of the liney - endpoint of the line
public static float dot(float[] A,
float[] B)
public static float cross(float[] A,
float[] B)
public static void add(float[] A,
float[] B,
float[] res)
public static void sub(float[] A,
float[] B,
float[] res)
public static void mul(float[] A,
float scalar)
public static float norm(float[] A)
public static void normalize(float[] A)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||