Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.geom

Class AffineTransform

java.lang.Object
|
+--java.awt.geom.AffineTransform

All Implemented Interfaces:

Cloneable, Serializable


public class AffineTransform

extends Object

implements Cloneable, Serializable

This class represents an affine transformation between two coordinate spaces in 2 dimensions. Such a transform preserves the "straightness" and "parallelness" of lines. The transform is built from a sequence of translations, scales, flips, rotations, and shears.

The transformation can be represented using matrix math on a 3x3 array. Given (x,y), the transformation (x',y') can be found by:

 [ x']   [ m00 m01 m02 ] [ x ]   [ m00*x + m01*y + m02 ]
 [ y'] = [ m10 m11 m12 ] [ y ] = [ m10*x + m11*y + m12 ]
 [ 1 ]   [  0   0   1  ] [ 1 ]   [          1          ]
 
The bottom row of the matrix is constant, so a transform can be uniquely represented (as in toString) by "[[m00, m01, m02], [m10, m11, m12]]".

Since:Authors:

Field Summary

static intTYPE_FLIP

The transformation includes a flip about an axis, swapping between right-handed and left-handed coordinate systems.
static intTYPE_GENERAL_ROTATION

The transformation includes a rotation by an arbitrary angle.
static intTYPE_GENERAL_SCALE

The transformation includes a general scale - length is scaled in either or both the x and y directions, but by different amounts; without affecting angles.
static intTYPE_GENERAL_TRANSFORM

The transformation is an arbitrary conversion of coordinates which could not be decomposed into the other TYPEs.
static intTYPE_IDENTITY

The transformation is the identity (x' = x, y' = y).
static intTYPE_MASK_ROTATION

This constant checks if either variety of rotation is performed.
static intTYPE_MASK_SCALE

This constant checks if either variety of scale transform is performed.
static intTYPE_QUADRANT_ROTATION

The transformation includes a rotation of a multiple of 90 degrees (PI/2 radians).
static intTYPE_TRANSLATION

The transformation includes a translation - shifting in the x or y direction without changing length or angles.
static intTYPE_UNIFORM_SCALE

The transformation includes a uniform scale - length is scaled in both the x and y directions by the same amount, without affecting angles.

Constructor Summary

AffineTransform()

Construct a new identity transform:
 [ 1 0 0 ]
 [ 0 1 0 ]
 [ 0 0 1 ]
 
AffineTransform(java.awt.geom.AffineTransform tx)

Create a new transform which copies the given one.
AffineTransform(float m00, float m10, float m01, float m11, float m02, float m12)

Construct a transform with the given matrix entries:
 [ m00 m01 m02 ]
 [ m10 m11 m12 ]
 [  0   0   1  ]
 
AffineTransform(float[] f)

Construct a transform from a sequence of float entries.
AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12)

Construct a transform with the given matrix entries:
 [ m00 m01 m02 ]
 [ m10 m11 m12 ]
 [  0   0   1  ]
 
AffineTransform(double[] d)

Construct a transform from a sequence of double entries.

Method Summary

java.lang.Objectclone()

Create a new transform of the same run-time type, with the same transforming properties as this one.
voidconcatenate(java.awt.geom.AffineTransform tx)

Set this transform to the result of performing the original version of this followed by tx.
java.awt.geom.AffineTransformcreateInverse()

Returns a transform, which if concatenated to this one, will result in the identity transform.
java.awt.ShapecreateTransformedShape(java.awt.Shape src)

Return a new Shape, based on the given one, where the path of the shape has been transformed by this transform.
java.awt.geom.Point2DdeltaTransform(java.awt.geom.Point2D src, java.awt.geom.Point2D dst)

Perform this transformation, less any translation, on the given source point, and store the result in the destination (creating it if necessary).
voiddeltaTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int num)

Perform this transformation, less any translation, on an array of points, in (x,y) pairs, storing the results in another (possibly same) array.
booleanequals(java.lang.Object obj)

Compares two transforms for equality.
doublegetDeterminant()

Return the determinant of this transform matrix.
voidgetMatrix(double[] d)

Return the matrix of values used in this transform.
static java.awt.geom.AffineTransformgetRotateInstance(double theta)

Returns a rotation transform.
static java.awt.geom.AffineTransformgetRotateInstance(double theta, double x, double y)

