fgeom

package
v0.0.0-...-1356a85 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NullPoint = Point{X: -math.MaxFloat32, Y: -math.MaxFloat32}

Functions

This section is empty.

Types

type Insets

type Insets struct {
	Top, Right, Bottom, Left float32
}

func HomogeneousInsets

func HomogeneousInsets(inset float32) Insets

type Point

type Point struct {
	X, Y float32
}

func PointFromInt

func PointFromInt(x, y int) Point

func (Point) Add

func (p Point) Add(other Point) Point

func (Point) EqualsTo

func (p Point) EqualsTo(other Point) bool

func (Point) Scale

func (p Point) Scale(scale float32) Point

func (Point) String

func (p Point) String() string

type Rect

type Rect struct {
	X, Y, W, H float32
}

func RectFromArray

func RectFromArray(values [4]float32) Rect

func RectFromInt

func RectFromInt(x, y, w, h int) Rect

func RectFromRectangle

func RectFromRectangle(r image.Rectangle) Rect

func (Rect) AlignIn

func (r Rect) AlignIn(b Rect, alignment geom.Alignment) Rect

func (Rect) Bottom

func (r Rect) Bottom() float32

func (Rect) Center

func (r Rect) Center() Point

func (Rect) CenterIn

func (r Rect) CenterIn(o Rect) Rect

func (Rect) CenterX

func (r Rect) CenterX() float32

func (Rect) CenterY

func (r Rect) CenterY() float32

func (Rect) ContainsPoint

func (r Rect) ContainsPoint(pointX, pointY float32) bool

func (Rect) Empty

func (r Rect) Empty() bool

func (Rect) EqualsTo

func (r Rect) EqualsTo(other Rect) bool

func (Rect) FitIn

func (r Rect) FitIn(b Rect, mode geom.FitMode, alignment geom.Alignment) Rect

func (Rect) Intersect

func (r Rect) Intersect(r2 Rect) bool

func (Rect) IntersectWithCircle

func (r Rect) IntersectWithCircle(circleX, circleY, circleRadius float32) bool

https://yal.cc/rectangle-circle-intersection-test/

func (Rect) Intersection

func (r Rect) Intersection(s Rect) Rect

func (Rect) IsContainedIn

func (r Rect) IsContainedIn(b Rect) bool

func (Rect) Left

func (r Rect) Left() float32

func (Rect) MaxPoint

func (r Rect) MaxPoint() Point

func (Rect) MinPoint

func (r Rect) MinPoint() Point

func (Rect) MoveTo

func (r Rect) MoveTo(x, y float32) Rect

func (Rect) ResizeTo

func (r Rect) ResizeTo(w, h float32) Rect

func (Rect) Right

func (r Rect) Right() float32

func (Rect) Scale

func (r Rect) Scale(factor float32) Rect

func (Rect) ShrinkByInsets

func (r Rect) ShrinkByInsets(i Insets) Rect

func (Rect) ShrinkByInt

func (r Rect) ShrinkByInt(i float32) Rect

func (Rect) Size

func (r Rect) Size() Size

func (Rect) String

func (r Rect) String() string

func (Rect) ToRectangle

func (r Rect) ToRectangle() image.Rectangle

func (Rect) Top

func (r Rect) Top() float32

func (Rect) Translate

func (r Rect) Translate(x, y float32) Rect

func (Rect) TranslateInt

func (r Rect) TranslateInt(x, y int) Rect

func (Rect) TranslatePoint

func (r Rect) TranslatePoint(point Point) Rect

func (Rect) UnionWith

func (r Rect) UnionWith(other Rect) Rect

type Size

type Size struct {
	W, H float32
}

func MaxSize

func MaxSize(a, b Size) Size

func MinSize

func MinSize(a, b Size) Size

func SizeFromInt

func SizeFromInt(w, h int) Size

func (Size) Scale

func (s Size) Scale(factor float32) Size

func (Size) String

func (s Size) String() string

func (Size) Sub

func (s Size) Sub(t Size) Size

Jump to

Keyboard shortcuts

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