math.geom2d.transform
Class Rotation2D

java.lang.Object
  extended by math.geom2d.transform.AbstractAffineTransform2D
      extended by math.geom2d.transform.Rotation2D
All Implemented Interfaces:
AffineTransform2D, Bijection2D, Isometry2D, Motion2D, Similarity2D, Transform2D
Direct Known Subclasses:
LinearRotation2D

public class Rotation2D
extends AbstractAffineTransform2D
implements Motion2D

Rotate a shape around a point with a given angle.


Nested Class Summary
 
Nested classes/interfaces inherited from class math.geom2d.transform.AbstractAffineTransform2D
AbstractAffineTransform2D.Identity2D
 
Field Summary
protected  double theta
           
protected  double x0
           
protected  double y0
           
 
Constructor Summary
Rotation2D(double theta)
           
Rotation2D(double xc, double yc, double theta)
           
Rotation2D(Point2D center, double theta)
           
 
Method Summary
 AffineTransform2D compose(AffineTransform2D transfo)
          Returns a new Rotation2D, Translation2D, or GenericAffineTransform2D depending on the parameter transform.
 double[][] getAffineMatrix()
          return matrix of the transform coefficients.
 double getAngle()
           
 Point2D getCenter()
           
 double[] getCoefficients()
          return coefficients of the transform.
 Rotation2D getInverseTransform()
           
 LinearRotation2D getLinearPart()
           
 double getScalingFactor()
          Returns the scaling factor of the transform.
 Translation2D getTranslationPart()
           
 boolean isDirect()
          Check if the transform is direct, i.e. it preserves the orientation of transformed shapes.
 boolean isIdentity()
          Check if the transform is equivalent to the identity transform.
 boolean isMotion()
          Check if the transform is a motion, i.e. a compound of translations and rotation.
 void setAngle(double theta)
           
 void setCenter(Point2D point)
           
 
Methods inherited from class math.geom2d.transform.AbstractAffineTransform2D
createRotation, createRotation, createRotation, createScaling, createScaling, createTranslation, createTranslation, equals, isDirect, isIdentity, isIsometry, isIsometry, isMotion, isSimilarity, 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
isIsometry, isSimilarity
 
Methods inherited from interface math.geom2d.transform.Transform2D
transform, transform, transform
 

Field Detail

x0

protected double x0

y0

protected double y0

theta

protected double theta
Constructor Detail

Rotation2D

public Rotation2D(double theta)

Rotation2D

public Rotation2D(Point2D center,
                  double theta)

Rotation2D

public Rotation2D(double xc,
                  double yc,
                  double theta)
Method Detail

setCenter

public void setCenter(Point2D point)

getCenter

public Point2D getCenter()

setAngle

public void setAngle(double theta)

getAngle

public double getAngle()

isMotion

public boolean isMotion()
Description copied from interface: AffineTransform2D
Check if the transform is a motion, i.e. a compound of translations and rotation. Motion preserves area and orientation (directed or undirected) of shapes unchanged.

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

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 Rotation2D getInverseTransform()
Specified by:
getInverseTransform in interface Bijection2D

isDirect

public boolean isDirect()
Description copied from interface: AffineTransform2D
Check if the transform is direct, i.e. it preserves the orientation of transformed shapes.

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

isIdentity

public boolean isIdentity()
Description copied from interface: AffineTransform2D
Check if the transform is equivalent to the identity transform.

Specified by:
isIdentity in interface AffineTransform2D
Overrides:
isIdentity in class AbstractAffineTransform2D
Returns:
true if the transform is identity

getScalingFactor

public double getScalingFactor()
Description copied from interface: Similarity2D
Returns the scaling factor of the transform. The scaling factor is positive for direct transforms.

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

getLinearPart

public LinearRotation2D 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.

compose

public AffineTransform2D compose(AffineTransform2D transfo)
Returns a new Rotation2D, Translation2D, or GenericAffineTransform2D depending on the parameter transform.

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