geometry

package
v0.0.0-...-2c87074 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Unlicense Imports: 0 Imported by: 4

Documentation

Overview

Package geometry implements basic geometric types and operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X, Y float64
}

A Point is an X, Y coordinate pair. The axes increase right and down.

func Pt

func Pt(x, y float64) Point

Pt is shorthand for Point{X, Y}.

type Rectangle

type Rectangle struct {
	Min, Max Point
}

A Rectangle contains the points with Min.X <= X < Max.X, Min.Y <= Y < Max.Y.

func Rect

func Rect(x0, y0, x1, y1 float64) Rectangle

Rect is shorthand for Rectangle{Pt(x0, y0), Pt(x1, y1)}.

func (Rectangle) Dx

func (r Rectangle) Dx() float64

Dx returns r's width.

func (Rectangle) Dy

func (r Rectangle) Dy() float64

Dy returns r's height.

Jump to

Keyboard shortcuts

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