JavaView© v3.95.000

jv.vecmath
Class PuReflect

java.lang.Object
  extended byjv.vecmath.PuReflect

public class PuReflect
extends java.lang.Object

Utility class with static methods to compute reflection and other symmetry matrices.


Constructor Summary
PuReflect()
           
 
Method Summary
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 a, PdVector normal)
          Generate a (4*4)-matrix to reflect in plane given by base point and 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.
static PdMatrix pointReflect(PdVector p)
          Generate a (4*4)-matrix to invert space w.r.t. to a given fixed point.
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 scale(PdVector vec)
          Generate a (4*4)-matrix to non-uniform scale by a given vector p[i] = p[i] * vec[i].
static PdMatrix translate(PdVector vec)
          Generate a (4*4)-matrix to translate by a given vector p = p + vec.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PuReflect

public PuReflect()
Method Detail

makeRotation

public static boolean makeRotation(PdMatrix mat,
                                   PdVector axis,
                                   double angle)
Assign a (3*3)-rotation matrix to rotate around axis through origin with given angle. Parameter mat and axis must have dimension greater or equal to three. Only first three components are used.

Parameters:
mat - Matrix to hold the transformation matrix.
axis - direction of rotation axis, need not be normalized
angle - angle in radians about to rotate
Returns:
false missing axis or problems in its normalization

getRotation

public static java.lang.Double getRotation(PdMatrix mat,
                                           PdVector axis)
Get axis and angle of a 3x3 rotation matrix.

Parameters:
mat - Matrix to hold the transformation matrix.
axis - direction of rotation axis, need not be normalized
Returns:
angle in radians about to rotate or null if error

rotateLine

public 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. 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.

Parameters:
mat - 4*4 matrix which will be filled.
base - Arbitrary point on rotation axis.
axis - Direction of rotation axis, need not be normalized
Returns:
given matrix
Since:
JavaView 2.83.000

rotateLine

public static PdMatrix rotateLine(PdVector base,
                                  PdVector axis)
Generate a (4*4)-matrix to rotate around 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

Parameters:
base - Arbitrary point on rotation axis.
axis - Direction of rotation axis, need not be normalized
Returns:
new rotation matrix

rotateLine

public 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. 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.

Parameters:
mat - 4*4 matrix which will be filled.
base - Arbitrary point on rotation axis.
axis - Direction of rotation axis, need not be normalized
angle - Angle in radians about to rotate.
Returns:
given matrix
Since:
JavaView 2.83.000

rotateLine

public static PdMatrix rotateLine(PdVector base,
                                  PdVector axis,
                                  double fi)
Generate a (4*4)-matrix to rotate around axis base+t*dir by given angle. Parameter base and axis must have dimension greater or equal to three. Only first three components are used.

Parameters:
base - Arbitrary point on rotation axis.
axis - Direction of rotation axis, need not be normalized
fi - Angle in radians about to rotate.
Returns:
Rotation matrix

planeReflect

public 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.

Parameters:
a - Point on the plane.
b - Point on the plane.
c - Point on the plane.
Returns:
Reflection matrix

planeReflect

public static PdMatrix planeReflect(PdVector a,
                                    PdVector normal)
Generate a (4*4)-matrix to reflect in plane given by base point and plane normal.

Parameters:
a - Arbitrary point on plane.
normal - Normal vector in 3D orthogonal to plane
Returns:
Reflection matrix

pointReflect

public static PdMatrix pointReflect(PdVector p)
Generate a (4*4)-matrix to invert space w.r.t. to a given fixed point.

Parameters:
p - Arbitrary 3d point as inversion center.
Returns:
Inversion matrix

translate

public static PdMatrix translate(PdVector vec)
Generate a (4*4)-matrix to translate by a given vector p = p + vec.

Parameters:
vec - Translation vector of dimension 3.
Returns:
Translation matrix

scale

public static PdMatrix scale(PdVector vec)
Generate a (4*4)-matrix to non-uniform scale by a given vector p[i] = p[i] * vec[i].

Parameters:
vec - Scaling vector of dimension 3.
Returns:
Scaling matrix

JavaView© v3.95.000

The software JavaView© is copyright protected. All Rights Reserved.