transform method

V2 transform(
  1. M o
)

Transforms this vector by matrix o.

Applies the 2D affine transformation encoded in the top-left 2x2 portion of o plus the translation column (m12, m13). The Z component is treated as 0.

Implementation

V2 transform(M o) => _v2(
  o.m0*x + o.m4*y + o.m8*0 + o.m12,
  o.m1*x + o.m5*y + o.m9*0 + o.m13
);