Files
cell/math/degrees.cm
2025-12-17 00:48:02 -06:00

22 lines
789 B
Plaintext

var degrees = {}
var Math_obj = Math
var deg2rad = pi / 180
var rad2deg = 180 / pi
return {
arc_cosine: function(x) { return Math_obj.acos(x) * rad2deg },
arc_sine: function(x) { return Math_obj.asin(x) * rad2deg },
arc_tangent: function(x) { return Math_obj.atan(x) * rad2deg },
cosine: function(x) { return Math_obj.cos(x * deg2rad) },
e: Math_obj.E,
ln: function(x) { return Math_obj.log(x) },
log: function(x) { return Math_obj.log10(x) },
log2: function(x) { return Math_obj.log2(x) },
power: function(x, y) { return Math_obj.pow(x, y) },
root: function(x, y) { return Math_obj.pow(x, 1/y) },
sine: function(x) { return Math_obj.sin(x * deg2rad) },
sqrt: function(x) { return Math_obj.sqrt(x) },
tangent: function(x) { return Math_obj.tan(x * deg2rad) }
}