transformCoords method
Transforms the given point (x,y) using this matrix and stores the result
in the out
point or a new GPoint instance if out
is not provided.
The transformed point will be:
(x', y') = (a * x + c * y + tx, d * y + b * x + ty)
where (x,y) are the original coordinates, and (x', y') are the transformed
coordinates.
If the optional out
argument is provided, it will be modified to contain
the transformed point, otherwise a new GPoint will be returned.
Implementation
GPoint transformCoords(double x, double y, [GPoint? out]) {
out ??= GPoint();
out.x = a * x + c * y + tx;
out.y = d * y + b * x + ty;
return out;
}