public final class Transform1S extends Object implements Transform<Point1S>
Transform
interface for spherical 1D points.
Similar to the Euclidean 1D
AffineTransformMatrix1D
,
this class performs transformations using an internal 1D affine transformation matrix. In the
Euclidean case, the matrix contains a scale factor and a translation. Here, the matrix contains
a scale/negation factor that takes the values -1 or +1, and a rotation value. This restriction on
the allowed values in the matrix is required in order to fulfill the geometric requirements
of the Transform
interface. For example, if arbitrary scaling is allowed, the point 0.5pi
could be scaled by 4 to 2pi
, which is equivalent to 0pi
. However, if the inverse scaling
of 1/4
is applied to 0pi
, the result is 0pi
and not 0.5pi
. This breaks
the Transform
requirement that transforms be inversible.
Instances of this class are guaranteed to be immutable.
Modifier and Type | Method and Description |
---|---|
Point1S |
apply(Point1S pt) |
static Transform1S |
createNegation()
Return a transform instance that negates azimuth values.
|
static Transform1S |
createRotation(double angle)
Return a transform instance that performs a rotation with the given
angle.
|
boolean |
equals(Object obj)
Return true if the given object is an instance of
Transform1S
and all transform element values are exactly equal. |
double |
getRotation()
Get the rotation value applied by this instance, in radians.
|
int |
hashCode() |
static Transform1S |
identity()
Return a transform instance representing the identity transform.
|
Transform1S |
inverse() |
boolean |
isNegation()
Return true if the transform negates the azimuth values of transformed
points, regardless of any rotation applied subsequently.
|
Transform1S |
multiply(Transform1S other)
Multiply the underlying matrix of this instance by that of the argument, eg,
other * this . |
Transform1S |
negate()
Return a new transform created by pre-multiplying this instance by a transform
that negates azimuth values.
|
Transform1S |
premultiply(Transform1S other)
Multiply the underlying matrix of the argument by that of this instance, eg,
this * other . |
boolean |
preservesOrientation() |
Transform1S |
rotate(double angle)
Return a new transform created by pre-multiplying this instance by a transform
producing a rotation with the given angle.
|
String |
toString() |
public boolean isNegation()
preservesOrientation()
public double getRotation()
public boolean preservesOrientation()
preservesOrientation
in interface Transform<Point1S>
public Transform1S rotate(double angle)
angle
- angle to rotate, in radianscreateRotation(double)
public Transform1S negate()
public Transform1S multiply(Transform1S other)
other * this
. The returned transform performs the equivalent of
other
followed by this
.other
- transform to multiply withpublic Transform1S premultiply(Transform1S other)
this * other
. The returned transform performs the equivalent of this
followed by other
.other
- transform to multiply withpublic Transform1S inverse()
public boolean equals(Object obj)
Transform1S
and all transform element values are exactly equal.public static Transform1S identity()
public static Transform1S createNegation()
public static Transform1S createRotation(double angle)
angle
- angle of the rotation, in radiansCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.