|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.math.Mat2
Mat2 is a 2x2 matrix = < [[a, b], [c, d]] > This class stores and operates on a 2x2 matrix. Methods that begin with a capital letter modify "this", while methods that begin with a lowercase letter create a new Mat2 to store the result.
Field Summary | |
double |
a
a,b,c,d are the components of the matrix |
double |
b
a,b,c,d are the components of the matrix |
double |
c
a,b,c,d are the components of the matrix |
double |
d
a,b,c,d are the components of the matrix |
static Mat2 |
Ident
Do not modify Ident = the identity matrix |
static Mat2 |
Invalid
Do not modify Invalid = an invalid Mat2 |
static double |
tolerance
Do not modify tolerance is the per-component zero-value maximium |
static Mat2 |
Zero
Do not modify Zero = the zero matrix |
Constructor Summary | |
Mat2()
Constructs a new Mat2 = [[1, 0], [0, 1]] |
|
Mat2(double a,
double b,
double c,
double d)
Constructs a new Mat2 = [[a, b], [c, d]] |
|
Mat2(Mat2 m)
Constructs a new Mat2 = "m" |
Method Summary | |
Mat2 |
add(Mat2 m)
Returns: a new Mat2 that is the sum of "this" and "m" |
Mat2 |
Add(Mat2 m)
Adds "m" to "this" Returns: resulting "this" |
Mat2 |
addscaled(Mat2 m,
double s)
Returns: a new Mat2 that is the sum of "this" and "s*m" |
Mat2 |
AddScaled(Mat2 m,
double s)
Adds "s*m" to "this" Returns: resulting "this" |
double |
det()
Returns: the determinant of "this" |
double |
dot(Mat2 m)
Returns: the dot product of "this" and "m" |
boolean |
equals(Mat2 m)
Returns: true if "this" equals "m", false otherwise |
double |
getScale()
Returns: the geometric mean of the magnitude of the x- and y-axes of "this" used as a left-multiplying linear transform |
Mat2 |
invert()
Returns: a new Mat2 that is the inverse of "this" Requires: "this" is not singular |
Mat2 |
Invert()
Inverts "this" Returns: resulting "this" Requires: "this" is not singular |
boolean |
isOrthogonal()
|
boolean |
isOrthoNormal()
Returns: true if the x- and y-axes of "this" as a left-multiplying linear transform are orthonormal, false otherwise |
boolean |
isOrthoScaled()
Returns: true if the x- and y-axes of "this" as a left-multiplying linear transform are orthogonal and of equal magnitude, else false |
boolean |
isZero()
Returns: true if "this" is zero, false otherwise |
Vec2 |
lmul(Vec2 v)
Returns: a new Vec2 that is "v*this" |
Mat2 |
mul(Mat2 m)
Returns: a new Mat2 that is "m*this" |
Mat2 |
Mul(Mat2 m)
Multiplies "this" to the left by "m" Returns: resulting "this" |
Vec2 |
mul(Vec2 v)
Returns: a new Vec2 that is "this*v" |
Mat2 |
neg()
Returns: a new Mat2 that is the opposite of "this" |
Mat2 |
Neg()
Negates "this" Returns: resulting "this" |
Mat2 |
rmul(Mat2 m)
Returns: a new Mat2 that is "this*m" |
Mat2 |
RMul(Mat2 m)
Multiplies "this" to the right by "m" Returns: resulting "this" |
Mat2 |
scale(double s)
Returns: a new Mat2 that is "s*this" |
Mat2 |
Scale(double s)
Scales "this" by "s" Returns: resulting "this" |
Mat2 |
Set(double a,
double b,
double c,
double d)
Sets "this" to [[a, b], [c, d]]. |
Mat2 |
Set(Mat2 m)
Sets the value of "this" to that of "m" Returns: resulting "this" |
Mat2 |
SetIdent()
Sets "this" to the identity matrix. |
Mat2 |
SetZero()
Sets "this" to zero. |
Mat2 |
sub(Mat2 m)
Returns: a new Mat2 that is the difference between "this" and "m" |
Mat2 |
Sub(Mat2 m)
Subtracts "m" from "this" Returns: resulting "this" |
Vec2 |
xaxis()
Returns: a new Vec2 containing the x-axis of "this" when it is used as a linear transform left-multiplying a vector |
Vec2 |
yaxis()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public double a
public double b
public double c
public double d
public static Mat2 Zero
public static Mat2 Ident
public static Mat2 Invalid
public static double tolerance
Constructor Detail |
public Mat2()
public Mat2(Mat2 m)
public Mat2(double a, double b, double c, double d)
Method Detail |
public Mat2 Set(Mat2 m)
public Mat2 Set(double a, double b, double c, double d)
public Mat2 SetZero()
public Mat2 SetIdent()
public boolean isZero()
public boolean equals(Mat2 m)
public Mat2 Add(Mat2 m)
public Mat2 add(Mat2 m)
public Mat2 AddScaled(Mat2 m, double s)
public Mat2 addscaled(Mat2 m, double s)
public Mat2 Sub(Mat2 m)
public Mat2 sub(Mat2 m)
public Mat2 Neg()
public Mat2 neg()
public double dot(Mat2 m)
public Mat2 Scale(double s)
public Mat2 scale(double s)
public Mat2 Mul(Mat2 m)
public Mat2 mul(Mat2 m)
public Mat2 RMul(Mat2 m)
public Mat2 rmul(Mat2 m)
public Vec2 mul(Vec2 v)
public Vec2 lmul(Vec2 v)
public double det()
public Mat2 Invert()
public Mat2 invert()
public Vec2 xaxis()
public Vec2 yaxis()
public boolean isOrthogonal()
public boolean isOrthoNormal()
public boolean isOrthoScaled()
public double getScale()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |