com.vividsolutions.jump.warp
Class AffineTransform

java.lang.Object
  extended bycom.vividsolutions.jump.warp.CoordinateTransform
      extended bycom.vividsolutions.jump.warp.AffineTransform

public class AffineTransform
extends CoordinateTransform

An AffineTransform implementation that is initialized by specifying three points and the three points they map to.

From http://graphics.lcs.mit.edu/classes/6.837/F01/Lecture07/lecture07.pdf:

      [ x1_ ] = [  x1 y1 1  0  0  0  ] [ a11 ]
      [ y1_ ] = [  0  0  0  x1 y1 1  ] [ a12 ]
      [ x2_ ] = [  x2 y2 1  0  0  0  ] [ a13 ]
      [ y2_ ] = [  0  0  0  x2 y2 1  ] [ a21 ]
      [ x3_ ] = [  x3 y3 1  0  0  0  ] [ a22 ]
      [ y3_ ] = [  0  0  0  x3 y3 1  ] [ a23 ]
 x_ = X a
 Solution: a = Xinv x_
 


Constructor Summary
AffineTransform(com.vividsolutions.jts.geom.Coordinate p1, com.vividsolutions.jts.geom.Coordinate p1_)
          A transformation that maps p1 to p1_ via a translation (no rotation or shear).
AffineTransform(com.vividsolutions.jts.geom.Coordinate p1, com.vividsolutions.jts.geom.Coordinate p1_, com.vividsolutions.jts.geom.Coordinate p2, com.vividsolutions.jts.geom.Coordinate p2_)
          A transformation that maps p1 to p1_ and p2 to p2_ via a translation, rotation, and scaling (no "relative" shear).
AffineTransform(com.vividsolutions.jts.geom.Coordinate p1, com.vividsolutions.jts.geom.Coordinate p1_, com.vividsolutions.jts.geom.Coordinate p2, com.vividsolutions.jts.geom.Coordinate p2_, com.vividsolutions.jts.geom.Coordinate p3, com.vividsolutions.jts.geom.Coordinate p3_)
          A transformation that maps p1 to p1_, p2 to p2_ and p3 to p3_.
 
Method Summary
static com.vividsolutions.jts.geom.Coordinate rotate90(com.vividsolutions.jts.geom.Coordinate a, com.vividsolutions.jts.geom.Coordinate b)
          Determines where a point would end up if it were rotated 90 degrees about another point.
 com.vividsolutions.jts.geom.Coordinate transform(com.vividsolutions.jts.geom.Coordinate c)
          Applies the affine transform to a point.
 
Methods inherited from class com.vividsolutions.jump.warp.CoordinateTransform
transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AffineTransform

public AffineTransform(com.vividsolutions.jts.geom.Coordinate p1,
                       com.vividsolutions.jts.geom.Coordinate p1_)
A transformation that maps p1 to p1_ via a translation (no rotation or shear).

Parameters:
p1 - a point
p1_ - the point it maps to

AffineTransform

public AffineTransform(com.vividsolutions.jts.geom.Coordinate p1,
                       com.vividsolutions.jts.geom.Coordinate p1_,
                       com.vividsolutions.jts.geom.Coordinate p2,
                       com.vividsolutions.jts.geom.Coordinate p2_)
A transformation that maps p1 to p1_ and p2 to p2_ via a translation, rotation, and scaling (no "relative" shear).

Parameters:
p1 - a point
p1_ - the point p1 maps to
p2 - another point
p2_ - the point p2 maps to

AffineTransform

public AffineTransform(com.vividsolutions.jts.geom.Coordinate p1,
                       com.vividsolutions.jts.geom.Coordinate p1_,
                       com.vividsolutions.jts.geom.Coordinate p2,
                       com.vividsolutions.jts.geom.Coordinate p2_,
                       com.vividsolutions.jts.geom.Coordinate p3,
                       com.vividsolutions.jts.geom.Coordinate p3_)
A transformation that maps p1 to p1_, p2 to p2_ and p3 to p3_.

Parameters:
p1 - a point
p1_ - the point p1 maps to
p2 - another point
p2_ - the point p2 maps to
p3 - another point
p3_ - the point p3 maps to
Method Detail

rotate90

public static com.vividsolutions.jts.geom.Coordinate rotate90(com.vividsolutions.jts.geom.Coordinate a,
                                                              com.vividsolutions.jts.geom.Coordinate b)
Determines where a point would end up if it were rotated 90 degrees about another point.

Parameters:
a - the fixed point
b - the point to rotate (b itself will not be changed)
Returns:
b rotated 90 degrees clockwise about a

transform

public com.vividsolutions.jts.geom.Coordinate transform(com.vividsolutions.jts.geom.Coordinate c)
Applies the affine transform to a point. From http://graphics.lcs.mit.edu/classes/6.837/F01/Lecture07/lecture07.pdf:
      [ x_ ] = [  a11 a12 a13  ] [ x ]
      [ y_ ] = [  a21 a22 a23  ] [ y ]
      [ 1  ] = [  0   0   1    ] [ 1 ]
 

Specified by:
transform in class CoordinateTransform
Parameters:
c - the input to the affine transform
Returns:
the result of applying the affine transform to c