This matrix scales a point by sx,sy
require "matrix" unit = 2 sx,sy = 2.0, 3.0; scale = Matrix[[sx,0], [0, sy]] scale*unit # => [2.0, 3.0]: scaled point