Skip to content

Commit b2238d9

Browse files
committed
Update readme
1 parent 7d3e993 commit b2238d9

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func Ln[T Number](start, end Point[T]) Line[T]
8181
func Pol[T Number](vertices []Point[T]) Polygon[T]
8282
func RegPol[T Number](center Point[T], size Size[T], n int, angle float64) RegularPolygon[T]
8383
func Mat(a, b, c, d, e, f float64) Matrix
84+
func Pad[T Number](top, right, bottom, left T) Padding[T]
8485
```
8586

8687
### Point
@@ -183,19 +184,24 @@ type Matrix struct {
183184
// [0 0 1] implicit third row
184185
}
185186

186-
// Operations
187+
// Matrix operations
187188
func (m Matrix) Multiply(n Matrix) Matrix
188189
func (m Matrix) Inverse() Matrix
189190
func (m Matrix) Determinant() float64
190191

191-
// Transform builders
192-
func Translate(deltaX, deltaY float64) Matrix
192+
// Transformations
193+
func (m Matrix) Translate(deltaX, deltaY float64) Matrix
194+
func (m Matrix) Untranslate(deltaX, deltaY float64) Matrix
195+
func (m Matrix) PreTranslate(deltaX, deltaY float64)
193196
func (m Matrix) Rotate(angle float64) Matrix
197+
func (m Matrix) PreRotate(angle float64) Matrix
194198
func (m Matrix) Scale(factorX, factorY float64) Matrix
199+
func (m Matrix) Unscale(factorX, factorY float64) Matrix
195200

196201
// Utilities
197202
func (m Matrix) Equal(matrix Matrix) bool
198203
func (m Matrix) IsZero() bool
204+
func (m Matrix) String() string
199205
```
200206

201207
### Size

matrix.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package geom
22

33
import (
4+
"fmt"
45
"math"
56
)
67

@@ -111,9 +112,10 @@ func (m Matrix) Equal(matrix Matrix) bool {
111112
// IsZero checks if values are zero.
112113
func (m Matrix) IsZero() bool { return m.Equal(Matrix{}) }
113114

114-
//func (m Matrix) String() string {
115-
// return fmt.Sprintf("[[%.2f, %.2f, %.2f], [%.2f, %.2f, %.2f]]", m.A, m.B, m.Circ, m.D, m.E, m.F)
116-
//}
115+
// String returns a string representation of the Matrix.
116+
func (m Matrix) String() string {
117+
return fmt.Sprintf("[[%.2f, %.2f, %.2f], [%.2f, %.2f, %.2f]]", m.A, m.B, m.C, m.D, m.E, m.F)
118+
}
117119

118120
// IdentityMatrix creates a new identity matrix.
119121
func IdentityMatrix() Matrix {

0 commit comments

Comments
 (0)