geom

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package geom implements a basic 2-D geometry library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineSegment

type LineSegment[T Number] struct {
	Min, Max Point[T]
}

func LineSeg

func LineSeg[T Number](x0, y0, x1, y1 T) LineSegment[T]

type Point

type Point[T Number] struct {
	X, Y T
}

func Pt

func Pt[T Number](x, y T) Point[T]

func (Point[T]) Add

func (p Point[T]) Add(q Point[T]) Point[T]

func (Point[T]) String

func (p Point[T]) String() string

func (Point[T]) ToSize

func (p Point[T]) ToSize() Size[T]

type Range

type Range[T Number] struct {
	Start, End T
}

type Rectangle

type Rectangle[T Number] struct {
	Min, Max Point[T]
}

func Rect

func Rect[T Number](x0, y0, x1, y1 T) Rectangle[T]

func (Rectangle[T]) Size

func (rt Rectangle[T]) Size() Size[T]

func (Rectangle[T]) String

func (rt Rectangle[T]) String() string

type RotatedRect

type RotatedRect[T Number] struct {
	Center Point[T]
	Size   Size[T]
	Angle  float64
}

type Size

type Size[T Number] struct {
	Width, Height T
}

Jump to

Keyboard shortcuts

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