pimath

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp[T Number](x, min, max T) T

Clamp limits the value x to the range [min, max].

func Distance

func Distance(x1, y1, x2, y2 float64) float64

Distance returns the distance between (x1, y1) and (x2, y2).

func Lerp

func Lerp(a, b, t float64) float64

Lerp computes the linear interpolation between a and b.

The parameter t should be in the range 0 to 1.

Types

type Number

type Number interface {
	~int | ~float64 |
		~int8 | ~int16 | ~int32 | ~int64 |
		~float32 |
		~uint | ~byte | ~uint16 | ~uint32 | ~uint64
}

Number describes any numeric type in Go.

Includes signed integers, unsigned integers, and floating-point types.

Jump to

Keyboard shortcuts

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