--- layout: api title: "v1.6.2 API: L.Transformation" categories: api version: v1.6.2 permalink: /api/v1.6.2/l-transformation ---
Represents an affine transformation: a set of coefficients a
, b
, c
, d
for transforming a point of a form (x, y)
into (a*x + b, c*y + d)
and doing the reverse. Used by Leaflet in its projections code.
var transformation = new L.Transformation(2, 5, -1, 10),
p = L.point(1, 2),
p2 = transformation.transform(p), // L.point(7, 8)
p3 = transformation.untransform(p2); // L.point(1, 2)
Creation | Description |
---|---|
|
Creates a transformation object with the given coefficients. |
Method | Returns | Description |
---|---|---|
transform(
|
Point |
Returns a transformed point, optionally multiplied by the given scale. Only accepts real L.Point instances, not arrays. |
untransform(
|
Point |
Returns the reverse transformation of the given point, optionally divided by the given scale. Only accepts real L.Point instances, not arrays. |