Class Transform

java.lang.Object
  extended by Transform

public class Transform
extends java.lang.Object

Represents a transformation of points, using an internal matrix.


Field Summary
static Transform IDENTITY
          Represents the identity transformation, in which points are transformed into themselves.
 
Method Summary
 Transform append(Transform other)
          Returns the concatenation of two transformations, where points are first transformed by the parameter transformation, and the result is then transformed by this transformation.
static Transform create(double[] mat)
          Creates a transform with the given values in the matrix containing all 16 values in row order.
 Transform prepend(Transform other)
          Returns the concatenation of two transformations, where points are first transformed by this transformation, and the result is then transformed by the parameter transformation.
static Transform rotateX(double theta)
          Creates a transform representing rotating the given number of radians around the x-axis.
static Transform rotateY(double theta)
          Creates a transform representing rotating the given number of radians around the y-axis.
static Transform rotateZ(double theta)
          Creates a transform representing rotating the given number of radians around the z-axis.
static Transform scale(double x, double y, double z)
          Creates a transform representing scaling the x-, y-, and z-coordinates as specified.
 java.lang.String toString()
           
 Point transform(Point p)
          Returns the point resulting from transforming the given point according to this transformation.
static Transform translate(double x, double y, double z)
          Creates a transform representing the translation of coordinates by the given distances along the x-, y-, and z-axes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IDENTITY

public static final Transform IDENTITY
Represents the identity transformation, in which points are transformed into themselves.

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

append

public Transform append(Transform other)
Returns the concatenation of two transformations, where points are first transformed by the parameter transformation, and the result is then transformed by this transformation. The resulting transformation is simply the matrix product of this matrix by the parameter matrix.


prepend

public Transform prepend(Transform other)
Returns the concatenation of two transformations, where points are first transformed by this transformation, and the result is then transformed by the parameter transformation. The resulting transformation is simply the matrix product of the parameter matrix by this matrix.


transform

public Point transform(Point p)
Returns the point resulting from transforming the given point according to this transformation.


create

public static Transform create(double[] mat)
Creates a transform with the given values in the matrix containing all 16 values in row order. The parameter should be an array of 16 values, with the first four values representing the matrix's top row, and the last four values representing the matrix's bottom row.


translate

public static Transform translate(double x,
                                  double y,
                                  double z)
Creates a transform representing the translation of coordinates by the given distances along the x-, y-, and z-axes.


scale

public static Transform scale(double x,
                              double y,
                              double z)
Creates a transform representing scaling the x-, y-, and z-coordinates as specified. Depending on the parameters, this could represent stretching the coordinate system, compressing the coordinate system, or reflecting the coordinate system of an axis - or some combination thereof.


rotateX

public static Transform rotateX(double theta)
Creates a transform representing rotating the given number of radians around the x-axis.


rotateY

public static Transform rotateY(double theta)
Creates a transform representing rotating the given number of radians around the y-axis.


rotateZ

public static Transform rotateZ(double theta)
Creates a transform representing rotating the given number of radians around the z-axis.