rect

package module
v0.0.0-...-d670102 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: Apache-2.0 Imports: 0 Imported by: 7

README

rect

rectangle in 2d int vector space

Documentation

Overview

rectangle in 2d space

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rect

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

func (Rect) Center

func (r Rect) Center() [2]int

func (Rect) Contain

func (r Rect) Contain(p [2]int) bool

func (Rect) Enlarge

func (r Rect) Enlarge(size [2]int) Rect

func (Rect) Intersection

func (r1 Rect) Intersection(r2 Rect) Rect

func (Rect) IsIn

func (r1 Rect) IsIn(r2 Rect) bool

func (Rect) IsOverlap

func (r1 Rect) IsOverlap(r2 Rect) bool

func (Rect) MakeRectBy4Driect

func (r Rect) MakeRectBy4Driect(c [2]int, direct4 int) Rect

func (Rect) RelPos

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

func (Rect) Shrink

func (r Rect) Shrink(size [2]int) Rect

func (Rect) ShrinkSym

func (r Rect) ShrinkSym(n int) Rect

func (Rect) SizeVector

func (r Rect) SizeVector() [2]int

func (Rect) Union

func (r1 Rect) Union(r2 Rect) Rect

func (Rect) X1

func (r Rect) X1() int

func (Rect) X2

func (r Rect) X2() int

func (Rect) Y1

func (r Rect) Y1() int

func (Rect) Y2

func (r Rect) Y2() int

Jump to

Keyboard shortcuts

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