Int

package
v0.0.0-...-435e233 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lerp

func Lerp(start, end, progress, range_ int) (result int)

Lerp performs a linear interpolation between start and end, using progress as a percentage of the total range. If progress is outside the range [0, range_], the function will panic. If range_ is zero, the function will panic.

The result is rounded to the nearest integer.

Example usage:

Lerp(10, 20, 50, 100) = 15

The above will interpolate between 10 and 20, using 50% of the total range of 100. The result is 15.

Types

type Vec2

type Vec2 struct {
	X, Y int
}

func (Vec2) Abs

func (v Vec2) Abs() Vec2

func (Vec2) Add

func (v Vec2) Add(v1 Vec2) Vec2

func (Vec2) Ceil

func (v Vec2) Ceil() Vec2

func (Vec2) Div

func (v Vec2) Div(v1 Vec2) Vec2

func (Vec2) Floor

func (v Vec2) Floor() Vec2

func (Vec2) Mul

func (v Vec2) Mul(v1 Vec2) Vec2

func (Vec2) Neg

func (v Vec2) Neg() Vec2

func (Vec2) RightTo

func (v0 Vec2) RightTo(v1 Vec2, v2 Vec2) bool

func (Vec2) Round

func (v Vec2) Round() Vec2

func (Vec2) RoundTo

func (v Vec2) RoundTo(places int) Vec2

func (Vec2) Scale

func (v Vec2) Scale(s int) Vec2

func (Vec2) Sub

func (v Vec2) Sub(v1 Vec2) Vec2

Jump to

Keyboard shortcuts

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