matrices function

Work with homogeneous coordinates