mathutility

package
v0.0.0-...-78d9b97 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoundingBox

func GetBoundingBox(numbers []complex128) (complex128, complex128)

GetBoundingBox returns two complex numbers that contain all of the non-infinity numbers inside.

The first number is the minimum (all numbers have a real & imaginary component greater than or equal to it)
The second number is the maximum (all numbers have a real & imaginary component less than or equal to it)
If numbers is an empty slice, returns (0+0i, 0+0i)

func ScaleValueBetweenTwoRanges

func ScaleValueBetweenTwoRanges(value, oldRangeMin, oldRangeMax, newRangeMin, newRangeMax float64) float64

ScaleValueBetweenTwoRanges translates value (exists between min1 and max2)

to somewhere between min2 and max2. Linear scale is assumed.
So if value is 25% between min1 and max1, then this will return
  a float64 that is 25% between min2 and max2.

Types

This section is empty.

Jump to

Keyboard shortcuts

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