Returns a rotation transform about a point.
static java.awt.geom.AffineTransformgetScaleInstance(double sx, double sy)

Returns a scaling transform:
 [ sx 0  0 ]
 [ 0  sy 0 ]
 [ 0  0  1 ]
 
doublegetScaleX()

Returns the X coordinate scaling factor of the matrix.
doublegetScaleY()

Returns the Y coordinate scaling factor of the matrix.
static java.awt.geom.AffineTransformgetShearInstance(double shx, double shy)

Returns a shearing transform (points are shifted in the x direction based on a factor of their y coordinate, and in the y direction as a factor of their x coordinate):
 [  1  shx 0 ]
 [ shy  1  0 ]
 [  0   0  1 ]
 
doublegetShearX()

Returns the X coordinate shearing factor of the matrix.
doublegetShearY()

Returns the Y coordinate shearing factor of the matrix.
static java.awt.geom.AffineTransformgetTranslateInstance(double tx, double ty)

Returns a translation transform:
 [ 1 0 tx ]
 [ 0 1 ty ]
 [ 0 0 1  ]
 
doublegetTranslateX()

Returns the X coordinate translation factor of the matrix.
doublegetTranslateY()

Returns the Y coordinate translation factor of the matrix.
intgetType()

Returns the type of this transform.
inthashCode()

Return the hashcode for this transformation.
java.awt.geom.Point2DinverseTransform(java.awt.geom.Point2D src, java.awt.geom.Point2D dst)

Perform the inverse of this transformation on the given source point, and store the result in the destination (creating it if necessary).
voidinverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int num)

Perform the inverse of this transformation on an array of points, in (x,y) pairs, storing the results in another (possibly same) array.
booleanisIdentity()

Tests if this transformation is the identity:
 [ 1 0 0 ]
 [ 0 1 0 ]
 [ 0 0 1 ]
 
voidpreConcatenate(java.awt.geom.AffineTransform tx)

Set this transform to the result of performing tx followed by the original version of this.
voidrotate(double theta)

Concatenate a rotation onto this transform.
voidrotate(double theta, double x, double y)

Concatenate a rotation about a point onto this transform.
voidscale(double sx, double sy)

Concatenate a scale onto this transform.
voidsetToIdentity()

Reset this transform to the identity (no transformation):
 [ 1 0 0 ]
 [ 0 1 0 ]
 [ 0 0 1 ]
 
voidsetToRotation(double theta)

Set this transform to a rotation.
voidsetToRotation(double theta, double x, double y)

Set this transform to a rotation about a point.
voidsetToScale(double sx, double sy)

Set this transform to a scale:
 [ sx 0  0 ]
 [ 0  sy 0 ]
 [ 0  0  1 ]
 
voidsetToShear(double shx, double shy)

Set this transform to a shear (points are shifted in the x direction based on a factor of their y coordinate, and in the y direction as a factor of their x coordinate):
 [  1  shx 0 ]
 [ shy  1  0 ]
 [  0   0  1 ]
 
voidsetToTranslation(double tx, double ty)

Set this transform to a translation:
 [ 1 0 tx ]
 [ 0 1 ty ]
 [ 0 0 1  ]
 
voidsetTransform(java.awt.geom.AffineTransform tx)

Set this transform to a copy of the given one.
voidsetTransform(double m00, double m10, double m01, double m11, double m02, double m12)

Set this transform to the given values:
 [ m00 m01 m02 ]
 [ m10 m11 m12 ]
 [  0   0   1  ]
 
voidshear(double shx, double shy)

Concatenate a shearing onto this transform.
java.lang.StringtoString()

Returns a string representation of the transform, in the format: "AffineTransform[[" + m00 + ", " + m01 + ", " + m02 + "], [" + m10 + ", " + m11 + ", " + m12 + "]]".
java.awt.geom.Point2Dtransform(java.awt.geom.Point2D src, java.awt.geom.Point2D dst)

Perform this transformation on the given source point, and store the result in the destination (creating it if necessary).
voidtransform(java.awt.geom.Point2D src, int srcOff, java.awt.geom.Point2D dst, int dstOff, int num)

Perform this transformation on an array of points, storing the results in another (possibly same) array.
voidtransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num)

