com.planeth.common.math
Class MatrixHelper33

java.lang.Object
  extended bycom.planeth.common.math.MatrixHelper33

public class MatrixHelper33
extends java.lang.Object

Helper for 3x3 Matrixes and the 1x3, 3x1 Vector/Matrix interpretation.

Author:
Andreas Grässer, gal@planet-h.com
created 12.01.2006

Method Summary
static Matrix createFlipXMatrix33()
          Creates a FlipMatrix (X-Achse) 3x3 [-1] [0] [0] [0] [1] [0] [0] [0] [1]
static Matrix createFlipYMatrix33()
          Creates a FlipMatrix (Y-Achse) 3x3 [1] [0] [0] [0] [-1] [0] [0] [0] [1]
static Matrix createIdentityMatrix33()
          Creates an IdentityMatrix 3x3 (E) [1][0][0] [0][1][0] [0][0][1]
static Matrix createMovementMatrix33(double movementX, double movementY)
          Creates a MovementMatrix 3x3 [1] [0] [0] [0] [1] [0] [movX][movY][1]
static Matrix createRotationMatrix33(double theta)
          Creates a RotationMatrix 3x3 [cos(th)] [sin(th)][0] [-sin(th)][cos(th)][0] [0] [0] [1]
static Matrix createScaleMatrix33(double scaleFactor)
          Creates a ScalingMatrix 3x3 [scale][0] [0] [0] [scale][0] [0] [0] [1]
static void transformVectorArrayWithMatrix33(Vector2D[] vertexes, Matrix matrix33)
          Transforms the passed vector2DArray with the passed matrix33
static void transformVectorWithMatrix33(Vector2D vector, Matrix matrix33)
          Transforms the passed vector2D with the passed matrix33
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createIdentityMatrix33

public static Matrix createIdentityMatrix33()
Creates an IdentityMatrix 3x3 (E)
 [1][0][0]
 [0][1][0]
 [0][0][1]
 

Returns:
Matrix

createMovementMatrix33

public static Matrix createMovementMatrix33(double movementX,
                                            double movementY)
Creates a MovementMatrix 3x3
 [1]   [0]   [0]
 [0]   [1]   [0]
 [movX][movY][1]
 

Parameters:
movementX -
movementY -
Returns:
Matrix

createRotationMatrix33

public static Matrix createRotationMatrix33(double theta)
Creates a RotationMatrix 3x3
 [cos(th)] [sin(th)][0]
 [-sin(th)][cos(th)][0]
 [0]       [0]      [1]
 

Parameters:
theta - rotation angle in radians
Returns:
Matrix

createScaleMatrix33

public static Matrix createScaleMatrix33(double scaleFactor)
Creates a ScalingMatrix 3x3
 [scale][0]    [0]
 [0]    [scale][0]
 [0]    [0]    [1]
 

Parameters:
scaleFactor -
Returns:
Matrix

createFlipXMatrix33

public static Matrix createFlipXMatrix33()
Creates a FlipMatrix (X-Achse) 3x3
 [-1]   [0]    [0]
 [0]    [1]    [0]
 [0]    [0]    [1]
 

Returns:
Matrix

createFlipYMatrix33

public static Matrix createFlipYMatrix33()
Creates a FlipMatrix (Y-Achse) 3x3
 [1]    [0]    [0]
 [0]    [-1]   [0]
 [0]    [0]    [1]
 

Returns:
Matrix

transformVectorWithMatrix33

public static void transformVectorWithMatrix33(Vector2D vector,
                                               Matrix matrix33)
Transforms the passed vector2D with the passed matrix33

Parameters:
vector - the Vector to be transformed
matrix33 - the transform matrix

transformVectorArrayWithMatrix33

public static void transformVectorArrayWithMatrix33(Vector2D[] vertexes,
                                                    Matrix matrix33)
Transforms the passed vector2DArray with the passed matrix33

Parameters:
vertexes - the vertexes to be transformed
matrix33 - the transform matrix