geometry

package
v0.0.0-...-a4de9da Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculatePolygonArea

func CalculatePolygonArea(vertices Polygon) float64

func Inclusion

func Inclusion(polygon1, polygon2 []Point) bool

func SeparatingAxis

func SeparatingAxis(polygon1, polygon2 Polygon) bool

Types

type Point

type Point struct {
	X, Y float64
}

func GeneratePoints

func GeneratePoints(n int, min, maX float64) []Point

Define a function that randomly generates some points

func GeneratePolYgon

func GeneratePolYgon(n int, min, maX float64) []Point

Define a function that generates an irregular polygon and returns the vertex coordinates of the polygon

type Polygon

type Polygon struct {
	Vertices []Point
}

func GenerateRandomPolygon

func GenerateRandomPolygon(numVertices int, minX, maxX, minY, maxY float64) *Polygon

Jump to

Keyboard shortcuts

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