transform method

Vector2 transform(
  1. Matrix 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

Vector2 transform(Matrix o) => .vec2(
  o.m0*x + o.m4*y + o.m8*0 + o.m12,
  o.m1*x + o.m5*y + o.m9*0 + o.m13
);