Inverse trig logic functions

This commit is contained in:
Anuken
2021-06-03 19:12:33 -04:00
parent a2a4302c8c
commit 00ca247d0f
2 changed files with 17 additions and 4 deletions

View File

@ -1636,9 +1636,15 @@ lenum.min = Minimum of two numbers.
lenum.max = Maximum of two numbers.
lenum.angle = Angle of vector in degrees.
lenum.len = Length of vector.
lenum.sin = Sine, in degrees.
lenum.cos = Cosine, in degrees.
lenum.tan = Tangent, in degrees.
lenum.asin = Arc sine, in degrees.
lenum.acos = Arc cosine, in degrees.
lenum.atan = Arc tangent, in degrees.
#not a typo, look up 'range notation'
lenum.rand = Random decimal in range [0, value).
lenum.log = Natural logarithm (ln).

View File

@ -36,13 +36,20 @@ public enum LogicOp{
abs("abs", a -> Math.abs(a)),
log("log", Math::log),
log10("log10", Math::log10),
sin("sin", d -> Math.sin(d * 0.017453292519943295D)),
cos("cos", d -> Math.cos(d * 0.017453292519943295D)),
tan("tan", d -> Math.tan(d * 0.017453292519943295D)),
floor("floor", Math::floor),
ceil("ceil", Math::ceil),
sqrt("sqrt", Math::sqrt),
rand("rand", d -> Mathf.rand.nextDouble() * d);
rand("rand", d -> Mathf.rand.nextDouble() * d),
sin("sin", d -> Math.sin(d * Mathf.doubleDegRad)),
cos("cos", d -> Math.cos(d * Mathf.doubleDegRad)),
tan("tan", d -> Math.tan(d * Mathf.doubleDegRad)),
asin("asin", d -> Math.asin(d) * Mathf.doubleRadDeg),
acos("acos", d -> Math.acos(d) * Mathf.doubleRadDeg),
atan("atan", d -> Math.atan(d) * Mathf.doubleRadDeg),
;
public static final LogicOp[] all = values();