class AffineTransformation extends Cloneable with CoordinateSequenceFilter
- Alphabetic
- By Inheritance
- AffineTransformation
- CoordinateSequenceFilter
- Cloneable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new AffineTransformation(src0: Coordinate, src1: Coordinate, src2: Coordinate, dest0: Coordinate, dest1: Coordinate, dest2: Coordinate)
Constructs a transformation which maps the given source points into the given destination points.
Constructs a transformation which maps the given source points into the given destination points.
- src0
source point 0
- src1
source point 1
- src2
source point 2
- dest0
the mapped point for source point 0
- dest1
the mapped point for source point 1
- dest2
the mapped point for source point 2
- new AffineTransformation(trans: AffineTransformation)
Constructs a transformation which is a copy of the given one.
Constructs a transformation which is a copy of the given one.
- trans
the transformation to copy
- new AffineTransformation(m00: Double, m01: Double, m02: Double, m10: Double, m11: Double, m12: Double)
Constructs a new transformation whose matrix has the specified values.
Constructs a new transformation whose matrix has the specified values.
- m00
the entry for the [0, 0] element in the transformation matrix
- m01
the entry for the [0, 1] element in the transformation matrix
- m02
the entry for the [0, 2] element in the transformation matrix
- m10
the entry for the [1, 0] element in the transformation matrix
- m11
the entry for the [1, 1] element in the transformation matrix
- m12
the entry for the [1, 2] element in the transformation matrix
- new AffineTransformation(matrix: Array[Double])
Constructs a new transformation whose matrix has the specified values.
Constructs a new transformation whose matrix has the specified values.
- matrix
an array containing the 6 values { m00, m01, m02, m10, m11, m12 } throws NullPointerException if matrix is null throws ArrayIndexOutOfBoundsException if matrix is too small
- new AffineTransformation()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): Any
Clones this transformation
Clones this transformation
return a copy of this transformation
- Definition Classes
- AffineTransformation → AnyRef
- def compose(trans: AffineTransformation): AffineTransformation
Updates this transformation to be the composition of this transformation with the given {link AffineTransformation}.
Updates this transformation to be the composition of this transformation with the given {link AffineTransformation}. This produces a transformation whose effect is equal to applying this transformation followed by the argument transformation. Mathematically,
A.compose(B) = TB x TA
- trans
an affine transformation return this transformation, with an updated matrix
- def composeBefore(trans: AffineTransformation): AffineTransformation
Updates this transformation to be the composition of a given {link AffineTransformation} with this transformation.
Updates this transformation to be the composition of a given {link AffineTransformation} with this transformation. This produces a transformation whose effect is equal to applying the argument transformation followed by this transformation. Mathematically,
A.composeBefore(B) = TA x TB
- trans
an affine transformation return this transformation, with an updated matrix
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(obj: Any): Boolean
Tests if an object is an AffineTransformation and has the same matrix as this transformation.
Tests if an object is an AffineTransformation and has the same matrix as this transformation.
- obj
an object to test return true if the given object is equal to this object
- Definition Classes
- AffineTransformation → AnyRef → Any
- def filter(seq: CoordinateSequence, i: Int): Unit
Transforms the i'th coordinate in the input sequence
Transforms the i'th coordinate in the input sequence
- seq
a
CoordinateSequence- i
the index of the coordinate to transform
- Definition Classes
- AffineTransformation → CoordinateSequenceFilter
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDeterminant: Double
Computes the determinant of the transformation matrix.
Computes the determinant of the transformation matrix. The determinant is computed as:
If the determinant is zero, the transform is singular (not invertible), and operations which attempt to compute an inverse will throw a NoninvertibleTransformException.| m00 m01 m02 | | m10 m11 m12 | = m00 * m11 - m01 * m10 | 0 0 1 |
return the determinant of the transformation
- See also
#getInverse()
- def getInverse: AffineTransformation
Computes the inverse of this transformation, if one exists.
Computes the inverse of this transformation, if one exists. The inverse is the transformation which when composed with this one produces the identity transformation. A transformation has an inverse if and only if it is not singular (i.e. its determinant is non-zero). Geometrically, an transformation is non-invertible if it maps the plane to a line or a point. If no inverse exists this method will throw a NoninvertibleTransformationException.
The matrix of the inverse is equal to the inverse of the matrix for the transformation. It is computed as follows:
1 inverse(A) = --- x adjoint(A) det = 1 | m11 -m01 m01*m12-m02*m11 | --- x | -m10 m00 -m00*m12+m10*m02 | det | 0 0 m00*m11-m10*m01 | = | m11/det -m01/det m01*m12-m02*m11/det | | -m10/det m00/det -m00*m12+m10*m02/det | | 0 0 1 |
return a new inverse transformation throws NoninvertibleTransformationException
- Annotations
- @throws(scala.this.throws.<init>$default$1[org.locationtech.jts.geom.util.NoninvertibleTransformationException])
- See also
#getDeterminant()
- def getMatrixEntries: Array[Double]
Gets an array containing the entries of the transformation matrix.
Gets an array containing the entries of the transformation matrix. Only the 6 non-trivial entries are returned, in the sequence:
m00, m01, m02, m10, m11, m12
return an array of length 6
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isDone: Boolean
Reports that this filter should continue to be executed until all coordinates have been transformed.
Reports that this filter should continue to be executed until all coordinates have been transformed.
return false
- Definition Classes
- AffineTransformation → CoordinateSequenceFilter
- def isGeometryChanged: Boolean
- Definition Classes
- AffineTransformation → CoordinateSequenceFilter
- def isIdentity: Boolean
Tests if this transformation is the identity transformation.
Tests if this transformation is the identity transformation.
return true if this is the identity transformation
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def reflect(x: Double, y: Double): AffineTransformation
Updates the value of this transformation to that of a reflection transformation composed with the current value.
Updates the value of this transformation to that of a reflection transformation composed with the current value.
- x
the x-ordinate of the line to reflect around
- y
the y-ordinate of the line to reflect around return this transformation, with an updated matrix
- def reflect(x0: Double, y0: Double, x1: Double, y1: Double): AffineTransformation
Updates the value of this transformation to that of a reflection transformation composed with the current value.
Updates the value of this transformation to that of a reflection transformation composed with the current value.
- x0
the x-ordinate of a point on the line to reflect around
- y0
the y-ordinate of a point on the line to reflect around
- x1
the x-ordinate of a point on the line to reflect around
- y1
the y-ordinate of a point on the line to reflect around return this transformation, with an updated matrix
- def rotate(sinTheta: Double, cosTheta: Double, x: Double, y: Double): AffineTransformation
Updates the value of this transformation to that of a rotation around a given point composed with the current value, with the sin and cos of the rotation angle specified directly.
Updates the value of this transformation to that of a rotation around a given point composed with the current value, with the sin and cos of the rotation angle specified directly.
- sinTheta
the sine of the angle to rotate by
- cosTheta
the cosine of the angle to rotate by
- x
the x-ordinate of the rotation point
- y
the y-ordinate of the rotation point return this transformation, with an updated matrix
- def rotate(theta: Double, x: Double, y: Double): AffineTransformation
Updates the value of this transformation to that of a rotation around a given point composed with the current value.
Updates the value of this transformation to that of a rotation around a given point composed with the current value. Positive angles correspond to a rotation in the counter-clockwise direction.
- theta
the angle to rotate by, in radians
- x
the x-ordinate of the rotation point
- y
the y-ordinate of the rotation point return this transformation, with an updated matrix
- def rotate(sinTheta: Double, cosTheta: Double): AffineTransformation
Updates the value of this transformation to that of a rotation around the origin composed with the current value, with the sin and cos of the rotation angle specified directly.
Updates the value of this transformation to that of a rotation around the origin composed with the current value, with the sin and cos of the rotation angle specified directly.
- sinTheta
the sine of the angle to rotate by
- cosTheta
the cosine of the angle to rotate by return this transformation, with an updated matrix
- def rotate(theta: Double): AffineTransformation
Updates the value of this transformation to that of a rotation transformation composed with the current value.
Updates the value of this transformation to that of a rotation transformation composed with the current value. Positive angles correspond to a rotation in the counter-clockwise direction.
- theta
the angle to rotate by, in radians return this transformation, with an updated matrix
- def scale(xScale: Double, yScale: Double): AffineTransformation
Updates the value of this transformation to that of a scale transformation composed with the current value.
Updates the value of this transformation to that of a scale transformation composed with the current value.
- xScale
the value to scale by in the x direction
- yScale
the value to scale by in the y direction return this transformation, with an updated matrix
- def setToIdentity: AffineTransformation
Sets this transformation to be the identity transformation.
Sets this transformation to be the identity transformation. The identity transformation has the matrix:
| 1 0 0 | | 0 1 0 | | 0 0 1 |
return this transformation, with an updated matrix
- def setToReflection(x: Double, y: Double): AffineTransformation
Sets this transformation to be a reflection about the line defined by vector (x,y).
Sets this transformation to be a reflection about the line defined by vector (x,y). The transformation for a reflection is computed by:
d = sqrt(x2 + y2) sin = y / d; cos = x / d; Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
- x
the x-component of the reflection line vector
- y
the y-component of the reflection line vector return this transformation, with an updated matrix
- def setToReflection(x0: Double, y0: Double, x1: Double, y1: Double): AffineTransformation
Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1).
Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1).
- x0
the X ordinate of one point on the reflection line
- y0
the Y ordinate of one point on the reflection line
- x1
the X ordinate of another point on the reflection line
- y1
the Y ordinate of another point on the reflection line return this transformation, with an updated matrix
- def setToReflectionBasic(x0: Double, y0: Double, x1: Double, y1: Double): AffineTransformation
Explicitly computes the math for a reflection.
Explicitly computes the math for a reflection. May not work.
- x0
the X ordinate of one point on the reflection line
- y0
the Y ordinate of one point on the reflection line
- x1
the X ordinate of another point on the reflection line
- y1
the Y ordinate of another point on the reflection line return this transformation, with an updated matrix
- def setToRotation(sinTheta: Double, cosTheta: Double, x: Double, y: Double): AffineTransformation
Sets this transformation to be a rotation around a given point (x,y) by specifying the sin and cos of the rotation angle directly.
Sets this transformation to be a rotation around a given point (x,y) by specifying the sin and cos of the rotation angle directly. The transformation matrix for the rotation has the value:
| cosTheta -sinTheta x-x*cos+y*sin | | sinTheta cosTheta y-x*sin-y*cos | | 0 0 1 |
- sinTheta
the sine of the rotation angle
- cosTheta
the cosine of the rotation angle
- x
the x-ordinate of the rotation point
- y
the y-ordinate of the rotation point return this transformation, with an updated matrix
- def setToRotation(theta: Double, x: Double, y: Double): AffineTransformation
Sets this transformation to be a rotation around a given point (x,y).
Sets this transformation to be a rotation around a given point (x,y). A positive rotation angle corresponds to a counter-clockwise rotation. The transformation matrix for a rotation by an angle theta has the value:
| cosTheta -sinTheta x-x*cos+y*sin | | sinTheta cosTheta y-x*sin-y*cos | | 0 0 1 |
- theta
the rotation angle, in radians
- x
the x-ordinate of the rotation point
- y
the y-ordinate of the rotation point return this transformation, with an updated matrix
- def setToRotation(sinTheta: Double, cosTheta: Double): AffineTransformation
Sets this transformation to be a rotation around the origin by specifying the sin and cos of the rotation angle directly.
Sets this transformation to be a rotation around the origin by specifying the sin and cos of the rotation angle directly. The transformation matrix for the rotation has the value:
| cosTheta -sinTheta 0 | | sinTheta cosTheta 0 | | 0 0 1 |
- sinTheta
the sine of the rotation angle
- cosTheta
the cosine of the rotation angle return this transformation, with an updated matrix
- def setToRotation(theta: Double): AffineTransformation
Sets this transformation to be a rotation around the origin.
Sets this transformation to be a rotation around the origin. A positive rotation angle corresponds to a counter-clockwise rotation. The transformation matrix for a rotation by an angle theta has the value:
| cos(theta) -sin(theta) 0 | | sin(theta) cos(theta) 0 | | 0 0 1 |
- theta
the rotation angle, in radians return this transformation, with an updated matrix
- def setToScale(xScale: Double, yScale: Double): AffineTransformation
Sets this transformation to be a scaling.
Sets this transformation to be a scaling. The transformation matrix for a scale has the value:
| xScale 0 dx | | 1 yScale dy | | 0 0 1 |
- xScale
the amount to scale x-ordinates by
- yScale
the amount to scale y-ordinates by return this transformation, with an updated matrix
- def setToShear(xShear: Double, yShear: Double): AffineTransformation
Sets this transformation to be a shear.
Sets this transformation to be a shear. The transformation matrix for a shear has the value:
Note that a shear of (1, 1) is not equal to shear(1, 0) composed with shear(0, 1). Instead, shear(1, 1) corresponds to a mapping onto the line x = y.| 1 xShear 0 | | yShear 1 0 | | 0 0 1 |
- xShear
the x component to shear by
- yShear
the y component to shear by return this transformation, with an updated matrix
- def setToTranslation(dx: Double, dy: Double): AffineTransformation
Sets this transformation to be a translation.
Sets this transformation to be a translation. For a translation by the vector (x, y) the transformation matrix has the value:
| 1 0 dx | | 1 0 dy | | 0 0 1 |
- dx
the x component to translate by
- dy
the y component to translate by return this transformation, with an updated matrix
- def setTransformation(trans: AffineTransformation): AffineTransformation
Sets this transformation to be a copy of the given one
Sets this transformation to be a copy of the given one
- trans
a transformation to copy return this transformation, with an updated matrix
- def setTransformation(m00: Double, m01: Double, m02: Double, m10: Double, m11: Double, m12: Double): AffineTransformation
Sets this transformation's matrix to have the given values.
Sets this transformation's matrix to have the given values.
- m00
the entry for the [0, 0] element in the transformation matrix
- m01
the entry for the [0, 1] element in the transformation matrix
- m02
the entry for the [0, 2] element in the transformation matrix
- m10
the entry for the [1, 0] element in the transformation matrix
- m11
the entry for the [1, 1] element in the transformation matrix
- m12
the entry for the [1, 2] element in the transformation matrix return this transformation, with an updated matrix
- def shear(xShear: Double, yShear: Double): AffineTransformation
Updates the value of this transformation to that of a shear transformation composed with the current value.
Updates the value of this transformation to that of a shear transformation composed with the current value.
- xShear
the value to shear by in the x direction
- yShear
the value to shear by in the y direction return this transformation, with an updated matrix
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
Gets a text representation of this transformation.
Gets a text representation of this transformation. The string is of the form:
AffineTransformation[[m00, m01, m02], [m10, m11, m12]]
return a string representing this transformation
- Definition Classes
- AffineTransformation → AnyRef → Any
- def transform(seq: CoordinateSequence, i: Int): Unit
Applies this transformation to the i'th coordinate in the given CoordinateSequence.
Applies this transformation to the i'th coordinate in the given CoordinateSequence.
- seq
a
CoordinateSequence- i
the index of the coordinate to transform
- def transform(g: Geometry): Geometry
Creates a new {link Geometry} which is the result of this transformation applied to the input Geometry.
Creates a new {link Geometry} which is the result of this transformation applied to the input Geometry.
- g
a
Geometryreturn a transformed Geometry
- def transform(src: Coordinate, dest: Coordinate): Coordinate
Applies this transformation to the src coordinate and places the results in the dest coordinate (which may be the same as the source).
Applies this transformation to the src coordinate and places the results in the dest coordinate (which may be the same as the source).
- src
the coordinate to transform
- dest
the coordinate to accept the results return the dest coordinate
- def translate(x: Double, y: Double): AffineTransformation
Updates the value of this transformation to that of a translation transformation composed with the current value.
Updates the value of this transformation to that of a translation transformation composed with the current value.
- x
the value to translate by in the x direction
- y
the value to translate by in the y direction return this transformation, with an updated matrix
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()