AffineTransform class
An Affine Transform class generated from a set of reference points.
Constructors
Affine |
An Affine Transform class generated from a set of reference points. |
Methods
to |
Converts an array of points from the target reference system to the source reference system. |
to |
Converts an array of points from the source reference system to the target reference system. |
Constructor Details
AffineTransform(number[][], number[][])
An Affine Transform class generated from a set of reference points.
new AffineTransform(source: number[][], target: number[][])
Parameters
- source
-
number[][]
A set of reference points from the source reference system to transform from.
- target
-
number[][]
A set of reference points from the target reference system to transform to.
Method Details
toSource(number[][], number)
Converts an array of points from the target reference system to the source reference system.
function toSource(targetPoints: number[][], decimals?: number): number[][]
Parameters
- targetPoints
-
number[][]
An array of points from the target reference system to transform.
- decimals
-
number
Number of decimal places to round the results off to.
Returns
number[][]
An array of points that have been transformed to the source reference system.
toTarget(number[][], number)
Converts an array of points from the source reference system to the target reference system.
function toTarget(sourcePoints: number[][], decimals?: number): number[][]
Parameters
- sourcePoints
-
number[][]
An array of points from the source reference system to transform.
- decimals
-
number
Number of decimal places to round the results off to.
Returns
number[][]
An array of points that have been transformed to the target reference system.