mathf

package
v0.0.0-...-d05e8a6 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp[T types.Number](v, min, max T) T

Clamp 将v的值限制在[min,max]之间

func Clamp01

func Clamp01[T constraints.Float](v T) T

Clamp01 将v的值限制在[0,1]之间

func Max

func Max[T types.Number](a, b T) T

Max 求两者之间的较大值

func Min

func Min[T types.Number](a, b T) T

Min 求两者之间的较小值

func Ternary

func Ternary[T any](cond bool, f1, f2 func() T) T

Ternary 三元运算

Types

This section is empty.

Jump to

Keyboard shortcuts

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