mathutil

package
v2.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitFloat64

func LimitFloat64(v float64, min, max float64) float64

func LimitInt

func LimitInt(v int, min, max int) int

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

Types

type Intf

type Intf int64

Integer based float. Based on fixed.Int52_12.

func Intf1

func Intf1(x int) Intf

func Intf2

func Intf2(x fixed.Int26_6) Intf

func (Intf) Ceil

func (x Intf) Ceil() int

func (Intf) Floor

func (x Intf) Floor() int

func (Intf) Mul

func (x Intf) Mul(y Intf) Intf

func (Intf) String

func (x Intf) String() string

type PointIntf

type PointIntf struct {
	X, Y Intf
}

func PIntf1

func PIntf1(x, y int) PointIntf

func PIntf2

func PIntf2(p image.Point) PointIntf

func (PointIntf) Add

func (p PointIntf) Add(q PointIntf) PointIntf

func (PointIntf) In

func (p PointIntf) In(r RectangleIntf) bool

func (PointIntf) Sub

func (p PointIntf) Sub(q PointIntf) PointIntf

func (PointIntf) ToPointCeil

func (p PointIntf) ToPointCeil() image.Point

func (PointIntf) ToPointFloor

func (p PointIntf) ToPointFloor() image.Point

type RectangleIntf

type RectangleIntf struct {
	Min, Max PointIntf
}

func RIntf

func RIntf(r image.Rectangle) RectangleIntf

func (RectangleIntf) Add

func (RectangleIntf) Empty

func (r RectangleIntf) Empty() bool

func (RectangleIntf) Intersect

func (r RectangleIntf) Intersect(s RectangleIntf) RectangleIntf

func (RectangleIntf) Sub

func (RectangleIntf) ToRectFloorCeil

func (r RectangleIntf) ToRectFloorCeil() image.Rectangle

Jump to

Keyboard shortcuts

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