func (tr Matrix) TransformPoint(x, y float64) (xres, yres float64) {
	xres = x*tr[0] + y*tr[2] + tr[4]
	yres = x*tr[1] + y*tr[3] + tr[5]
	return xres, yres
}
TransformPoint applies the transformation matrix to point. It returns the point the transformed point.
package draw2d
import (
	"math"
)
type Matrix [6]float64
const (
	epsilon = 1e-6
)
func (tr Matrix) Determinant() float64 {
	return tr[0]*tr[3] - tr[1]*tr[2]
}
func (tr Matrix) Transform(points []float64) {
	for i, j := 0, 1; j < len(points); i, j = i+2, j+2 {
		x := points[i]
		y := points[j]
		points[i] = x*tr[0] + y*tr[2] + tr[4]
		points[j] = x*tr[1] + y*tr[3] + tr[5]
	}
}