wrld.js

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.

Usage example

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)

Methods

Method Returns Description
transform(<Point> point, <Number> scale?) Point

Returns a transformed point, optionally multiplied by the given scale. Only accepts real L.Point instances, not arrays.

untransform(<Point> point, <Number> scale?) Point

Returns the reverse transformation of the given point, optionally divided by the given scale. Only accepts real L.Point instances, not arrays.

v0.1.1452