xmath

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const JSMAXSAFE = 1342177

Variables

This section is empty.

Functions

func Clamp

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

func ClampInt

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

func Fract

func Fract(v float64) float64

func GetOne

func GetOne(arr []interface{}, seed ...uint64) interface{}

func Lerp

func Lerp(t, a, b float64) float64

func MaxInt

func MaxInt(x, y int) int

func MinInt

func MinInt(x, y int) int

func OneIn

func OneIn(chance float64, seed ...uint64) bool

func OneInInt

func OneInInt(chance int, seed ...uint64) bool

func PickOne

func PickOne(arr []interface{}, seed ...uint64) (interface{}, []interface{})

func PickSome

func PickSome(arr []interface{}, num int, seed ...uint64) ([]interface{}, []interface{})

func Porn

func Porn(seed ...uint64) float64

func PornInt

func PornInt(seed ...uint64) int

func PowInt

func PowInt(x, y int) int

func PowInt64

func PowInt64(x, y int64) int64

func PowUInt64

func PowUInt64(x, y uint64) uint64

func Range

func Range(start, end float64) []float64

func RangeInt

func RangeInt(start, end int) []int

func Rng

func Rng(val1, val2 float64, seed ...uint64) float64

func RngInt

func RngInt(val1, val2 int, seed ...uint64) int

func SRandom

func SRandom(seed ...uint64) float64

func Shuffle

func Shuffle(arr []interface{}, seed ...uint64) []interface{}

func Sign

func Sign(v float64) float64

func Step

func Step(edge float64, x float64) float64

func StepInt

func StepInt(edge int, x int) int

func WeightList

func WeightList(list []int) int

func XInY

func XInY(x float64, y float64, seed ...uint64) bool

func XInYInt

func XInYInt(x int, y int, seed ...uint64) bool

Types

type WeightAble

type WeightAble interface {
	Weight() float64
}

func WeightSelect

func WeightSelect(weightList []WeightAble, seed ...uint64) (int, WeightAble)

Jump to

Keyboard shortcuts

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