Point.applyTransform

Syntax

applyTransform(v: Array);

Parameters

v. Transformation matrix.

Description

The applyTransform method is used to transform point coordinates.

Comments

Transformation matrix must contain 6 elements.

Example

To execute the example, add a link to PP.js scenario file to HTML page in the <head> tag. The following code is executed in the console browser. Create a point with the coordinates (5, 5) and transform its coordinates by means of the matrix: [2,0,0,2,0,0]:

// Create a point with the coordinates (5,5)
var point = new PP.Point(5, 5);
// Transform coordinates:
point.applyTransform([2,0,0,2,0,0]);
// Output transformation result
console.log("Coordinate X: " + point.getX());
console.log("Coordinate Y: " + point.getY());

As a result the console displays new point coordinates:

Coordinate X: 10

Coordinate Y: 10

See also:

Point