Documentation ¶
Index ¶
- type Matrix
- func (m *Matrix) Angle() float64
- func (m *Matrix) Clone() Matrix
- func (m *Matrix) Concat(b Matrix)
- func (m Matrix) Mult(b Matrix) Matrix
- func (m *Matrix) Rotate(angle float64)
- func (m *Matrix) Scale(x, y float64)
- func (m *Matrix) ScalingFactorX() float64
- func (m *Matrix) ScalingFactorY() float64
- func (m *Matrix) Set(a, b, c, d, tx, ty float64)
- func (m *Matrix) Shear(x, y float64)
- func (m Matrix) String() string
- func (m *Matrix) Transform(x, y float64) (float64, float64)
- func (m *Matrix) Translate(x, y float64)
- func (m *Matrix) Translation() (float64, float64)
- func (m *Matrix) Unrealistic() bool
- type Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix [9]float64
Matrix is a linear transform matrix in homogenous coordinates. PDF coordinate transforms are always affine so we only need 6 of these. See newMatrix.
func NewMatrix ¶
NewMatrix returns an affine transform matrix laid out in homogenous coordinates as
a b 0 c d 0 tx ty 1
func RotationMatrix ¶
RotationMatrix returns a matrix that rotates by angle `angle`, specified in radians.
func ScaleMatrix ¶
ScaleMatrix returns a matrix that scales by `x`,`y`.
func ShearMatrix ¶
ShearMatrix returns a matrix that shears `x`,`y`.
func TranslationMatrix ¶
TranslationMatrix returns a matrix that translates by `tx`,`ty`.
func (*Matrix) Concat ¶
Concat sets `m` to `b` × `m`. `b` needs to be created by newMatrix. i.e. It must be an affine transform.
b00 b01 0 m00 m01 0 b00*m00 + b01*m01 b00*m10 + b01*m11 0 b10 b11 0 × m10 m11 0 ➔ b10*m00 + b11*m01 b10*m10 + b11*m11 0 b20 b21 1 m20 m21 1 b20*m00 + b21*m10 + m20 b20*m01 + b21*m11 + m21 1
func (*Matrix) ScalingFactorX ¶
ScalingFactorX returns the X scaling of the affine transform.
func (*Matrix) ScalingFactorY ¶
ScalingFactorY returns the Y scaling of the affine transform.
func (*Matrix) Translate ¶
Translate appends a translation of `x`,`y` to `m`. m.Translate(dx, dy) is equivalent to m.Concat(NewMatrix(1, 0, 0, 1, dx, dy))
func (*Matrix) Translation ¶
Translation returns the translation part of `m`.
func (*Matrix) Unrealistic ¶
Unrealistic returns true if `m` is too small to have been created intentionally. If it returns true then `m` probably contains junk values, due to some processing error in the PDF generator or our code.
type Point ¶
Point defines a point (X,Y) in Cartesian coordinates.
func (Point) Interpolate ¶
Interpolate does linear interpolation between point `a` and `b` for value `t`.