func RoundDown(value, roundTo float64) float64 {
	if roundTo < 0.000000000000001 {
		return value
	}
	d1 := math.Floor(value / roundTo)
	return d1 * roundTo
}
RoundDown rounds down to a given roundTo value.
package chart
import "math"
const (
	_pi   = math.Pi
	_2pi  = 2 * math.Pi
	_3pi4 = (3 * math.Pi) / 4.0
	_4pi3 = (4 * math.Pi) / 3.0
	_3pi2 = (3 * math.Pi) / 2.0
	_5pi4 = (5 * math.Pi) / 4.0
	_7pi4 = (7 * math.Pi) / 4.0
	_pi2  = math.Pi / 2.0
	_pi4  = math.Pi / 4.0
	_d2r  = (math.Pi / 180.0)
	_r2d  = (180.0 / math.Pi)
)
func MinMax(values ...float64) (min, max float64) {
	if len(values) == 0 {
		return
	}
	max = values[0]
	min = values[0]
	var value float64
	for index := 1; index < len(values); index++ {
		value = values[index]
		if value < min {
			min = value
		}
		if value > max {
			max = value
		}
	}
	return
}
func MinInt(values ...int) (min int) {
	if len(values) == 0 {
		return
	}
	min = values[0]
	var value int
	for index := 1; index < len(values); index++ {
		value = values[index]
		if value < min {
			min = value
		}
	}
	return
}
func MaxInt(values ...int) (max int) {
	if len(values) == 0 {
		return
	}
	max = values[0]
	var value int
	for index := 1; index < len(values); index++ {
		value = values[index]
		if value > max {
			max = value
		}
	}
	return
}
func AbsInt(value int) int {
	if value < 0 {
		return -value
	}
	return value
}
func DegreesToRadians(degrees float64) float64 {
	return degrees * _d2r
}
func RadiansToDegrees(value float64) float64 {
	return math.Mod(value, _2pi) * _r2d
}
func PercentToRadians(pct float64) float64 {
	return DegreesToRadians(360.0 * pct)
}
func RadianAdd(base, delta float64) float64 {
	value := base + delta
	if value > _2pi {
		return math.Mod(value, _2pi)
	} else if value < 0 {
		return math.Mod(_2pi+value, _2pi)
	}
	return value
}
func DegreesAdd(baseDegrees, deltaDegrees float64) float64 {
	value := baseDegrees + deltaDegrees
	if value > _2pi {
		return math.Mod(value, 360.0)
	} else if value < 0 {
		return math.Mod(360.0+value, 360.0)
	}
	return value
}
func DegreesToCompass(deg float64) float64 {
	return DegreesAdd(deg, -90.0)
}
func CirclePoint(cx, cy int, radius, thetaRadians float64) (x, y int) {
	x = cx + int(radius*math.Sin(thetaRadians))
	y = cy - int(radius*math.Cos(thetaRadians))
	return
}
func RotateCoordinate(cx, cy, x, y int, thetaRadians float64) (rx, ry int) {
	tempX, tempY := float64(x-cx), float64(y-cy)
	rotatedX := tempX*math.Cos(thetaRadians) - tempY*math.Sin(thetaRadians)
	rotatedY := tempX*math.Sin(thetaRadians) + tempY*math.Cos(thetaRadians)
	rx = int(rotatedX) + cx
	ry = int(rotatedY) + cy
	return
}
func RoundUp(value, roundTo float64) float64 {
	if roundTo < 0.000000000000001 {
		return value
	}
	d1 := math.Ceil(value / roundTo)
	return d1 * roundTo
}