Class pv.Transform
Represents a transformation matrix. The transformation matrix is limited to expressing translate and uniform scale transforms only; shearing, rotation, general affine, and other transforms are not supported.
The methods on this class treat the transform as immutable, returning a
copy of the transformation matrix with the specified transform applied. Note,
alternatively, that the matrix fields can be get and set directly.
Defined in: Transform.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Returns a new identity transform.
|
Field Attributes | Field Name and Description |
---|---|
The scale magnitude; defaults to 1.
|
|
The x-offset; defaults to 0.
|
|
The y-offset; defaults to 0.
|
Method Attributes | Method Name and Description |
---|---|
invert()
Returns the inverse of this transformation matrix.
|
|
scale(k)
Returns a scaled copy of this transformation matrix.
|
|
times(m)
Returns this matrix post-multiplied by the specified matrix m.
|
|
translate(x, y)
Returns a translated copy of this transformation matrix.
|
Field Detail
{number}
k
The scale magnitude; defaults to 1.
{number}
x
The x-offset; defaults to 0.
{number}
y
The y-offset; defaults to 0.
Method Detail
{pv.Transform}
invert()
Returns the inverse of this transformation matrix.
- Returns:
- {pv.Transform} the inverted transformation matrix.
{pv.Transform}
scale(k)
Returns a scaled copy of this transformation matrix.
- Parameters:
- {number} k
- Returns:
- {pv.Transform} the scaled transformation matrix.
{pv.Transform}
times(m)
Returns this matrix post-multiplied by the specified matrix m.
- Parameters:
- {pv.Transform} m
- Returns:
- {pv.Transform} the post-multiplied transformation matrix.
{pv.Transform}
translate(x, y)
Returns a translated copy of this transformation matrix.
- Parameters:
- {number} x
- the x-offset.
- {number} y
- the y-offset.
- Returns:
- {pv.Transform} the translated transformation matrix.