Perform this transformation on an array of points, in (x,y) pairs, storing the results in another (possibly same) array.
voidtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int num)

Perform this transformation on an array of points, in (x,y) pairs, storing the results in another (possibly same) array.
voidtransform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int num)

Perform this transformation on an array of points, in (x,y) pairs, storing the results in another array.
voidtransform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int num)

Perform this transformation on an array of points, in (x,y) pairs, storing the results in another array.
voidtranslate(double tx, double ty)

Concatenate a translation onto this transform.

Field Details

TYPE_FLIP

public static final int TYPE_FLIP

The transformation includes a flip about an axis, swapping between right-handed and left-handed coordinate systems. In a right-handed system, the positive x-axis rotates counter-clockwise to the positive y-axis; in a left-handed system it rotates clockwise.

See Also:


TYPE_GENERAL_ROTATION

public static final int TYPE_GENERAL_ROTATION

The transformation includes a rotation by an arbitrary angle. Angles are rotated, but length is preserved. This is mutually exclusive with TYPE_QUADRANT_ROTATION.

See Also:


TYPE_GENERAL_SCALE

public static final int TYPE_GENERAL_SCALE

The transformation includes a general scale - length is scaled in either or both the x and y directions, but by different amounts; without affecting angles. This is mutually exclusive with TYPE_UNIFORM_SCALE.

See Also:


TYPE_GENERAL_TRANSFORM

public static final int TYPE_GENERAL_TRANSFORM

The transformation is an arbitrary conversion of coordinates which could not be decomposed into the other TYPEs.

See Also:


TYPE_IDENTITY

public static final int TYPE_IDENTITY

The transformation is the identity (x' = x, y' = y). All other transforms have either a combination of the appropriate transform flag bits for their type, or the type GENERAL_TRANSFORM.

See Also:


TYPE_MASK_ROTATION

public static final int TYPE_MASK_ROTATION

This constant checks if either variety of rotation is performed.

See Also:


TYPE_MASK_SCALE

public static final int TYPE_MASK_SCALE

This constant checks if either variety of scale transform is performed.

See Also:


TYPE_QUADRANT_ROTATION

public static final int TYPE_QUADRANT_ROTATION

The transformation includes a rotation of a multiple of 90 degrees (PI/2 radians). Angles are rotated, but length is preserved. This is mutually exclusive with TYPE_GENERAL_ROTATION.

See Also:


TYPE_TRANSLATION

public static final int TYPE_TRANSLATION

The transformation includes a translation - shifting in the x or y direction without changing length or angles.

See Also:


TYPE_UNIFORM_SCALE

public static final int TYPE_UNIFORM_SCALE

The transformation includes a uniform scale - length is scaled in both the x and y directions by the same amount, without affecting angles. This is mutually exclusive with TYPE_GENERAL_SCALE.

See Also:


Constructor Details

AffineTransform

public AffineTransform()

Construct a new identity transform:
 [ 1 0 0 ]
 [ 0 1 0 ]
 [ 0 0 1 ]
 


AffineTransform

public AffineTransform(double[] d)

Construct a transform from a sequence of double entries. The array must have at least 4 entries, which has a translation factor of 0; or 6 entries, for specifying all parameters:
 [ d[0] d[2] (d[4]) ]
 [ d[1] d[3] (d[5]) ]
 [  0     0    1    ]
 

Parameters:

Throws:


AffineTransform

public AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12)

Construct a transform with the given matrix entries:
 [ m00 m01 m02 ]
 [ m10 m11 m12 ]
 [  0   0   1  ]
 

Parameters:


AffineTransform

public AffineTransform(float[] f)

Construct a transform from a sequence of float entries. The array must have at least 4 entries, which has a translation factor of 0; or 6 entries, for specifying all parameters:
 [ f[0] f[2] (f[4]) ]
 [ f[1] f[3] (f[5]) ]
 [  0     0    1    ]
 

Parameters:

Throws:


AffineTransform

public AffineTransform(float m00, float m10, float m01, float m11, float m02, float m12)

Construct a transform with the given matrix entries:
 [ m00 m01 m02 ]
 [ m10 m11 m12 ]
 [  0   0   1  ]
 

Parameters:


AffineTransform

public AffineTransform(java.awt.geom.AffineTransform tx)

