JavaView® v2.12

jv.vecmath
Class PuReflect

java.lang.Object
  |
  +--jv.vecmath.PuReflect

public class PuReflect
extends java.lang.Object

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

Version:
18.03.01, 1.20 revised (kp) Method scale added.
03.10.99, 1.10 revised (kp) Renamed from PdReflect to PuReflect.
11.07.99, 1.01 revised (kp) Included in JavaView, method mult43() moved to PdVector.
00.06.99, 1.00 created (kp) Converted from my c-code.
Author:
Konrad Polthier

Constructor Summary
PuReflect()
           
 
Method Summary
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(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

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.
Parameters:
base - Arbitrary point on rotation axis.
axis - Direction of rotation axis, need not be normalized
Returns:
Rotation matrix

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
angle - 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, - b, c Three points 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:
base - Arbitrary point on plane.
normal - Normal vector 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 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.
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.
Returns:
Scaling matrix

JavaView® v2.12

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