Documentation
¶
Overview ¶
Package affine2d implements 2D affine transformations.
Index ¶
- type Transform
- func (t *Transform) Float64Array() [6]float64
- func (t *Transform) Float64Slice() []float64
- func (t *Transform) Inverse() *Transform
- func (t *Transform) Multiply(u *Transform) *Transform
- func (t *Transform) Rotate(theta float64) *Transform
- func (t *Transform) Scale(sx, sy float64) *Transform
- func (t *Transform) Then(u *Transform) *Transform
- func (t *Transform) Transform(p []float64) []float64
- func (t *Transform) TransformDirection(v []float64) []float64
- func (t *Transform) TransformInPlace(p []float64) []float64
- func (t *Transform) TransformSlice(ps [][]float64) [][]float64
- func (t *Transform) TransformSliceInPlace(ps [][]float64) [][]float64
- func (t *Transform) TransformXY(x, y float64) (float64, float64)
- func (t *Transform) Translate(tx, ty float64) *Transform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transform ¶
type Transform struct {
// contains filtered or unexported fields
}
A Transform is a 2D affine transform.
func Delta ¶
Delta returns the transform that transforms the origin to origin and the unit X vector to unitX.
func NewTransform ¶
NewTransform returns a new transform with the given coefficients.
func (*Transform) Float64Array ¶
Float64Array returns the coefficients of t's matrix in row order.
func (*Transform) Float64Slice ¶
Float64Slice returns the coefficients of t's matrix in row order. The returned slice must not be modified.
func (*Transform) TransformDirection ¶
TransformDirection transforms the direction v.
func (*Transform) TransformInPlace ¶ added in v0.0.2
TransformInPlace transforms a single vector in place.
func (*Transform) TransformSlice ¶
TransformSlice transforms a slice of vectors.
func (*Transform) TransformSliceInPlace ¶ added in v0.0.2
TransformSliceInPlace transforms a slice of vectors in place.
func (*Transform) TransformXY ¶
TransformXY transforms an X-Y coordinate.