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