func mathDeg(state *lua.State) int {
	f64 := state.CheckNumber(1)
	deg := f64 * 180 / math.Pi
	state.Push(deg)
	return 1
}
math.deg (x)

Converts the angle x from radians to degrees.

See https://www.lua.org/manual/5.3/manual.html#pdf-math.deg
package math
import (
	"fmt"
	"math"
	"math/rand"
	"github.com/Azure/golua/lua"
)
func Open(state *lua.State) int {
	var mathFuncs = map[string]lua.Func{
		"abs":        lua.Func(mathAbs),
		"acos":       lua.Func(mathAcos),
		"asin":       lua.Func(mathAsin),
		"atan":       lua.Func(mathAtan),
		"ceil":       lua.Func(mathCeil),
		"cos":        lua.Func(mathCos),
		"deg":        lua.Func(mathDeg),
		"exp":        lua.Func(mathExp),
		"floor":      lua.Func(mathFloor),
		"fmod":       lua.Func(mathFmod),
		"log":        lua.Func(mathLog),
		"max":        lua.Func(mathMax),
		"min":        lua.Func(mathMin),
		"modf":       lua.Func(mathModf),
		"rad":        lua.Func(mathRad),
		"random":     lua.Func(mathRand),
		"randomseed": lua.Func(mathRandSeed),
		"sin":        lua.Func(mathSin),
		"sqrt":       lua.Func(mathSqrt),
		"tan":        lua.Func(mathTan),
		"tointeger":  lua.Func(mathToInt),
		"type":       lua.Func(mathType),
		"ult":        lua.Func(mathUlt),
	}
	state.NewTableSize(0, len(mathFuncs))
	state.SetFuncs(mathFuncs, 0)
	state.Push(math.Pi)
	state.SetField(-2, "pi")  
	state.Push(lua.Float(math.Inf(1)))
	state.SetField(-2, "huge")  
	state.Push(math.MaxInt64)
	state.SetField(-2, "maxinteger")  
	state.Push(math.MinInt64)
	state.SetField(-2, "mininteger")  
	return 1
}
func mathAbs(state *lua.State) int {
	if state.IsInt(1) {
		n := state.ToInt(1)
		if n < 0 {
			n = -n
		}
		state.Push(n)
	} else {
		n := state.CheckNumber(1)
		state.Push(math.Abs(n))
	}
	return 1
}
func mathAcos(state *lua.State) int {
	f64 := state.CheckNumber(1)
	state.Push(math.Acos(f64))
	return 1
}
func mathAsin(state *lua.State) int {
	f64 := state.CheckNumber(1)
	state.Push(math.Asin(f64))
	return 1
}
func mathAtan(state *lua.State) int {
	y := state.CheckNumber(1)
	x := state.OptNumber(2, 1.0)
	state.Push(math.Atan2(y, x))
	return 1
}
func mathCeil(state *lua.State) int {
	if state.IsInt(1) {
		state.SetTop(1)
		return 1
	}
	var (
		num = state.CheckNumber(1)
		f64 = math.Ceil(num)
		i64 = int64(f64)
	)
	if float64(i64) == f64 {
		state.Push(i64)
	} else {
		state.Push(f64)
	}
	return 1
}
func mathCos(state *lua.State) int {
	f64 := state.CheckNumber(1)
	state.Push(math.Cos(f64))
	return 1
}