hexmap

package module
v0.0.0-...-685a5f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: CC0-1.0 Imports: 5 Imported by: 0

README

hexmap

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(vs []Point) (xs []int, ys []int)

Types

type Hexagon

type Hexagon struct {
	Center Point
	Radius float64
	ID     string
}

func (Hexagon) BoundingBox

func (hex Hexagon) BoundingBox() (a, b Point)

func (Hexagon) CopyBottom

func (hex Hexagon) CopyBottom() Hexagon

func (Hexagon) CopyBottomLeft

func (hex Hexagon) CopyBottomLeft() Hexagon

func (Hexagon) CopyBottomRight

func (hex Hexagon) CopyBottomRight() Hexagon

func (Hexagon) CopyTop

func (hex Hexagon) CopyTop() Hexagon

func (Hexagon) CopyTopLeft

func (hex Hexagon) CopyTopLeft() Hexagon

func (Hexagon) CopyTopRight

func (hex Hexagon) CopyTopRight() Hexagon

func (Hexagon) Vertices

func (hex Hexagon) Vertices() []Point

type Map

type Map struct {
	Width, Height int
	HexRadius     float64
	Units         string
}

func (Map) Contains

func (m Map) Contains(a Hexagon) bool

func (Map) Hexes

func (m Map) Hexes(populatePercent int) []*Hexagon

func (Map) WriteSVG

func (m Map) WriteSVG(f *os.File, points bool, numberHexes bool, populatePercent int)

type Point

type Point struct {
	X, Y int
}

func (Point) Equals

func (p Point) Equals(q Point) bool

func (Point) InBounds

func (p Point) InBounds(x1, y1, x2, y2 int) bool

func (Point) Plus

func (p Point) Plus(q Point) Point

func (Point) String

func (p Point) String() string

func (Point) Sub

func (p Point) Sub(q Point) Point

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL