Add comments

This commit is contained in:
Hajime Hoshi 2016-02-15 23:08:10 +09:00
parent baaa8734b9
commit 67f837ff18
2 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,7 @@ func (c *ColorM) Element(i, j int) float64 {
} }
// Concat multiplies a color matrix with the other color matrix. // Concat multiplies a color matrix with the other color matrix.
// This is same as muptiplying the matrix other and the matrix c in this order.
func (c *ColorM) Concat(other ColorM) { func (c *ColorM) Concat(other ColorM) {
if !c.initialized { if !c.initialized {
c.initialize() c.initialize()

View File

@ -51,6 +51,7 @@ func (g *GeoM) Element(i, j int) float64 {
} }
// Concat multiplies a geometry matrix with the other geometry matrix. // Concat multiplies a geometry matrix with the other geometry matrix.
// This is same as muptiplying the matrix other and the matrix g in this order.
func (g *GeoM) Concat(other GeoM) { func (g *GeoM) Concat(other GeoM) {
if !g.initialized { if !g.initialized {
g.initialize() g.initialize()
@ -90,6 +91,7 @@ func (g *GeoM) Translate(tx, ty float64) {
g.es[1][2] += ty g.es[1][2] += ty
} }
// Rotate rotates the matrix by theta.
func (g *GeoM) Rotate(theta float64) { func (g *GeoM) Rotate(theta float64) {
sin, cos := math.Sincos(theta) sin, cos := math.Sincos(theta)
g.Concat(GeoM{ g.Concat(GeoM{