Documentation
¶
Overview ¶
Package geom provides 2D geometry primitives.
Types:
- Vec2: 2D vector with Scan/String for serialization
- Rect: rectangle (X, Y, Width, Height) with intersection, union, containment
- Mat3x2: 2D affine transformation matrix (translate, scale, rotate, invert)
Index ¶
- type Mat3x2
- func (m *Mat3x2) Det() (x float64)
- func (m *Mat3x2) Init(xx, yx, xy, yy, x0, y0 float64)
- func (m *Mat3x2) InitIdentity()
- func (m *Mat3x2) InitRotate(radians float64)
- func (m *Mat3x2) InitScale(sx, sy float64)
- func (m *Mat3x2) InitTranslate(tx, ty float64)
- func (m *Mat3x2) Invert() bool
- func (a *Mat3x2) Multiply(b *Mat3x2) (c Mat3x2)
- func (a *Mat3x2) MultiplyWidth(b *Mat3x2)
- func (m *Mat3x2) Rotate(radians float64)
- func (m *Mat3x2) Scale(sx, sy float64)
- func (m *Mat3x2) Transform(x, y float64) (x1, y1 float64)
- func (m *Mat3x2) TransformVec(x, y float64) (x1, y1 float64)
- func (m *Mat3x2) Translate(tx, ty float64)
- type Rect
- func (a Rect) AdjustCopy(dx1, dx2, dy1, dy2 float64) (r Rect)
- func (a Rect) Area() float64
- func (a Rect) Bottom() float64
- func (a Rect) Center() (x, y float64)
- func (a Rect) Center1() Vec2
- func (a Rect) Contains(x, y float64) bool
- func (a Rect) ExpandCopy(offset float64) Rect
- func (a Rect) IntersectCopy(b Rect) (ret Rect)
- func (a Rect) IsEmpty() bool
- func (a Rect) IsIntersects(b Rect) bool
- func (a Rect) IsNormal() bool
- func (a Rect) IsZero() bool
- func (a Rect) Left() float64
- func (a *Rect) Normalize()
- func (a Rect) NormalizeCopy() (r Rect)
- func (a Rect) Right() float64
- func (this *Rect) Scan(state fmt.ScanState, verb rune) error
- func (a Rect) ShrinkCopy(offset float64) Rect
- func (this *Rect) Size() (float64, float64)
- func (a Rect) String() string
- func (a Rect) Top() float64
- func (a Rect) UniteCopy(b Rect) (ret Rect)
- type Vec2
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mat3x2 ¶
type Mat3x2 struct {
Xx, Yx, Xy, Yy, X0, Y0 float64
}
3x2的平面变换矩阵, 兼容cairo库
func (*Mat3x2) InitIdentity ¶
func (m *Mat3x2) InitIdentity()
func (*Mat3x2) InitRotate ¶
func (*Mat3x2) InitTranslate ¶
func (*Mat3x2) MultiplyWidth ¶
func (*Mat3x2) TransformVec ¶
type Rect ¶
func (Rect) AdjustCopy ¶
func (Rect) ExpandCopy ¶
func (Rect) IntersectCopy ¶
func (Rect) IsIntersects ¶
func (Rect) NormalizeCopy ¶
func (Rect) ShrinkCopy ¶
Click to show internal directories.
Click to hide internal directories.