math

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a []float64, b []float64) ([]float64, error)

Add performs a vector additon of a and b. If a and b differ in size, an error is returned.

func ClampFloat64

func ClampFloat64(val float64, min float64, max float64) float64

ClampFloat64 limits val to be between min and max, inclusive.

func MinMaxInt

func MinMaxInt(a, b int) (int, int)

MinMaxInt returns the min of a and b, followed by the max of a and b.

func Square

func Square(a []float64) []float64

Square performs an element by element square of vector a, i.e. the dot product of a with itself.

func SquareDistance

func SquareDistance(a []float64, b []float64) (float64, error)

SquareDistance calculates the square distance between the coordinates a and b. If a and b are different sizes, an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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