added matrix function

It takes arguments in the same order as in SVG