public class TransformUtils extends Object
| Constructor and Description |
|---|
TransformUtils()
|
| Modifier and Type | Method and Description |
|---|---|
static AffineTransform |
createAffineTransform(double oldX1, double oldY1, double oldX2, double oldY2, double oldX3, double oldY3, double newX1, double newY1, double newX2, double newY2, double newX3, double newY3)
Given 3 points, this will return the
AffineTransform that links each
initial to
final point.
|
static AffineTransform |
createAffineTransform(Point2D
Given 3 points, this will return the
AffineTransform that links each
initial to
final point.
|
static AffineTransform |
createAffineTransform(Rectangle2D
This will return the
AffineTransform that maps one rectangle onto another.
|
static double |
getRotationAngle(AffineTransform
Compute the rotation angle of an affine transformation.
|
static AffineTransform |
tween(AffineTransform
Transitions from one AffineTransform to another.
|
public static double getRotationAngle(AffineTransformtransform)
transform - the AffineTransform to analyze.
public static AffineTransformcreateAffineTransform(Point2D initialP1, Point2D initialP2, Point2D initialP3, Point2D finalP1, Point2D finalP2, Point2D finalP3)
AffineTransform that links each
initial to
final point.
This uses the solve(matrix,true) method.
initialP1 - the point that transforms into finalP1
initialP2 - the point that transforms into finalP2
initialP3 - the point that transforms into finalP3
finalP1 - the point that originated at initialP1
finalP2 - the point that originated at initialP2
finalP3 - the point that originated at initialP3
public static AffineTransformcreateAffineTransform(Rectangle2D r1, Rectangle2D r2)
AffineTransform that maps one rectangle onto another.
This uses the solve(matrix,true) method.
r1 - the rectangle that transforms into r2
r2 - the rectangle that originated at r1
public static AffineTransformcreateAffineTransform(double oldX1, double oldY1, double oldX2, double oldY2, double oldX3, double oldY3, double newX1, double newY1, double newX2, double newY2, double newX3, double newY3)
AffineTransform that links each
initial to
final point.
This uses the solve(matrix,true) method.
oldX1 - the x-coordinate of the untransformed first point
oldY1 - the y-coordinate of the untransformed first point
oldX2 - the x-coordinate of the untransformed second point
oldY2 - the y-coordinate of the untransformed second point
oldX3 - the x-coordinate of the untransformed third point
oldY3 - the y-coordinate of the untransformed third point
newX1 - the x-coordinate of the transformed first point
newY1 - the y-coordinate of the transformed first point
newX2 - the x-coordinate of the transformed second point
newY2 - the y-coordinate of the transformed second point
newX3 - the x-coordinate of the transformed third point
newY3 - the y-coordinate of the transformed third point
public static AffineTransformtween(AffineTransform a, AffineTransform b, float progress, boolean createNewObject)
a - the initial AffineTransform
b - the final AffineTransform
progress - a float between zero and one, where zero represents
a and one represents
b. Values outside this range will not throw an exception, but they will make some funky results.
createNewObject - indicates whether a new AffineTransform should be constructed, or if one of the arguments can be used to store the results
a and
b.