[transformations] Apply transformations to the rectangle by multiplying the position by a 4x4 matrix whose components change with each iteration