goog.graphics.AffineTransform
Classgoog.graphics.AffineTransform(opt_m00, opt_m10, opt_m01, opt_m11, opt_m02, opt_m12)
Creates a 2D affine transform. An affine transform performs a linear mapping from 2D coordinates to other 2D coordinates that preserves the "straightness" and "parallelness" of lines. Such a coordinate transformation can be represented by a 3 row by 3 column matrix with an implied last row of [ 0 0 1 ]. This matrix transforms source coordinates (x,y) into destination coordinates (x',y') by considering them to be a column vector and multiplying the coordinate vector by the matrix according to the following process:
[ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ] [ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ] [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]This class is optimized for speed and minimizes calculations based on its knowledge of the underlying matrix (as opposed to say simply performing matrix multiplication).
opt_m00
{number
=}
opt_m10
{number
=}
opt_m01
{number
=}
opt_m11
{number
=}
opt_m02
{number
=}
opt_m12
{number
=}
.clone()
goog.graphics.AffineTransform
}
.concatenate(tx)
Concatenates an affine transform to this transform.
tx
{!goog.graphics.AffineTransform
}
goog.graphics.AffineTransform
}
.copyFrom(tx)
Sets this transform to be identical to the given transform.
tx
{!goog.graphics.AffineTransform
}
goog.graphics.AffineTransform
}
.createInverse()
goog.graphics.AffineTransform
}
.equals(tx)
Compares two affine transforms for equality.
tx
{goog.graphics.AffineTransform
}
boolean
}
.getDeterminant()
number
}
.getRotateInstance(theta, x, y)
Creates a transform representing a rotation transformation.
theta
{number
}
x
{number
}
y
{number
}
goog.graphics.AffineTransform
}
.getScaleInstance(sx, sy)
Creates a transform representing a scaling transformation.
sx
{number
}
sy
{number
}
goog.graphics.AffineTransform
}
.getScaleX()
number
}
.getScaleY()
number
}
.getShearInstance(shx, shy)
Creates a transform representing a shearing transformation.
shx
{number
}
shy
{number
}
goog.graphics.AffineTransform
}
.getShearX()
number
}
.getShearY()
number
}
.getTranslateInstance(dx, dy)
Creates a transform representing a translation transformation.
dx
{number
}
dy
{number
}
goog.graphics.AffineTransform
}
.getTranslateX()
number
}
.getTranslateY()
number
}
.isIdentity()
boolean
}
.isInvertible()
Returns whether the transform is invertible. A transform is not invertible if the determinant is 0 or any value is non-finite or NaN.
boolean
}
.preConcatenate(tx)
Pre-concatenates an affine transform to this transform.
tx
{!goog.graphics.AffineTransform
}
goog.graphics.AffineTransform
}
.preRotate(theta, x, y)
Pre-concatenates this transform with a rotation transformation around an anchor point.
theta
{number
}
x
{number
}
y
{number
}
goog.graphics.AffineTransform
}
.preScale(sx, sy)
Pre-concatenates this transform with a scaling transformation, i.e. calculates the following matrix product:
[sx 0 0] [m00 m01 m02] [ 0 sy 0] [m10 m11 m12] [ 0 0 1] [ 0 0 1]
sx
{number
}
sy
{number
}
goog.graphics.AffineTransform
}
.preShear(shx, shy)
Pre-concatenates this transform with a shear transformation. i.e. calculates the following matrix product:
[ 1 shx 0] [m00 m01 m02] [shy 1 0] [m10 m11 m12] [ 0 0 1] [ 0 0 1]
shx
{number
}
shy
{number
}
goog.graphics.AffineTransform
}
.preTranslate(dx, dy)
Pre-concatenates this transform with a translate transformation, i.e. calculates the following matrix product:
[1 0 dx] [m00 m01 m02] [0 1 dy] [m10 m11 m12] [0 0 1] [ 0 0 1]
dx
{number
}
dy
{number
}
goog.graphics.AffineTransform
}
.rotate(theta, x, y)
Concatenates this transform with a rotation transformation around an anchor point.
theta
{number
}
x
{number
}
y
{number
}
goog.graphics.AffineTransform
}
.scale(sx, sy)
Concatenates this transform with a scaling transformation.
sx
{number
}
sy
{number
}
goog.graphics.AffineTransform
}
.setToRotation(theta, x, y)
Sets this transform to a rotation transformation.
theta
{number
}
x
{number
}
y
{number
}
goog.graphics.AffineTransform
}
.setToScale(sx, sy)
Sets this transform to a scaling transformation.
sx
{number
}
sy
{number
}
goog.graphics.AffineTransform
}
.setToShear(shx, shy)
Sets this transform to a shearing transformation.
shx
{number
}
shy
{number
}
goog.graphics.AffineTransform
}
.setToTranslation(dx, dy)
Sets this transform to a translation transformation.
dx
{number
}
dy
{number
}
goog.graphics.AffineTransform
}
.setTransform(m00, m10, m01, m11, m02, m12)
Sets this transform to the matrix specified by the 6 values.
m00
{number
}
m10
{number
}
m01
{number
}
m11
{number
}
m02
{number
}
m12
{number
}
goog.graphics.AffineTransform
}
.shear(shx, shy)
Concatenates this transform with a shear transformation.
shx
{number
}
shy
{number
}
goog.graphics.AffineTransform
}
.toString()
string
}
.transform(src, srcOff, dst, dstOff, numPts)
Transforms an array of coordinates by this transform and stores the result into a destination array.
src
{!Array
.<number
>}
srcOff
{number
}
dst
{!Array
.<number
>}
dstOff
{number
}
numPts
{number
}
.translate(dx, dy)
Concatenates this transform with a translate transformation.
dx
{number
}
dy
{number
}
goog.graphics.AffineTransform
}