mathematic

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x int) int

func Clamp

func Clamp(a int, mi int, ma int) int

func ClampF

func ClampF(a float64, mi float64, ma float64) float64

func FindMinAndMax

func FindMinAndMax(a []int) (int, int)

func FindMinAndMaxF

func FindMinAndMaxF(a []float64) (float64, float64)

func IntersectBox

func IntersectBox(x0 int, y0 int, x1 int, y1 int, x2 int, y2 int, x3 int, y3 int) bool

func IntersectBoxF

func IntersectBoxF(x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64, x3 float64, y3 float64) bool

func IntersectF

func IntersectF(x1 float64, y1 float64, x2 float64, y2 float64, x3 float64, y3 float64, x4 float64, y4 float64) (float64, float64)

func IntersectFn

func IntersectFn(x1 float64, y1 float64, x2 float64, y2 float64, x3 float64, y3 float64, x4 float64, y4 float64) (float64, float64, bool)

func IntersectLineSegmentsF

func IntersectLineSegmentsF(x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64, x3 float64, y3 float64) bool

func Max

func Max(a int, b int) int

func MaxF

func MaxF(a float64, b float64) float64

func Min

func Min(a int, b int) int

func MinF

func MinF(a float64, b float64) float64

func Overlap

func Overlap(a0 int, a1 int, b0 int, b1 int) bool

func OverlapF

func OverlapF(a0 float64, a1 float64, b0 float64, b1 float64) bool

func PointSide

func PointSide(px int, py int, x0 int, y0 int, x1 int, y1 int) int

func PointSideF

func PointSideF(px float64, py float64, x0 float64, y0 float64, x1 float64, y1 float64) float64

func Random

func Random(min int, max int) int

func RandomF

func RandomF(min float64, max float64) float64

func Swap

func Swap(a int, b int) (int, int)

func SwapF

func SwapF(a float64, b float64) (float64, float64)

func Vxs

func Vxs(x0 int, y0 int, x1 int, y1 int) int

func VxsF

func VxsF(x0 float64, y0 float64, x1 float64, y1 float64) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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