public final class Matrix4D
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
ww |
double |
wx |
double |
wy |
double |
wz |
double |
xw |
double |
xx |
double |
xy |
double |
xz |
double |
yw |
double |
yx |
double |
yy |
double |
yz |
double |
zw |
double |
zx |
double |
zy |
double |
zz |
Constructor and Description |
---|
Matrix4D()
Create identity matrix.
|
Matrix4D(double mxx,
double mxy,
double mxz,
double mxw,
double myx,
double myy,
double myz,
double myw,
double mzx,
double mzy,
double mzz,
double mzw,
double mwx,
double mwy,
double mwz,
double mww) |
Matrix4D(Matrix4D m)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
identity()
Reset to identity
|
void |
moveBy(double x,
double y,
double z)
Move the stuff.
|
void |
moveBy(Vector3D v)
Translate the origin
|
Matrix4D |
mult(Matrix4D m)
Matrix multiplication.
|
Point3D |
mult(Point3D p)
Matrix multiplication of point.
|
Vector3D |
mult(Vector3D v)
Matrix multiplication of vector.
|
void |
multBy(Matrix4D m)
Matrix multiplication.
|
void |
multLeftBy(Matrix4D m)
Matrix multiplication from left.
|
void |
scale(double f)
Scale.
|
void |
scale(double fx,
double fy,
double fz)
Scale different in x,y,z.
|
java.lang.String |
toString()
Output
|
void |
transform(Point3D p)
Transformation of 1 point.
|
void |
transform(Point3D[] v,
int[] tx,
int[] ty,
int[] tz,
int npoints)
Transform some points.
|
void |
transform(Vector3D v)
Transformation of 1 vector.
|
void |
transformXY(Point3D p)
Transformacion de un punto considerando solo el plano horizontal
|
void |
translate(double x,
double y,
double z)
Translate the origin.
|
void |
translate(Vector3D v)
Translate the origin
|
void |
translateLeft(double x,
double y,
double z)
Translate.
|
void |
translateLeft(Vector3D v)
Translate the origin
|
void |
transponize()
Transponize.
|
void |
xrot(double theta)
Rotate theta degrees about the x axis.
|
void |
yrot(double theta)
Rotate theta degrees about the y axis.
|
void |
zrot(double theta)
Rotate theta degrees about the z axis.
|
public double xx
public double xy
public double xz
public double xw
public double yx
public double yy
public double yz
public double yw
public double zx
public double zy
public double zz
public double zw
public double wx
public double wy
public double wz
public double ww
public Matrix4D()
public Matrix4D(Matrix4D m)
m
- matrix to copypublic Matrix4D(double mxx, double mxy, double mxz, double mxw, double myx, double myy, double myz, double myw, double mzx, double mzy, double mzz, double mzw, double mwx, double mwy, double mwz, double mww)
mxx
- 1st elem in 1st rowmxy
- 2nd elem in 1st rowmxz
- 3rd elem in 1st rowmxw
- 4th elem in 1st rowmyx
- 1st elem in 2nd rowmyy
- 2nd elem in 2nd rowmyz
- 3rd elem in 2nd rowmyw
- 4th elem in 2nd rowmzx
- 1st elem in 3rd rowmzy
- 2nd elem in 3rd rowmzz
- 3rd elem in 3rd rowmzw
- 4th elem in 3rd rowmwx
- 1st elem in 4th rowmwy
- 2nd elem in 4th rowmwz
- 3rd elem in 4th rowmww
- 4th elem in 4th rowpublic void identity()
public void transponize()
public Vector3D mult(Vector3D v)
v
- vector to transformpublic void transform(Vector3D v)
v
- vector to transformpublic Point3D mult(Point3D p)
p
- point to transformpublic void transform(Point3D p)
p
- point to transformpublic void transformXY(Point3D p)
public Matrix4D mult(Matrix4D m)
m
- matrix to multiply withpublic void multBy(Matrix4D m)
m
- matrix to multply withpublic void multLeftBy(Matrix4D m)
m
- matrix to multiply with.public void translate(double x, double y, double z)
x
- translation in xy
- translation in yz
- translation in zpublic void translate(Vector3D v)
v
- translation vectorpublic void translateLeft(double x, double y, double z)
x
- translation in xy
- translation in yz
- translation in zpublic void translateLeft(Vector3D v)
v
- tranbslation vectorpublic void moveBy(double x, double y, double z)
x
- translation in xy
- translation in yz
- translation in zpublic void moveBy(Vector3D v)
v
- translation vectorpublic void yrot(double theta)
theta
- rotation angle in radpublic void xrot(double theta)
theta
- rotation angle in radpublic void zrot(double theta)
theta
- rotation angle in radpublic void scale(double f)
f
- factor to scale with.public void scale(double fx, double fy, double fz)
fx
- scaling factor in xfy
- scaling factor in yfz
- scaling factor in zpublic void transform(Point3D[] v, int[] tx, int[] ty, int[] tz, int npoints)
v
- points to transformtx
- transformed points x coordty
- transformed points y coordtz
- transformed points z coordnpoints
- nr of points to transformpublic java.lang.String toString()
toString
in class java.lang.Object