geometry

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rect

type Rect struct {
	X      float64
	Y      float64
	Width  float64
	Height float64
}

Rect represents a rectangle.

func (Rect) Intersects

func (r Rect) Intersects(other Rect) bool

Intersects returns true if the rectangle intersects with another rectangle.

func (Rect) MaxX

func (r Rect) MaxX() float64

MaxX returns the maximum X value of the rectangle.

func (Rect) MaxY

func (r Rect) MaxY() float64

MaxY returns the maximum Y value of the rectangle.

func (Rect) String

func (r Rect) String() string

String returns a string representation of the rectangle.

type Side

type Side int

Side represents the side of the board.

const (
	// Undefined represents an undefined side.
	Undefined Side = iota
	// Right is the right side of the board.
	Right
	// Left is the left side of the board.
	Left
)

type Vector

type Vector struct {
	X float64
	Y float64
}

Vector represents a 2D vector.

func (Vector) String

func (v Vector) String() string

String returns a string representation of the vector.

Jump to

Keyboard shortcuts

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