Formula gate
Generated with an LLM and Wirescript, it all seems to work. You might not want to open the microchip though lmao. Formula gate. Evaluates a math formula typed as text, as an alternative to wiring gates. Feed a formula string into "formula" (or just write it in the variable gate on top) and numbers into the a..h arguments. If ok is false, the formula was invalid and result is 0. Formulas look like sqrt(a*a + b*b), in a single line. They support + - * / % ^, parentheses, and functions like sin, max and clamp. Angles are in radians. To work in degrees, convert with rad() and deg(). Pi and tau (2π) are built in but e is an argument, so use exp(1) for Euler's number. New lines are not supported. Lerp is clamped. Values too big end up as zero. Finally, scientific notation is not supported. Functions: sin cos tan asin acos atan sinh cosh tanh exp ln sqrt abs sign round floor ceil log (base 10), log2, frac (x − floor x), rad (deg→rad), deg (rad→deg) atan2(y,x), pow(x,y), min(x,y), max(x,y), mod(x,y) (floored), logb(x,base) clamp(x,lo,hi), lerp(a,b,t)
- Published
- September 19, 2026 at UTC
- Updated
- September 19, 2026 at UTC
- Version
- 1
- Share code
d2v-c6a-n1a