math.geom2d.transform
Class Scaling2D
java.lang.Object
math.geom2d.transform.AbstractAffineTransform2D
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.
|
Field Summary |
protected double |
sx
|
protected double |
sy
|
protected double |
xc
|
protected double |
yc
|
| 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 |
sx
protected double sx
sy
protected double sy
xc
protected double xc
yc
protected double yc
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 directionsy - scaling in y direction
Scaling2D
public Scaling2D(Point2D origin,
double sx,
double sy)
- Parameters:
origin - the invariant point of the transformsx - scaling in x directionsy - scaling in y direction
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()