Added matrix calculations to ShapeTriangle