|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.kabeja.math.MathUtils
public class MathUtils
| Field Summary | |
|---|---|
static double |
DISTANCE_DELTA
|
| Constructor Summary | |
|---|---|
MathUtils()
|
|
| Method Summary | |
|---|---|
static double |
absoluteValue(Vector v)
Returns the absalute value (or length) of the vector |
static Vector |
addVectorToVector(Vector a,
Vector b)
|
static Vector |
crossProduct(Vector a,
Vector b)
Calculate the cross product of 2 vectors. |
static double |
distance(Point start,
Point end)
|
static double |
getAngle(Vector a,
Vector b)
Calculate the angle between vector a vector b |
static double |
getDirectionAngle(Vector v)
Returns the angle of the vector again the x-axis |
static Point |
getIntersection(Point a,
Vector u,
Point b,
Vector v)
|
static Point |
getPointOfStraightLine(Point a,
Vector direction,
double parameter)
Calculate a point of a straigt line. |
static int |
getQuadrant(double angle)
Returns the qaudrant for the given angle: 0,1,2 or 3 |
static int |
getQuadrant(Point p,
Point center)
Returns the qaudrant: 0,1,2 or 3 |
static Vector |
getVector(Point a,
Point b)
Calculate the vector from point a to point b |
static Vector |
invertDirection(Vector v)
Invert the direction of the given vector |
static double[][] |
multiplyMatrixByMatrix(double[][] a,
double[][] b)
|
static double[] |
multiplyMatrixByVector(double[][] a,
double[] v)
|
static Vector |
normalize(Vector v)
|
static Point |
rotatePointXY(Point p,
Point center,
double angle)
Rotate the given point around centerpoint with the given angle in X-Y plane. |
static double |
scalarProduct(Vector a,
Vector b)
Calculate the scalar product of vector a and vector b |
static Vector |
scaleVector(Vector a,
double scale)
Scale a vector with the given value |
static Vector |
subtractVectorByVector(Vector a,
Vector b)
Substracts a vector from other vector. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DISTANCE_DELTA
| Constructor Detail |
|---|
public MathUtils()
| Method Detail |
|---|
public static double scalarProduct(Vector a,
Vector b)
a - b -
public static double absoluteValue(Vector v)
v -
public static Vector crossProduct(Vector a,
Vector b)
a - b -
public static Vector scaleVector(Vector a,
double scale)
a - the vectorscale - the value to scale
public static Point getPointOfStraightLine(Point a,
Vector direction,
double parameter)
a - the startpoint of the straight linedirection - the direction vector of the straight lineparameter - the parameter
public static Vector getVector(Point a,
Point b)
a - b -
public static Point getIntersection(Point a,
Vector u,
Point b,
Vector v)
public static double distance(Point start,
Point end)
public static double getAngle(Vector a,
Vector b)
a - b -
public static Point rotatePointXY(Point p,
Point center,
double angle)
p - the point to rotatecenter - the centerpointangle - in radian
public static Vector normalize(Vector v)
public static int getQuadrant(Point p,
Point center)
p - center -
public static int getQuadrant(double angle)
angle - in degree
public static double getDirectionAngle(Vector v)
v - the vector
public static Vector invertDirection(Vector v)
the - vector to invert
public static double[][] multiplyMatrixByMatrix(double[][] a,
double[][] b)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static double[] multiplyMatrixByVector(double[][] a,
double[] v)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static Vector subtractVectorByVector(Vector a,
Vector b)
a - the minuendb - the subtrahend
public static Vector addVectorToVector(Vector a,
Vector b)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||