apply method

CornerPoint apply(
  1. CornerPoint point
)

Applies this transformation to a given point and returns the transformed point.

Implementation

CornerPoint apply(CornerPoint point) {
  final x = point.x;
  final y = point.y;
  final denominator = _matrix(1, 3) * x + _matrix(2, 3) * y + _matrix(3, 3);
  return CornerPoint(
    x: (_matrix(1, 1) * x + _matrix(2, 1) * y + _matrix(3, 1)) / denominator,
    y: (_matrix(1, 2) * x + _matrix(2, 2) * y + _matrix(3, 2)) / denominator,
  );
}