math.geom2d.transform
Class Scaling2D

java.lang.Object
  extended by math.geom2d.transform.AbstractAffineTransform2D
      extended by math.geom2d.transform.Scaling2D
All Implemented Interfaces:
AffineTransform2D, Bijection2D, Transform2D

public class Scaling2D
extends AbstractAffineTransform2D

Scales a shape in the 2 main directions of the axis, centered at the origin.


Nested Class Summary
 
Nested classes/interfaces inherited from class math.geom2d.transform.AbstractAffineTransform2D
AbstractAffineTransform2D.Identity2D
 
Field Summary
protected  double sx
           
protected  double sy
           
protected  double xc
           
protected  double yc
           
 
Constructor Summary
Scaling2D(double scale)
          Use the same scaling factor for x and y axis.
Scaling2D(double sx, double sy)
           
Scaling2D(Point2D origin, double sx, double sy)
           
 
Method Summary
 double[][] getAffineMatrix()
          return matrix of the transform coefficients.
 double[] getCoefficients()
          return coefficients of the transform.
 Scaling2D getInverseTransform()
           
 boolean isDirect()
          return true if both scaling factors have the same sign.
 boolean isMotion()
          return false, as the scaling transform does not preserves areas.
 
Methods inherited from class math.geom2d.transform.AbstractAffineTransform2D
compose, createRotation, createRotation, createRotation, createScaling, createScaling, createTranslation, createTranslation, equals, isDirect, isIdentity, 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
 

Field Detail

sx

protected double sx

sy

protected double sy

xc

protected double xc

yc

protected double yc
Constructor Detail

Scaling2D

public Scaling2D(double scale)
Use the same scaling factor for x and y axis.


Scaling2D

public Scaling2D(double sx,
                 double sy)
Parameters:
sx - scaling in x direction
sy - scaling in y direction

Scaling2D

public Scaling2D(Point2D origin,
                 double sx,
                 double sy)
Parameters:
origin - the invariant point of the transform
sx - scaling in x direction
sy - scaling in y direction
Method Detail

isMotion

public boolean isMotion()
return false, as the scaling transform does not preserves areas.

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

isDirect

public boolean isDirect()
return true if both scaling factors have the same sign.

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

getCoefficients

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


getAffineMatrix

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


getInverseTransform

public Scaling2D getInverseTransform()