public class PuReflect
extends java.lang.Object
Most matrices are intended to work with homogenous coordinate representations, that means, the matrix of dimension (dim+1)*(dim+1) is later applied to points in ambient dim-space. See also the classes PdVector and PdMatrix which provide homogenous linear algebra multiplications.
Constructor and Description |
---|
PuReflect() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Double |
getRotation(PdMatrix mat,
PdVector axis)
Get axis and angle of a 3x3 rotation matrix.
|
static boolean |
makeRotation(PdMatrix mat,
PdVector axis,
double angle)
Assign a (3*3)-rotation matrix to rotate around axis through origin with given angle.
|
static PdMatrix |
planeReflect(PdVector base,
PdVector normal)
Generate a (dim+1)*(dim+1)-matrix to reflect in plane determined by a base point and a plane normal.
|
static PdMatrix |
planeReflect(PdVector a,
PdVector b,
PdVector c)
Generate a (4*4)-matrix to reflect in plane given by three vertices on the plane in R3.
|
static PdMatrix |
pointReflect(PdVector p)
Generate a (dim+1)*(dim+1)-matrix to invert space at a given center point.
|
static PdMatrix |
rotate(PdMatrix mat,
double angle,
int indI,
int indJ)
Generate a homogeneous matrix to rotate in the (indI,indJ)-plane around a given angle in radians (i.e.
|
static PdMatrix |
rotateLine(PdMatrix mat,
PdVector base,
PdVector axis)
Fill a given (4*4)-matrix to rotate around axis
base+t*dir by 180 degrees. |
static PdMatrix |
rotateLine(PdMatrix mat,
PdVector base,
PdVector axis,
double angle)
Fill a (4*4)-matrix to rotate around axis
base+t*dir by given angle. |
static PdMatrix |
rotateLine(PdVector base,
PdVector axis)
Generate a (4*4)-matrix to rotate around axis
base+t*dir by 180 degrees. |
static PdMatrix |
rotateLine(PdVector base,
PdVector axis,
double fi)
Generate a (4*4)-matrix to rotate around axis
base+t*dir by given angle. |
static PdMatrix |
rotateXY(double angle,
int dim)
Generate a homogeneous matrix to rotate in the XY-plane around a given angle in radians (i.e.
|
static PdMatrix |
rotateXZ(double angle,
int dim)
Generate a homogeneous matrix to rotate in the XZ-plane around a given angle in radians (i.e.
|
static PdMatrix |
rotateYZ(double angle,
int dim)
Generate a homogeneous matrix to rotate in the YZ-plane around a given angle in radians (i.e.
|
static PdMatrix |
scale(double s,
int dim)
Generate a homogeneous matrix to non-uniform scale by a given vector
p[i] = p[i]*s . |
static PdMatrix |
scale(PdVector v)
Generate a homogeneous matrix to non-uniform scale by a given vector
p[i] = p[i]*v[i] . |
static PdMatrix |
translate(PdVector v)
Generate a (dim+1)*(dim+1) matrix m to translate a point p by a given vector v:
m*p=p+v . |
public static boolean makeRotation(PdMatrix mat, PdVector axis, double angle)
mat
- Matrix to hold the transformation matrix.axis
- direction of rotation axis, need not be normalizedangle
- angle in radians about to rotatepublic static java.lang.Double getRotation(PdMatrix mat, PdVector axis)
mat
- Matrix to hold the transformation matrix.axis
- direction of rotation axis, need not be normalizedpublic static PdMatrix rotateLine(PdMatrix mat, PdVector base, PdVector axis)
base+t*dir
by 180 degrees.
Parameter base and axis must have dimension greater or equal to three. Only
first three components are used.
There are no object allocations in this method.
mat
- 4*4 matrix which will be filled.base
- Arbitrary point on rotation axis.axis
- Direction of rotation axis, need not be normalizedpublic static PdMatrix rotateLine(PdVector base, PdVector axis)
base+t*dir
by 180 degrees.
Parameter base and axis must have dimension greater or equal to three. Only
first three components are used.
Method allocates a new matrix and invokes rotateLine
base
- Arbitrary point on rotation axis.axis
- Direction of rotation axis, need not be normalizedpublic static PdMatrix rotateLine(PdMatrix mat, PdVector base, PdVector axis, double angle)
base+t*dir
by given angle.
Parameter base and axis must have dimension greater or equal to three. Only
first three components are used.
There are no object allocations in this method.
mat
- 4*4 matrix which will be filled.base
- Arbitrary point on rotation axis.axis
- Direction of rotation axis, need not be normalizedangle
- Angle in radians about to rotate.public static PdMatrix rotateLine(PdVector base, PdVector axis, double fi)
base+t*dir
by given angle.
Parameter base and axis must have dimension greater or equal to three. Only
first three components are used.base
- Arbitrary point on rotation axis.axis
- Direction of rotation axis, need not be normalizedfi
- Angle in radians about to rotate.public static PdMatrix planeReflect(PdVector a, PdVector b, PdVector c)
a
- Point on the plane.b
- Point on the plane.c
- Point on the plane.public static PdMatrix planeReflect(PdVector base, PdVector normal)
base
- Arbitrary point on plane of dimension dim.normal
- Normal vector orthonormal to plane.public static PdMatrix pointReflect(PdVector p)
p
- Arbitrary point of dimension dim as inversion center.public static PdMatrix translate(PdVector v)
m*p=p+v
.
The matrix has dimension (dim+1) if dim is the dimension of the vector.v
- Translation vector.public static PdMatrix scale(PdVector v)
p[i] = p[i]*v[i]
.
The matrix has dimension (dim+1) if dim is the dimension of the vector.v
- Scaling vector of dimension dim.public static PdMatrix scale(double s, int dim)
p[i] = p[i]*s
.
The generated matrix is a (dim+1) square matrix.s
- Scaling factor.dim
- Dimension of ambient space.public static PdMatrix rotateXY(double angle, int dim)
angle
- Angle in radians.dim
- Dimension of ambient space.public static PdMatrix rotateYZ(double angle, int dim)
angle
- Angle in radians.dim
- Dimension of ambient space.public static PdMatrix rotateXZ(double angle, int dim)
angle
- Angle in radians.dim
- Dimension of ambient space.public static PdMatrix rotate(PdMatrix mat, double angle, int indI, int indJ)
angle
- Angle in radians.indI
- Dimension of first coordinates axis which determines the plane of rotation.indJ
- Dimension of second coordinates axis which determines the plane of rotation."