Create a new transform which copies the given one.

Parameters:

Throws:


Method Details

clone

public Object clone()

Create a new transform of the same run-time type, with the same transforming properties as this one.

Returns:


concatenate

public void concatenate(java.awt.geom.AffineTransform tx)

Set this transform to the result of performing the original version of this followed by tx. This is commonly used when chaining transformations from one space to another. In matrix form:
 [ this ] = [ this ] x [ tx ]
 

Parameters:

Throws:

See Also:


createInverse

public AffineTransform createInverse()

Returns a transform, which if concatenated to this one, will result in the identity transform. This is useful for undoing transformations, but is only possible if the original transform has an inverse (ie. does not map multiple points to the same line or point). A transform exists only if getDeterminant() has a non-zero value.

Returns:

Throws:

See Also:


createTransformedShape

public Shape createTransformedShape(java.awt.Shape src)

Return a new Shape, based on the given one, where the path of the shape has been transformed by this transform. Notice that this uses GeneralPath, which only stores points in float precision.

Parameters:

Returns:

Throws:

See Also:


deltaTransform

public void deltaTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int num)

Perform this transformation, less any translation, on an array of points, in (x,y) pairs, storing the results in another (possibly same) array. This will not create a destination array. All sources are copied before the transformation, so that no result will overwrite a point that has not yet been evaluated. The reduced transform is equivalent to:
 [ x' ] = [ m00 m01 ] [ x ] = [ m00 * x + m01 * y ]
 [ y' ]   [ m10 m11 ] [ y ] = [ m10 * x + m11 * y ]
 

Parameters:

Throws:


deltaTransform

public Point2D deltaTransform(java.awt.geom.Point2D src, java.awt.geom.Point2D dst)

Perform this transformation, less any translation, on the given source point, and store the result in the destination (creating it if necessary). It is safe for src and dst to be the same. The reduced transform is equivalent to:
 [ x' ] = [ m00 m01 ] [ x ] = [ m00 * x + m01 * y ]
 [ y' ]   [ m10 m11 ] [ y ] = [ m10 * x + m11 * y ]
 

Parameters:

Returns:

Throws:


equals

public boolean equals(java.lang.Object obj)

Compares two transforms for equality. This returns true if they have the same matrix values.

Parameters:

Returns:


getDeterminant

public double getDeterminant()

Return the determinant of this transform matrix. If the determinant is non-zero, the transform is invertible; otherwise operations which require an inverse throw a NoninvertibleTransformException. A result very near zero, due to rounding errors, may indicate that inversion results do not carry enough precision to be meaningful.

If this is a uniform scale transformation, the determinant also represents the squared value of the scale. Otherwise, it carries little additional meaning. The determinant is calculated as:

 | m00 m01 m02 |
 | m10 m11 m12 | = m00 * m11 - m01 * m10
 |  0   0   1  |
 

Returns:

See Also:


getMatrix

public void getMatrix(double[] d)

Return the matrix of values used in this transform. If the matrix has fewer than 6 entries, only the scale and shear factors are returned; otherwise the translation factors are copied as well. The resulting values are:
 [ d[0] d[2] (d[4]) ]
 [ d[1] d[3] (d[5]) ]
 [  0     0    1    ]
 

Parameters:

Throws:


getRotateInstance

public static AffineTransform getRotateInstance(double theta)

Returns a rotation transform. A positive angle (in radians) rotates the positive x-axis to the positive y-axis:
 [ cos(theta) -sin(theta) 0 ]
 [ sin(theta)  cos(theta) 0 ]
 [     0           0      1 ]
 

Parameters:

Returns:


getRotateInstance

public static AffineTransform getRotateInstance(double theta, double x, double y)

Returns a rotation transform about a point. A positive angle (in radians) rotates the positive x-axis to the positive y-axis. This is the same as calling:
 AffineTransform tx = new AffineTransform();
 tx.setToTranslation(x, y);
 tx.rotate(theta);
 tx.translate(-x, -y);
 

The resulting matrix is:

 [ cos(theta) -sin(theta) x-x*cos+y*sin ]
 [ sin(theta)  cos(theta) y-x*sin-y*cos ]
 [     0           0            1       ]
 

Parameters:

Returns:


getScaleInstance

public static AffineTransform getScaleInstance(double sx, double sy)

Returns a scaling transform:
 [ sx 0  0 ]
 [ 0  sy 0 ]
 [ 0  0  1 ]
 

Parameters:

Returns:


getScaleX

public double getScaleX()

Returns the X coordinate scaling factor of the matrix.

Returns:

See Also:


getScaleY

public double getScaleY()

Returns the Y coordinate scaling factor of the matrix.

Returns:

See Also:


getShearInstance

public static AffineTransform getShearInstance(double shx, double shy)

Returns a shearing transform (points are shifted in the x direction based on a factor of their y coordinate, and in the y direction as a factor of their x coordinate):
 [  1  shx 0 ]
 [ shy  1  0 ]
 [  0   0  1 ]
 

Parameters:

Returns:


getShearX

public double getShearX()

Returns the X coordinate shearing factor of the matrix.

Returns:

See Also:


getShearY

public double getShearY()

Returns the Y coordinate shearing factor of the matrix.

Returns:

See Also:


getTranslateInstance

public static AffineTransform getTranslateInstance(double tx, double ty)

Returns a translation transform:
 [ 1 0 tx ]
 [ 0 1 ty ]
 [ 0 0 1  ]
 

Parameters:

Returns:


getTranslateX

public double getTranslateX()

Returns the X coordinate translation factor of the matrix.

Returns:

See Also:


getTranslateY

public double getTranslateY()

Returns the Y coordinate translation factor of the matrix.

Returns:

See Also:


getType

public int getType()

Returns the type of this transform. The result is always valid, although it may not be the simplest interpretation (in other words, there are sequences of transforms which reduce to something simpler, which this does not always detect). The result is either TYPE_GENERAL_TRANSFORM, or a bit-wise combination of TYPE_TRANSLATION, the mutually exclusive TYPE_*_ROTATIONs, and the mutually exclusive TYPE_*_SCALEs.

See Also:


hashCode

public int hashCode()

Return the hashcode for this transformation. The formula is not documented, but appears to be the same as:
 long l = Double.doubleToLongBits(getScaleX());
 l = l * 31 + Double.doubleToLongBits(getShearY());
 l = l * 31 + Double.doubleToLongBits(getShearX());
 l = l * 31 + Double.doubleToLongBits(getScaleY());
 l = l * 31 + Double.doubleToLongBits(getTranslateX());
 l = l * 31 + Double.doubleToLongBits(getTranslateY());
 return (int) ((l >> 32) ^ l);
 

Returns:


inverseTransform

public void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int num)

Perform the inverse of this transformation on an array of points, in (x,y) pairs, storing the results in another (possibly same) array. This will not create a destination array. All sources are copied before the transformation, so that no result will overwrite a point that has not yet been evaluated.

Parameters:

Throws:

See Also:


inverseTransform

public Point2D inverseTransform(java.awt.geom.Point2D src, java.awt.geom.Point2D dst)

Perform the inverse of this transformation on the given source point, and store the result in the destination (creating it if necessary). It is safe for src and dst to be the same.

Parameters:

Returns:

Throws:

See Also:


isIdentity

public boolean isIdentity()

Tests if this transformation is the identity:
 [ 1 0 0 ]
 [ 0 1 0 ]
 [ 0 0 1 ]
 

Returns:


preConcatenate

public void preConcatenate(java.awt.geom.AffineTransform tx)

Set this transform to the result of performing tx followed by the original version of this. This is less common than normal concatenation, but can still be used to chain transformations from one space to another. In matrix form:
 [ this ] = [ tx ] x [ this ]
 

Parameters:

Throws:

See Also:


rotate

public void rotate(double theta)

Concatenate a rotation onto this transform. This is equivalent, but more efficient than concatenate(AffineTransform.getRotateInstance(theta)).

Parameters:

See Also:


rotate

public void rotate(double theta, double x, double y)

Concatenate a rotation about a point onto this transform. This is equivalent, but more efficient than concatenate(AffineTransform.getRotateInstance(theta, x, y)).

Parameters:

See Also:


scale

public void scale(double sx, double sy)

Concatenate a scale onto this transform. This is equivalent, but more efficient than concatenate(AffineTransform.getScaleInstance(sx, sy)).

Parameters:

See Also:


setToIdentity

public void setToIdentity()

Reset this transform to the identity (no transformation):
 [ 1 0 0 ]
 [ 0 1 0 ]
 [ 0 0 1 ]
 


setToRotation

public void setToRotation(double theta)

Set this transform to a rotation. A positive angle (in radians) rotates the positive x-axis to the positive y-axis:
 [ cos(theta) -sin(theta) 0 ]
 [ sin(theta)  cos(theta) 0 ]
 [     0           0      1 ]
 

Parameters:


setToRotation

public void setToRotation(double theta, double x, double y)

Set this transform to a rotation about a point. A positive angle (in radians) rotates the positive x-axis to the positive y-axis. This is the same as calling:
 tx.setToTranslation(x, y);
 tx.rotate(theta);
 tx.translate(-x, -y);
 

The resulting matrix is:

 [ cos(theta) -sin(theta) x-x*cos+y*sin ]
 [ sin(theta)  cos(theta) y-x*sin-y*cos ]
 [     0           0            1       ]
 

Parameters:


setToScale

public void setToScale(double sx, double sy)

Set this transform to a scale:
 [ sx 0  0 ]
 [ 0  sy 0 ]
 [ 0  0  1 ]
 

Parameters:


setToShear

public void setToShear(double shx, double shy)

Set this transform to a shear (points are shifted in the x direction based on a factor of their y coordinate, and in the y direction as a factor of their x coordinate):
 [  1  shx 0 ]
 [ shy  1  0 ]
 [  0   0  1 ]
 

Parameters:


setToTranslation

public void setToTranslation(double tx, double ty)

Set this transform to a translation:
 [ 1 0 tx ]
 [ 0 1 ty ]
 [ 0 0 1  ]
 

Parameters:


setTransform

public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12)

Set this transform to the given values:
 [ m00 m01 m02 ]
 [ m10 m11 m12 ]
 [  0   0   1  ]
 

Parameters:


setTransform

public void setTransform(java.awt.geom.AffineTransform tx)

Set this transform to a copy of the given one.

Parameters:

Throws:


shear

public void shear(double shx, double shy)

Concatenate a shearing onto this transform. This is equivalent, but more efficient than concatenate(AffineTransform.getShearInstance(sx, sy)).

Parameters:

See Also:


toString

public String toString()

Returns a string representation of the transform, in the format: "AffineTransform[[" + m00 + ", " + m01 + ", " + m02 + "], [" + m10 + ", " + m11 + ", " + m12 + "]]".

Returns:


transform

public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int num)

Perform this transformation on an array of points, in (x,y) pairs, storing the results in another (possibly same) array. This will not create a destination array. All sources are copied before the transformation, so that no result will overwrite a point that has not yet been evaluated.

Parameters:

Throws:


transform

public void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int num)

