Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bounds ¶
type Bounds struct {
// contains filtered or unexported fields
}
Bounds represents the top left and bottom right coordinates of a shape
type Circle ¶
type Circle struct {
// contains filtered or unexported fields
}
Circle represents a circle, used only to generate a regular polygon, so no much to see here :)
func (*Circle) CalcCircumference ¶
CalcCircumference returns the circle's circumference
func (*Circle) GetPosition ¶
GetPosition returns the position of circle's center
type IrRegPolygon ¶
type IrRegPolygon struct {
// contains filtered or unexported fields
}
IrRegPolygon represents an irregular polygon
func NewIrRegPolygon ¶
func NewIrRegPolygon(numSides int, vertices ...Point2) *IrRegPolygon
NewIrRegPolygon returns a new IrRegPolygon instance
func (*IrRegPolygon) GetNumSides ¶
func (p *IrRegPolygon) GetNumSides() int
GetNumSides returns number of sides the polygon has
func (*IrRegPolygon) GetVertices ¶
func (p *IrRegPolygon) GetVertices() []Point2
GetVertices returns a slice of utils.Point2 that represents the vertices of the polygon
func (*IrRegPolygon) SetVertices ¶
func (p *IrRegPolygon) SetVertices(v []Point2)
SetVertices it's written on the box :)
type Polygon ¶
type Polygon interface { // GetNumSides returns number of sides the polygon has GetNumSides() int // GetVertices returns a slice of utils.Point2 that represents the vertices of the polygon GetVertices() []Point2 // SetVertices it's written on the box :) SetVertices(v []Point2) }
Polygon well it's a polygon big news :]
type RegPolygon ¶
type RegPolygon struct {
// contains filtered or unexported fields
}
RegPolygon represents a regular polygon
func NewPolygon ¶
func NewPolygon(numSides int, sideLength float64, vertices ...Point2) *RegPolygon
NewPolygon returns a new Polygon instance
func (*RegPolygon) GetInnerSideAngle ¶
func (p *RegPolygon) GetInnerSideAngle() float64
GetInnerSideAngle returns the angle between sides in radians
func (*RegPolygon) GetNumSides ¶
func (p *RegPolygon) GetNumSides() int
GetNumSides returns number of sides the polygon has
func (*RegPolygon) GetSideLength ¶
func (p *RegPolygon) GetSideLength() float64
GetSideLength return polygon's side length
func (*RegPolygon) GetVertices ¶
func (p *RegPolygon) GetVertices() []Point2
GetVertices returns a slice of utils.Point2 that represents the vertices of the polygon
func (*RegPolygon) SetVertices ¶
func (p *RegPolygon) SetVertices(v []Point2)
SetVertices it's written on the box :)