Class Transform1S
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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Transform1SReturn a transform instance that negates azimuth values.static Transform1ScreateRotation(double angle) Return a transform instance that performs a rotation with the given angle.booleanReturn true if the given object is an instance ofTransform1Sand all transform element values are exactly equal.doubleGet the rotation value applied by this instance, in radians.inthashCode()static Transform1Sidentity()Return a transform instance representing the identity transform.inverse()Get an instance representing the inverse transform.booleanReturn true if the transform negates the azimuth values of transformed points, regardless of any rotation applied subsequently.multiply(Transform1S other) Multiply the underlying matrix of this instance by that of the argument, eg,other * this.negate()Return a new transform created by pre-multiplying this instance by a transform that negates azimuth values.premultiply(Transform1S other) Multiply the underlying matrix of the argument by that of this instance, eg,this * other.booleanReturn true if the transform preserves the orientation of the space.rotate(double angle) Return a new transform created by pre-multiplying this instance by a transform producing a rotation with the given angle.toString()
-
Method Details
-
isNegation
Return true if the transform negates the azimuth values of transformed points, regardless of any rotation applied subsequently.- Returns:
- true if the transform negates the azimuth values of transformed points
- See Also:
-
getRotation
Get the rotation value applied by this instance, in radians.- Returns:
- the rotation value applied by this instance, in radians.
-
apply
-
preservesOrientation
Return true if the transform preserves the orientation of the space. For example, in Euclidean 2D space, this will be true for translations, rotations, and scalings but will be false for reflections.- Specified by:
preservesOrientationin interfaceTransform<Point1S>- Returns:
- true if the transform preserves the orientation of the space
- See Also:
-
rotate
Return a new transform created by pre-multiplying this instance by a transform producing a rotation with the given angle.- Parameters:
angle- angle to rotate, in radians- Returns:
- a new transform created by pre-multiplying this instance by a transform producing a rotation with the given angle
- See Also:
-
negate
Return a new transform created by pre-multiplying this instance by a transform that negates azimuth values.- Returns:
- a new transform created by pre-multiplying this instance by a transform that negates azimuth values
-
multiply
Multiply the underlying matrix of this instance by that of the argument, eg,other * this. The returned transform performs the equivalent ofotherfollowed bythis.- Parameters:
other- transform to multiply with- Returns:
- a new transform computed by multiplying the matrix of this instance by that of the argument
-
premultiply
Multiply the underlying matrix of the argument by that of this instance, eg,this * other. The returned transform performs the equivalent ofthisfollowed byother.- Parameters:
other- transform to multiply with- Returns:
- a new transform computed by multiplying the matrix of the argument by that of this instance
-
inverse
Get an instance representing the inverse transform. -
hashCode
-
equals
Return true if the given object is an instance ofTransform1Sand all transform element values are exactly equal. -
toString
-
identity
Return a transform instance representing the identity transform.- Returns:
- a transform instance representing the identity transform
-
createNegation
Return a transform instance that negates azimuth values.- Returns:
- a transform instance that negates azimuth values.
-
createRotation
Return a transform instance that performs a rotation with the given angle.- Parameters:
angle- angle of the rotation, in radians- Returns:
- a transform instance that performs a rotation with the given angle
-