Documentation
¶
Index ¶
- Variables
- func Coord(x, y float64) geom.Coord
- func CoordX(x float64) geom.Coord
- func CoordY(y float64) geom.Coord
- func Degrees(radians float64) float64
- func Normalize(rad float64) float64
- func Radians(degrees int) float64
- func RadiansF(degrees float64) float64
- type Arc
- func (a Arc) Bounds() Rectangle
- func (a Arc) Centroid() Point
- func (a Arc) Draw(g *gg.Context)
- func (a Arc) DrawCenter(g *gg.Context)
- func (a Arc) DrawOutline(g *gg.Context)
- func (a Arc) Intersect(geom Geometry) bool
- func (a Arc) Pos() Point
- func (a *Arc) Rotate(rad float64)
- func (a *Arc) RotateAround(rad float64, anchor Point)
- func (a *Arc) Translate(p Point)
- type Circle
- func (c Circle) Bounds() Rectangle
- func (c Circle) Centroid() Point
- func (c Circle) Draw(g *gg.Context)
- func (c Circle) DrawCenter(g *gg.Context)
- func (c Circle) DrawOutline(g *gg.Context)
- func (c *Circle) Intersect(geom Geometry) bool
- func (c Circle) Pos() Point
- func (Circle) Rotate(rad float64)
- func (c *Circle) RotateAround(rad float64, anchor Point)
- func (c *Circle) Translate(p Point)
- type Geometry
- type Group
- func (g *Group) Add(triangle *Triangle)
- func (g Group) Bounds() Rectangle
- func (g Group) Centroid() Point
- func (g Group) Draw(ctx *gg.Context)
- func (g Group) DrawCenter(ctx *gg.Context)
- func (g Group) DrawOutline(ctx *gg.Context)
- func (g *Group) Intersect(ge Geometry) bool
- func (g Group) Pos() Point
- func (g *Group) Rotate(rad float64)
- func (g *Group) RotateAround(rad float64, pivot Point)
- func (g *Group) SetPos(pos Point)
- func (g *Group) Translate(p Point)
- type Line
- func (l Line) Bounds() Rectangle
- func (l Line) Centroid() Point
- func (l Line) Draw(g *gg.Context)
- func (l Line) DrawCenter(g *gg.Context)
- func (l Line) DrawOutline(g *gg.Context)
- func (l Line) Intersect(ge Geometry) bool
- func (l Line) Pos() Point
- func (l *Line) Rotate(rad float64)
- func (l *Line) RotateAround(rad float64, pivot Point)
- func (l *Line) Translate(p Point)
- type Point
- func (p Point) Add(p2 Point) Point
- func (p Point) AddXY(x, y float64) Point
- func (p Point) Bounds() Rectangle
- func (p Point) Centroid() Point
- func (p Point) DistanceTo(p2 Point) float64
- func (p Point) Draw(g *gg.Context)
- func (p Point) DrawCenter(g *gg.Context)
- func (p Point) DrawOutline(g *gg.Context)
- func (p *Point) Intersect(ge Geometry) bool
- func (p Point) Invert() Point
- func (p Point) Pos() Point
- func (p *Point) Rotate(rad float64)
- func (p *Point) RotateAround(rad float64, pivot Point)
- func (p Point) ToCoord() geom.Coord
- func (p1 *Point) Translate(p Point)
- type Point3D
- type Rectangle
- type Triangle
- func (t Triangle) Bounds() Rectangle
- func (t *Triangle) Centroid() Point
- func (t *Triangle) Draw(g *gg.Context)
- func (t *Triangle) DrawCenter(g *gg.Context)
- func (t *Triangle) DrawOutline(g *gg.Context)
- func (t *Triangle) Intersect(ge Geometry) bool
- func (t *Triangle) Pos() Point
- func (t *Triangle) Rotate(rad float64)
- func (t *Triangle) RotateAround(rad float64, pivot Point)
- func (t *Triangle) Scale(ratio float64)
- func (t *Triangle) Translate(p Point)
Constants ¶
This section is empty.
Variables ¶
View Source
var TwoPi = math.Pi * 2
View Source
var (
Zero = Point{0, 0}
)
Functions ¶
Types ¶
type Geometry ¶
type Geometry interface { Pos() Point Centroid() Point Intersect(geom Geometry) bool Translate(p Point) Rotate(rad float64) RotateAround(rad float64, anchor Point) Bounds() Rectangle Draw(g *gg.Context) DrawOutline(g *gg.Context) DrawCenter(g *gg.Context) // contains filtered or unexported methods }
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (Group) DrawCenter ¶
func (Group) DrawOutline ¶
func (*Group) RotateAround ¶
type Line ¶
type Line struct {
Start, End Point
}
func (Line) DrawCenter ¶
func (Line) DrawOutline ¶
func (*Line) RotateAround ¶
type Point ¶
type Point struct {
X, Y float64
}
func (Point) DistanceTo ¶
func (Point) DrawCenter ¶
func (Point) DrawOutline ¶
func (*Point) RotateAround ¶
type Triangle ¶
type Triangle struct { Orientation int32 // contains filtered or unexported fields }
func (*Triangle) DrawCenter ¶
func (*Triangle) DrawOutline ¶
func (*Triangle) RotateAround ¶
Click to show internal directories.
Click to hide internal directories.