math.geom2d.transform
Class Translation2D

java.lang.Object
  extended by math.geom2d.transform.AbstractAffineTransform2D
      extended by math.geom2d.transform.Translation2D
All Implemented Interfaces:
AffineTransform2D, Bijection2D, Isometry2D, Motion2D, Similarity2D, Transform2D

public class Translation2D
extends AbstractAffineTransform2D
implements Motion2D

Transform each point by translating it by a given vector.


Nested Class Summary
 
Nested classes/interfaces inherited from class math.geom2d.transform.AbstractAffineTransform2D
AbstractAffineTransform2D.Identity2D
 
Field Summary
protected  double dx
           
protected  double dy
           
 
Constructor Summary
Translation2D(double dx, double dy)
           
Translation2D(java.awt.geom.Point2D point)
           
Translation2D(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
           
Translation2D(Vector2D vector)
           
 
Method Summary
 AffineTransform2D compose(AffineTransform2D transfo)
          If the transform given as parameter is a translation, returns an instance of translation2D.
 double[][] getAffineMatrix()
          return matrix of the transform coefficients.
 double[] getCoefficients()
          return coefficients of the transform.
 Translation2D getInverseTransform()
          return a new Translation2D with given vector opposite to this.
 LinearTransform2D getLinearPart()
           
 double getScalingFactor()
          return 1, by definition of a translation.
 Translation2D getTranslationPart()
           
 Vector2D getVector()
           
 boolean isDirect()
          return true, by definition of a translation.
 boolean isIsometry()
          return true, by definition of a translation.
 boolean isMotion()
          return true, by definition of a translation.
 boolean isSimilarity()
          return true, by definition of a translation.
 void setVector(double dx, double dy)
           
 void setVector(Vector2D v)
           
 
Methods inherited from class math.geom2d.transform.AbstractAffineTransform2D
createRotation, createRotation, createRotation, createScaling, createScaling, createTranslation, createTranslation, equals, isDirect, isIdentity, isIdentity, isIsometry, isMotion, isSimilarity, transform, transform, transform
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface math.geom2d.transform.AffineTransform2D
isIdentity
 
Methods inherited from interface math.geom2d.transform.Transform2D
transform, transform, transform
 

Field Detail

dx

protected double dx

dy

protected double dy
Constructor Detail

Translation2D

public Translation2D(java.awt.geom.Point2D point)

Translation2D

public Translation2D(Vector2D vector)

Translation2D

public Translation2D(java.awt.geom.Point2D p1,
                     java.awt.geom.Point2D p2)

Translation2D

public Translation2D(double dx,
                     double dy)
Method Detail

getVector

public Vector2D getVector()

setVector

public void setVector(double dx,
                      double dy)

setVector

public void setVector(Vector2D v)

isMotion

public boolean isMotion()
return true, by definition of a translation.

Specified by:
isMotion in interface AffineTransform2D
Overrides:
isMotion in class AbstractAffineTransform2D
Returns:
true in case of motion.

isDirect

public boolean isDirect()
return true, by definition of a translation.

Specified by:
isDirect in interface AffineTransform2D
Specified by:
isDirect in interface Isometry2D
Overrides:
isDirect in class AbstractAffineTransform2D
Returns:
true if transform is direct.

isSimilarity

public boolean isSimilarity()
return true, by definition of a translation.

Specified by:
isSimilarity in interface AffineTransform2D
Overrides:
isSimilarity in class AbstractAffineTransform2D

isIsometry

public boolean isIsometry()
return true, by definition of a translation.

Specified by:
isIsometry in interface AffineTransform2D
Overrides:
isIsometry in class AbstractAffineTransform2D
Returns:
true in case of isometry.

getScalingFactor

public double getScalingFactor()
return 1, by definition of a translation.

Specified by:
getScalingFactor in interface Similarity2D
Returns:
the scaling factor of the transform.

getLinearPart

public LinearTransform2D getLinearPart()
Specified by:
getLinearPart in interface Similarity2D
Returns:
the linear part of the transform.

getTranslationPart

public Translation2D getTranslationPart()
Specified by:
getTranslationPart in interface Similarity2D
Returns:
the translation part of the transform.

getCoefficients

public double[] getCoefficients()
Description copied from interface: AffineTransform2D
return coefficients of the transform. Result is an array of 6 double.

Specified by:
getCoefficients in interface AffineTransform2D

getAffineMatrix

public double[][] getAffineMatrix()
Description copied from interface: AffineTransform2D
return matrix of the transform coefficients. Result is a 2x3 array of double.

Specified by:
getAffineMatrix in interface AffineTransform2D

getInverseTransform

public Translation2D getInverseTransform()
return a new Translation2D with given vector opposite to this.

Specified by:
getInverseTransform in interface Bijection2D

compose

public AffineTransform2D compose(AffineTransform2D transfo)
If the transform given as parameter is a translation, returns an instance of translation2D.

Specified by:
compose in interface AffineTransform2D
Overrides:
compose in class AbstractAffineTransform2D
Parameters:
transfo - the transform to compose with
Returns:
the composition of this transform with the given transform