Documentation
¶
Index ¶
- Variables
- func Cos(a Angle) float64
- func Sin(a Angle) float64
- func Tan(a Angle) float64
- func Transform[E Element](in E, fns ...Transformation) E
- type Angle
- type AngleFromUp
- type BottomLeftLineTagOpt
- type BottomLeftPointTagOpt
- type BottomLineTagOpt
- type BottomRightLineTagOpt
- type BottomRightPointTagOpt
- type BoundingBox
- type CenterPointTagOpt
- type Circle
- type CircleArc
- type CircleOpt
- type Direction
- type Element
- type Figure
- type HexagonOpt
- type LeftLineTagOpt
- type LeftPointTagOpt
- type Line
- type LineTag
- type MultiPath
- type Path
- type PathFigure
- type Point
- type PointTag
- type Ray
- type RayAngle
- type RectangleOpt
- type RightLineTagOpt
- type RightPointTagOpt
- type RoundAllCornersOpt
- type RoundBottomLeftCornerOpt
- type RoundBottomRightCornerOpt
- type RoundTopLeftCornerOpt
- type RoundTopRightCornerOpt
- type TopLeftLineTagOpt
- type TopLeftPointTagOpt
- type TopLineTagOpt
- type TopRightLineTagOpt
- type TopRightPointTagOpt
- type Transformation
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RayHexTopRight = Ray{60} RayHexTopLeft = Ray{300} RayHexBottomRight = Ray{120} RayHexBottomLeft = Ray{240} )
View Source
var ( RayUp = Ray{0} RayRight = Ray{90} RayDown = Ray{180} RayLeft = Ray{270} )
Functions ¶
func Transform ¶ added in v0.4.0
func Transform[E Element](in E, fns ...Transformation) E
Types ¶
type AngleFromUp ¶ added in v0.4.0
type AngleFromUp struct {
// contains filtered or unexported fields
}
func NewAngleFromUp ¶ added in v0.4.0
func NewAngleFromUp(angle Angle, direction Direction) AngleFromUp
func (AngleFromUp) Angle ¶ added in v0.4.0
func (a AngleFromUp) Angle() Angle
func (AngleFromUp) Direction ¶ added in v0.4.0
func (a AngleFromUp) Direction() Direction
type BottomLeftLineTagOpt ¶ added in v0.4.0
type BottomLeftLineTagOpt lineTagOpt
func TagBottomLeftLine ¶ added in v0.4.0
func TagBottomLeftLine(t *LineTag) BottomLeftLineTagOpt
func (BottomLeftLineTagOpt) Hexagon ¶ added in v0.4.0
func (opt BottomLeftLineTagOpt) Hexagon(h *hexagonTags)
type BottomLeftPointTagOpt ¶ added in v0.4.0
type BottomLeftPointTagOpt pointTagOpt
func TagBottomLeftPoint ¶ added in v0.4.0
func TagBottomLeftPoint(t *PointTag) BottomLeftPointTagOpt
func (BottomLeftPointTagOpt) Hexagon ¶ added in v0.4.0
func (opt BottomLeftPointTagOpt) Hexagon(h *hexagonTags)
func (BottomLeftPointTagOpt) Rectangle ¶ added in v0.4.0
func (opt BottomLeftPointTagOpt) Rectangle(r *rectangleOpts)
type BottomLineTagOpt ¶ added in v0.4.0
type BottomLineTagOpt lineTagOpt
func TagBottomLine ¶ added in v0.4.0
func TagBottomLine(t *LineTag) BottomLineTagOpt
func (BottomLineTagOpt) Hexagon ¶ added in v0.4.0
func (opt BottomLineTagOpt) Hexagon(h *hexagonTags)
func (BottomLineTagOpt) Rectangle ¶ added in v0.4.0
func (opt BottomLineTagOpt) Rectangle(r *rectangleOpts)
type BottomRightLineTagOpt ¶ added in v0.4.0
type BottomRightLineTagOpt lineTagOpt
func TagBottomRightLine ¶ added in v0.4.0
func TagBottomRightLine(t *LineTag) BottomRightLineTagOpt
func (BottomRightLineTagOpt) Hexagon ¶ added in v0.4.0
func (opt BottomRightLineTagOpt) Hexagon(h *hexagonTags)
type BottomRightPointTagOpt ¶ added in v0.4.0
type BottomRightPointTagOpt pointTagOpt
func TagBottomRightPoint ¶ added in v0.4.0
func TagBottomRightPoint(t *PointTag) BottomRightPointTagOpt
func (BottomRightPointTagOpt) Hexagon ¶ added in v0.4.0
func (opt BottomRightPointTagOpt) Hexagon(h *hexagonTags)
func (BottomRightPointTagOpt) Rectangle ¶ added in v0.4.0
func (opt BottomRightPointTagOpt) Rectangle(r *rectangleOpts)
type BoundingBox ¶ added in v0.4.0
type BoundingBox struct {
Min, Max *Point
}
func (BoundingBox) BottomLeft ¶ added in v0.4.0
func (bb BoundingBox) BottomLeft() *Point
func (BoundingBox) BottomRight ¶ added in v0.4.0
func (bb BoundingBox) BottomRight() *Point
func (BoundingBox) Center ¶ added in v0.4.0
func (bb BoundingBox) Center() *Point
func (BoundingBox) Height ¶ added in v0.4.0
func (bb BoundingBox) Height() float64
func (BoundingBox) TopLeft ¶ added in v0.4.0
func (bb BoundingBox) TopLeft() *Point
func (BoundingBox) TopRight ¶ added in v0.4.0
func (bb BoundingBox) TopRight() *Point
func (BoundingBox) Width ¶ added in v0.4.0
func (bb BoundingBox) Width() float64
type CenterPointTagOpt ¶ added in v0.4.0
type CenterPointTagOpt pointTagOpt
func TagCenterPoint ¶ added in v0.4.0
func TagCenterPoint(t *PointTag) CenterPointTagOpt
func (CenterPointTagOpt) Circle ¶ added in v0.4.0
func (t CenterPointTagOpt) Circle(opts *circleOpts)
type Circle ¶ added in v0.4.0
type Circle struct {
// contains filtered or unexported fields
}
func (*Circle) BoundingBox ¶ added in v0.4.0
func (c *Circle) BoundingBox() BoundingBox
type CircleArc ¶ added in v0.4.0
type CircleArc struct {
// contains filtered or unexported fields
}
func NewCircleArc ¶ added in v0.4.0
func (*CircleArc) BoundingBox ¶ added in v0.4.0
func (c *CircleArc) BoundingBox() BoundingBox
type Element ¶ added in v0.4.0
type Element interface {
BoundingBox() BoundingBox
// contains filtered or unexported methods
}
type Figure ¶ added in v0.4.0
type Figure interface {
Element
// contains filtered or unexported methods
}
A figure is a closed shape.
type HexagonOpt ¶ added in v0.4.0
type HexagonOpt interface {
Hexagon(*hexagonTags)
}
type LeftLineTagOpt ¶ added in v0.4.0
type LeftLineTagOpt lineTagOpt
func TagLeftLine ¶ added in v0.4.0
func TagLeftLine(t *LineTag) LeftLineTagOpt
func (LeftLineTagOpt) Rectangle ¶ added in v0.4.0
func (opt LeftLineTagOpt) Rectangle(r *rectangleOpts)
type LeftPointTagOpt ¶ added in v0.4.0
type LeftPointTagOpt pointTagOpt
func TagLeftPoint ¶ added in v0.4.0
func TagLeftPoint(t *PointTag) LeftPointTagOpt
func (LeftPointTagOpt) Hexagon ¶ added in v0.4.0
func (opt LeftPointTagOpt) Hexagon(h *hexagonTags)
type Line ¶ added in v0.4.0
type Line struct {
// contains filtered or unexported fields
}
func (*Line) BoundingBox ¶ added in v0.4.0
func (l *Line) BoundingBox() BoundingBox
type MultiPath ¶ added in v0.4.0
type MultiPath struct {
// contains filtered or unexported fields
}
func NewMultiPath ¶ added in v0.4.0
func (*MultiPath) BoundingBox ¶ added in v0.4.0
func (mp *MultiPath) BoundingBox() BoundingBox
type PathFigure ¶ added in v0.4.0
type PathFigure struct {
// contains filtered or unexported fields
}
A figure is a collection of paths that form a closed shape.
func Hexagon ¶
func Hexagon(r float64, opts ...HexagonOpt) *PathFigure
func NewPathFigure ¶ added in v0.4.0
func NewPathFigure(paths ...Path) *PathFigure
NewPathFigure() creates a new figure from the given paths. Returns nil if the paths do not form a closed shape.
func NewRectangle ¶ added in v0.4.0
func NewRectangle(width, height float64, inOpts ...RectangleOpt) *PathFigure
func (*PathFigure) BoundingBox ¶ added in v0.4.0
func (f *PathFigure) BoundingBox() BoundingBox
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func (*Point) BoundingBox ¶ added in v0.4.0
func (p *Point) BoundingBox() BoundingBox
type RayAngle ¶ added in v0.4.0
type RayAngle struct {
// contains filtered or unexported fields
}
func NewRayAngle ¶ added in v0.4.0
type RectangleOpt ¶ added in v0.4.0
type RectangleOpt interface {
Rectangle(*rectangleOpts)
}
type RightLineTagOpt ¶ added in v0.4.0
type RightLineTagOpt lineTagOpt
func TagRightLine ¶ added in v0.4.0
func TagRightLine(t *LineTag) RightLineTagOpt
func (RightLineTagOpt) Rectangle ¶ added in v0.4.0
func (opt RightLineTagOpt) Rectangle(r *rectangleOpts)
type RightPointTagOpt ¶ added in v0.4.0
type RightPointTagOpt pointTagOpt
func TagRightPoint ¶ added in v0.4.0
func TagRightPoint(t *PointTag) RightPointTagOpt
func (RightPointTagOpt) Hexagon ¶ added in v0.4.0
func (opt RightPointTagOpt) Hexagon(h *hexagonTags)
type RoundAllCornersOpt ¶ added in v0.4.0
type RoundAllCornersOpt roundCornerOpt
func RoundAllCorners ¶ added in v0.4.0
func RoundAllCorners(radius float64) RoundAllCornersOpt
func (RoundAllCornersOpt) Rectangle ¶ added in v0.4.0
func (opt RoundAllCornersOpt) Rectangle(r *rectangleOpts)
type RoundBottomLeftCornerOpt ¶ added in v0.4.0
type RoundBottomLeftCornerOpt roundCornerOpt
func RoundBottomLeftCorner ¶ added in v0.4.0
func RoundBottomLeftCorner(radius float64) RoundBottomLeftCornerOpt
func (RoundBottomLeftCornerOpt) Rectangle ¶ added in v0.4.0
func (opt RoundBottomLeftCornerOpt) Rectangle(r *rectangleOpts)
type RoundBottomRightCornerOpt ¶ added in v0.4.0
type RoundBottomRightCornerOpt roundCornerOpt
func RoundBottomRightCorner ¶ added in v0.4.0
func RoundBottomRightCorner(radius float64) RoundBottomRightCornerOpt
func (RoundBottomRightCornerOpt) Rectangle ¶ added in v0.4.0
func (opt RoundBottomRightCornerOpt) Rectangle(r *rectangleOpts)
type RoundTopLeftCornerOpt ¶ added in v0.4.0
type RoundTopLeftCornerOpt roundCornerOpt
func RoundTopLeftCorner ¶ added in v0.4.0
func RoundTopLeftCorner(radius float64) RoundTopLeftCornerOpt
func (RoundTopLeftCornerOpt) Rectangle ¶ added in v0.4.0
func (opt RoundTopLeftCornerOpt) Rectangle(r *rectangleOpts)
type RoundTopRightCornerOpt ¶ added in v0.4.0
type RoundTopRightCornerOpt roundCornerOpt
func RoundTopRightCorner ¶ added in v0.4.0
func RoundTopRightCorner(radius float64) RoundTopRightCornerOpt
func (RoundTopRightCornerOpt) Rectangle ¶ added in v0.4.0
func (opt RoundTopRightCornerOpt) Rectangle(r *rectangleOpts)
type TopLeftLineTagOpt ¶ added in v0.4.0
type TopLeftLineTagOpt lineTagOpt
func TagTopLeftLine ¶ added in v0.4.0
func TagTopLeftLine(t *LineTag) TopLeftLineTagOpt
func (TopLeftLineTagOpt) Hexagon ¶ added in v0.4.0
func (opt TopLeftLineTagOpt) Hexagon(h *hexagonTags)
type TopLeftPointTagOpt ¶ added in v0.4.0
type TopLeftPointTagOpt pointTagOpt
func TagTopLeftPoint ¶ added in v0.4.0
func TagTopLeftPoint(t *PointTag) TopLeftPointTagOpt
func (TopLeftPointTagOpt) Hexagon ¶ added in v0.4.0
func (opt TopLeftPointTagOpt) Hexagon(h *hexagonTags)
func (TopLeftPointTagOpt) Rectangle ¶ added in v0.4.0
func (opt TopLeftPointTagOpt) Rectangle(r *rectangleOpts)
type TopLineTagOpt ¶ added in v0.4.0
type TopLineTagOpt lineTagOpt
func TagTopLine ¶ added in v0.4.0
func TagTopLine(t *LineTag) TopLineTagOpt
func (TopLineTagOpt) Hexagon ¶ added in v0.4.0
func (opt TopLineTagOpt) Hexagon(h *hexagonTags)
func (TopLineTagOpt) Rectangle ¶ added in v0.4.0
func (opt TopLineTagOpt) Rectangle(r *rectangleOpts)
type TopRightLineTagOpt ¶ added in v0.4.0
type TopRightLineTagOpt lineTagOpt
func TagTopRightLine ¶ added in v0.4.0
func TagTopRightLine(t *LineTag) TopRightLineTagOpt
func (TopRightLineTagOpt) Hexagon ¶ added in v0.4.0
func (opt TopRightLineTagOpt) Hexagon(h *hexagonTags)
type TopRightPointTagOpt ¶ added in v0.4.0
type TopRightPointTagOpt pointTagOpt
func TagTopRightPoint ¶ added in v0.4.0
func TagTopRightPoint(t *PointTag) TopRightPointTagOpt
func (TopRightPointTagOpt) Hexagon ¶ added in v0.4.0
func (opt TopRightPointTagOpt) Hexagon(h *hexagonTags)
func (TopRightPointTagOpt) Rectangle ¶ added in v0.4.0
func (opt TopRightPointTagOpt) Rectangle(r *rectangleOpts)
type Transformation ¶ added in v0.4.0
type Transformation func(Element)
func Rotate ¶ added in v0.3.7
func Rotate(angle Angle, dir Direction) Transformation
func TranslateRay ¶ added in v0.4.0
func TranslateRay(ray Ray, distance float64) Transformation
func TranslateXY ¶ added in v0.4.0
func TranslateXY(dx, dy float64) Transformation
Click to show internal directories.
Click to hide internal directories.