f32: add Affine2D.String

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-11-05 13:36:11 +01:00
parent c62a002d21
commit 6d98eccad0
+6
View File
@@ -3,6 +3,7 @@
package f32
import (
"fmt"
"math"
)
@@ -135,3 +136,8 @@ func (a Affine2D) shear(radiansX, radiansY float32) Affine2D {
(a.a+1)*ty + a.d, a.b*ty + (a.e + 1) - 1, a.f*ty + a.f,
}
}
func (a Affine2D) String() string {
sx, hx, ox, hy, sy, oy := a.Elems()
return fmt.Sprintf("[[%f %f %f] [%f %f %f]]", sx, hx, ox, hy, sy, oy)
}