geom

package
v0.0.0-...-8db07eb Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Angle

type Angle float64

func (Angle) Abs

func (a Angle) Abs() Angle

func (Angle) Cos

func (a Angle) Cos() float64

func (Angle) Normalize

func (a Angle) Normalize() Angle

func (Angle) Sin

func (a Angle) Sin() float64

func (Angle) String

func (a Angle) String() string

type Rectangle

type Rectangle struct {
	Min, Max Vec2
}

func FromRectangle

func FromRectangle(r image.Rectangle) Rectangle

func Rect

func Rect(x, y, w, h float64) Rectangle

func (Rectangle) Add

func (r Rectangle) Add(v Vec2) Rectangle

func (Rectangle) Center

func (r Rectangle) Center() Vec2

func (Rectangle) Empty

func (r Rectangle) Empty() bool

func (Rectangle) Overlaps

func (r Rectangle) Overlaps(s Rectangle) bool

func (Rectangle) Round

func (r Rectangle) Round() Rectangle

func (Rectangle) Size

func (r Rectangle) Size() Vec2

func (Rectangle) Sub

func (r Rectangle) Sub(v Vec2) Rectangle

type Vec2

type Vec2 [2]float64

func FromPoint

func FromPoint(pt image.Point) Vec2

func (Vec2) Add

func (v Vec2) Add(u Vec2) Vec2

func (Vec2) Angle

func (v Vec2) Angle() Angle

func (Vec2) Cross

func (v Vec2) Cross(u Vec2) float64

func (Vec2) Distance

func (v Vec2) Distance(u Vec2) float64

func (Vec2) Div

func (v Vec2) Div(k float64) Vec2

func (Vec2) Dot

func (v Vec2) Dot(u Vec2) float64

func (Vec2) Length

func (v Vec2) Length() float64

func (Vec2) Mul

func (v Vec2) Mul(k float64) Vec2

func (Vec2) Normalize

func (v Vec2) Normalize() Vec2

func (Vec2) Rotate

func (v Vec2) Rotate(angle Angle) Vec2

func (Vec2) Round

func (v Vec2) Round() image.Point

func (Vec2) String

func (v Vec2) String() string

func (Vec2) Sub

func (v Vec2) Sub(u Vec2) Vec2

func (Vec2) Unpack

func (v Vec2) Unpack() (float64, float64)

Jump to

Keyboard shortcuts

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