I made a "small" #Shadertoy #GLSL thingy that can generate implicit functions with equal thickness (Thanks for the magic of dual numbers). Link: https://www.shadertoy.com/view/wcyGRw

It features a large set of functions:

- Elementary operations
> +, -, *, /
- Exponentials
> exp, log
- Powers and roots
> sqrt, cbrt, pow (TODO)
- Sign related
> step, sgn, ramp, abs
Rounding
> floor, round, ceil
Trigonometry:
> sin, cos, tan, sec, csc, cot,
Hyperbolics:
> sinh, cosh, tanh, sech, csch, coth
Inverse trigonometry:
> asin, acos, atan, asec, acsc, acot
Inverse hyperbolics
> asinh, acosh, atanh, asech, acsch, acoth

It only has some bugs with functions that have poles. For example y=tan(x) produces straight lines at each pole.

#programming #shaders #math #functions #derivative #dualnumbers #realnumbers

@matematico314 The Wikipedia article (https://en.wikipedia.org/wiki/Dual_number) lists a lot of applications, but it misses the most common use case — perturbation theory.

In perturbation theory, you have a known effect, represented by a number 𝑎 (or several numbers, 𝑎₁, 𝑎₂, ... 𝑎ₙ, but that's similar), together with a perturbation that is written ε𝑏, where ε is thought as a very small number. So you effectively have instead of each number 𝑎 a number 𝑎 + ε𝑏, the perturbed version of 𝑎. You add two perturbed numbers component-wise, but when you multiply them, you consider ε a so small number that every term with ε² in it vanishes. The resulting multiplication rule is then

(𝑎 + ε𝑏)(𝑐 + ε𝑑) = 𝑎𝑐 + ε(𝑏𝑐 + 𝑎𝑑),

exactly the rule for dual numbers.

So the physicists have been working with dual numbers for many decades without noticing them!

(I do not know whether the YouTube video tells this.)

#DualNumbers #PerturbationTheory #Physics

Dual number - Wikipedia

I never heard of those #DualNumbers before. Nice, I've just learned something new: https://www.youtube.com/watch?v=ceaNqdHdqtg
The strange cousin of the complex numbers -- the dual numbers.

YouTube