public final class ScaleFactor extends Object
This class is immutable.
Constructor and Description |
---|
ScaleFactor(double factor)
Create with an identical scaling-factor for all dimensions.
|
ScaleFactor(double x,
double y)
Create with specific scaling-factors for each dimension.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
hasIdenticalXY()
Is the scale-factor identical in X and Y dimensions?
|
ScaleFactor |
invert()
Build a new scale factor where each dimension is set to the reciprocal of its current value.
|
boolean |
isNoScale()
Does the scale-factor involve no scaling at all?
|
double |
minimumDimension()
Which is the minimum scaling-factor among all dimensions?
|
void |
scale(Point3d point)
Multiplies a
Point3d by the respective scaling-factor in each X and Y dimensions. |
String |
toString() |
double |
x()
How much to multiply the existing x-dimension by to create a scaled X-dimension.
|
double |
y()
How much to multiply the existing y-dimension by to create a scaled Y-dimension.
|
public ScaleFactor(double factor)
factor
- how much to multiply all existing dimensions by to create a scaled
dimensions.public ScaleFactor(double x, double y)
x
- how much to multiply the existing x-dimension by to create a scaled x-dimension.y
- how much to multiply the existing x-dimension by to create a scaled x-dimension.public ScaleFactor invert()
This is an immutable operation.
ScaleFactor
where each component is set to its reciprocal.public boolean hasIdenticalXY()
1e-3
precision.public boolean isNoScale()
public double minimumDimension()
public void scale(Point3d point)
Point3d
by the respective scaling-factor in each X and Y dimensions.
No scaling is applied in the Z dimension.
point
- the point to be scaled.public double x()
public double y()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.