Perform this transformation on an array of points, in (x,y) pairs, storing the results in another array. This will not create a destination array.

Parameters:

Throws:


transform

public void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int num)

Perform this transformation on an array of points, in (x,y) pairs, storing the results in another array. This will not create a destination array.

Parameters:

Throws:


transform

public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num)

Perform this transformation on an array of points, in (x,y) pairs, storing the results in another (possibly same) array. This will not create a destination array. All sources are copied before the transformation, so that no result will overwrite a point that has not yet been evaluated.

Parameters:

Throws:


transform

public void transform(java.awt.geom.Point2D src, int srcOff, java.awt.geom.Point2D dst, int dstOff, int num)

Perform this transformation on an array of points, storing the results in another (possibly same) array. This will not create a destination array, but will create points for the null entries of the destination. The transformation is done sequentially. While having a single source and destination point be the same is safe, you should be aware that duplicate references to the same point in the source, and having the source overlap the destination, may result in your source points changing from a previous transform before it is their turn to be evaluated.

Parameters:

Throws:


transform

public Point2D transform(java.awt.geom.Point2D src, java.awt.geom.Point2D dst)

Perform this transformation on the given source point, and store the result in the destination (creating it if necessary). It is safe for src and dst to be the same.

Parameters:

Returns:

Throws:


translate

public void translate(double tx, double ty)

Concatenate a translation onto this transform. This is equivalent, but more efficient than concatenate(AffineTransform.getTranslateInstance(tx, ty)).

Parameters:

See Also: