0

I was looking at GLSL's smoothstep, aka the Hermite for $f(0)=0, f'(0)=0, f(1)=1, f'(1)=0$.

That led to looking at the quintic Hermite as well, to get the acceleration to also be zero at the edges.

That had me wondering if just using higher degrees was better, but that just leads to (a shifted) Heaviside eventually (despite the discontinuity).

That led to me finding $f(x) = logistic({1\over{1-x}} - {1\over{x}})$ in the discussion of bump functions, to still get all the derivatives zero at the endpoints without approaching infinite velocity in the middle.

But of course there's more than just that one. From simple things like just changing the base of the exponent, to tossing in a √ so the plateau is shorter, to complicated things like the Fabius function, there's got to be lots of these.

Is there one of these that can reasonably be considered "best" for motion smoothing? Or is that just way too underconstrained to be meaningful question, especially since it's non-analytic so might be hard to analyze in the first place?

me22
  • 201
  • Experimenting with numbers, the logistic approach goes weird for f'(½) < √3: https://www.desmos.com/calculator/bjhltmovop – me22 Dec 11 '24 at 08:49
  • Look at the function in this previous question. Infinitely differentiable everywhere including $0$. All derivatives at $0$ are $0$. Change the definition slightly so that is it $0$ for $x < 0$ and this is still true. That is a perfectly smooth transition. https://math.stackexchange.com/questions/491227/how-do-you-show-that-e-1-x2-is-differentiable-at-0 – badjohn Dec 11 '24 at 10:39
  • 2
    If you can explain what makes one function better than another for motion smoothing, then perhaps we can find a function that is “best”. – bubba Dec 11 '24 at 12:50
  • I like this one based on "smooth bump functions", but since they are "flat functions" they have some weird properties – Joako Dec 12 '24 at 02:36
  • 1
    @Joako That's the one logistic one I mention in the question :D $\frac{2x-1}{x^2-x} = \frac{1}{x} - \frac{1}{1-x}$. – me22 Dec 13 '24 at 07:07
  • @me22 here there is sn alternative if you look for straight-line edges with a flat top... but I have seen in Desmos that there is a trade off on calculation time among using more elaborated alternatives like $C^\infty$ transition functions instead of simpler polynomials. In the question there are another examples (some only twice differentiable, others really smooth). – Joako Dec 13 '24 at 14:54
  • 1
    The Fabius function $F$ has the property that $\forall n\in\mathbb{N}:|f^{(n)}|\infty\leq|F^{(n)}|\infty\Rightarrow f=F$ where $f$ is any smooth transition from 0 to 1. There are other such functions too, but I don't think there is a way to narrow them down to a unique best one without an unsatisfactory arbitrary choice for defining 'best'. – Coolwater Apr 04 '25 at 19:08

0 Answers0