diff --git a/desmos.md b/desmos.md new file mode 100644 index 0000000..d81a3e8 --- /dev/null +++ b/desmos.md @@ -0,0 +1,117 @@ +## stuff i've plotted in desmos + +in some order idk + +### [circumcircle](https://www.desmos.com/calculator/zaf29i2xrk) + +drag around the three points to see how their circumcircle is affected. +sorry, i never finished simplifying the math here. + +### [parabola arc length](https://www.desmos.com/calculator/hrokhmphrf) + +not closed form, sorry. drag the points around like it's a jumprope. + +### ["diode"](https://www.desmos.com/calculator/vappug98ky) + +i didn't name this function; i have no idea if or how it relates to a diode. +the red line (the line of interest) is actually just the 12th order smoothstep. + +btw, you can find smoothstep coefficients for any order +by the triangular table of this integer sequence: +[OEIS A091811](http://oeis.org/A091811) + +[punching it into wolfram][smoothie] (try changing n) + +[smoothie]: https://www.wolframalpha.com/input/?i=ReplaceAll%5BBinomial%5Bn+%2B+k+-+2,+k+-+1%5D+Binomial%5B2+n+-+1,+n+-+k%5D,+%7Bk+-%3E+Range%5B1,n%5D%7D%5D+where+n+%3D+12 + +### [smoothstep alternatives](https://www.desmos.com/calculator/ibigyiumzb) + +refer to shadertoy: + +* [Inverse Smoothstep](https://www.shadertoy.com/view/MsSBRh) +* [gain()](https://www.shadertoy.com/view/ldBfR1) +* [Alt smoothstep](https://www.shadertoy.com/view/lsBfz1) + +### [tanh approximation](https://www.desmos.com/calculator/k3jzkhmoid) + +approximating tanh by taking its continued fraction form and (externally) optimizing the constants. +probably not useful. + +### [TanhTest lolremez approx](https://www.desmos.com/calculator/carcltkgem) + +a polynomial approximation of a scaled tanh function +made with [the excellent lolremez](https://github.com/samhocevar/lolremez). + +### [e^(-2/x) approximations](https://www.desmos.com/calculator/q8jtxgnmlh) + +i forget where i read about this but basically you can +approximate `e^(-2/x)` by `(x-1)/(x+1)` when x is large. + +the black line shows the absolute error. + +### [compressor gain](https://www.desmos.com/calculator/rizrdxsrbg) + +trying to design a cheap-to-compute gain curve for a dynamic range compressor. +this thing uses just one division. +iirc it didn't wind up being all that useful. + +both axes are in power decibels. note that it acts as a gate under -70 dB. + +### [compressor approx stuff](https://www.desmos.com/calculator/5wbup88lev) + +trying to compute abs(x) by polynomials, or something. weird stuff. + +### [doom turnspeeds](https://www.desmos.com/calculator/zfscpmsdbk) + +i used this to help design turnspeed smoothing in [my zdoom patch.](https://eaguru.guru/t/zdoom_smoothstep.diff) + +*note to self: i think i have a more recent version of that patch lying around somewhere.* + +### [Biweight Funtimes](https://www.desmos.com/calculator/mlnqmf6ogp) + +messing around with a variations of Tukey's Biweight? +i think the only reason i kept this around was 'cause it's fun to watch animated. + +### [sincmod](https://www.desmos.com/calculator/lqgl4o0naz) + +something something windowing functions i dunno. + +### [SGDR](https://www.desmos.com/calculator/hlgqmyswy2) + +simple case of a [SGDR](https://arxiv.org/abs/1608.03983) curve. +i just kept this around 'cause the logarithmic plot complements +the linear plot in a kinda cool way. + +### [sqr/abs generalization](https://www.desmos.com/calculator/fagjg9vuz7) + +self-explanitory. + +### [SELU](https://www.desmos.com/calculator/bqu264oprw) + +[it's SELU!](https://arxiv.org/abs/1706.02515) + +### [GELU](https://www.desmos.com/calculator/ydzgtccsld) + +[GELU activation](https://arxiv.org/abs/1606.08415) +alongside an approximation i lifted off reddit or someplace. + +### [erf cdf approximations](https://www.desmos.com/calculator/22r29cude2) + +approximate gaussian stuff, with inversions and integrals. + +### [squish](https://www.desmos.com/calculator/1qdx4ovpb6) + +possibly useful functions for squishing values. +mostly based on sigmoidal functions. + +### [sin LUT approx 2](https://www.desmos.com/calculator/zdbgkxadns) + +approximating a quadrant of sin(x) with a polynomial and a LUT. + +### [circle calculus](https://www.desmos.com/calculator/yd5hyagaoj) + +some fun curves relating to unit circles. + +### [archimedes spiral](https://www.desmos.com/calculator/63vi3wnqug) + +it's just Archimedes' Spiral, plus some related functions. \ No newline at end of file