|
1 | 1 | # function-plotter-code-multi |
2 | 2 | Function Flotter with JS code multi-graphics (prime numbers, pi(x) and special function) |
| 3 | + |
| 4 | +Gamma waves: |
| 5 | +``` |
| 6 | +for (let i = 0; i < 10.0; i += 0.05) { |
| 7 | + plot(x => cgamma(complex(x, i)).y); |
| 8 | +} |
| 9 | +``` |
| 10 | + |
| 11 | +<img src="https://asyncker.github.io/function-plotter-code-multi/img/gamma-waves.png"> |
| 12 | + |
| 13 | +Mandelbrot 1d biffurcation: |
| 14 | +``` |
| 15 | +function realMandelbrot(c, n) { |
| 16 | + let z = 0; |
| 17 | + for (let i = 0; i < n; i++) { |
| 18 | + z = pow(z, 2) + c; //z = sin(z) + c; |
| 19 | + } |
| 20 | + return z; |
| 21 | +} |
| 22 | +
|
| 23 | +for (let n = 20; n <= 100; n += 1) { |
| 24 | + plot(x => -realMandelbrot(x, n)); |
| 25 | +} |
| 26 | +``` |
| 27 | + |
| 28 | +<img src="https://asyncker.github.io/function-plotter-code-multi/img/mandelbrot-1d-bifurcation.png"> |
| 29 | + |
| 30 | +Elliptic curves: |
| 31 | +``` |
| 32 | +for (let i = 0; i < 10.0; i += 0.05) { |
| 33 | + let ecolor = randomColor(); |
| 34 | + plot(x => sqrt(pow(x, 3) - 2 * x + 2.0 / i), { color: ecolor }); |
| 35 | + plot(x => -sqrt(pow(x, 3) - 2 * x + 2.0 / i), { color: ecolor }); |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +<img src="https://asyncker.github.io/function-plotter-code-multi/img/elliptic-curves.png"> |
| 40 | + |
| 41 | +Relu-curves symetry: |
| 42 | +``` |
| 43 | +for (let i = 0; i < 10.0; i += 0.05) { |
| 44 | + let colorv = randomColor(); |
| 45 | + plot(x => +relumin(pow(x, 3) - 2 * x + 2.0 / i), { color: colorv }); |
| 46 | + plot(x => -relumin(pow(x, 3) - 2 * x + 2.0 / i), { color: colorv }); |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +<img src="https://asyncker.github.io/function-plotter-code-multi/img/relu-curves-pos-min-neg-min.png"> |
| 51 | + |
| 52 | +Relu-curves asymetry: |
| 53 | +``` |
| 54 | +for (let i = 0; i < 10.0; i += 0.05) { |
| 55 | + let colorv = randomColor(); |
| 56 | + plot(x => -relumax(pow(x, 3) - 2 * x + 2.0 / i), { color: colorv }); |
| 57 | + plot(x => -relumin(pow(x, 3) - 2 * x + 2.0 / i), { color: colorv }); |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +<img src="https://asyncker.github.io/function-plotter-code-multi/img/relu-curves-neg-max-neg-min.png"> |
| 62 | + |
| 63 | + |
| 64 | +Prime waves: |
| 65 | +``` |
| 66 | +primes = primes(10374); |
| 67 | +for (let i = 0; i < primes.length; i++) { |
| 68 | + const p = primes[i]; |
| 69 | + const f = (x) => x > p ? sin(x * (PI / p)) * p : 0; |
| 70 | + plot(x => f(x), { color: randomColor() }); |
| 71 | +} |
| 72 | +``` |
| 73 | + |
| 74 | +<img src="https://asyncker.github.io/function-plotter-code-multi/img/prime-exp-waves.png"> |
0 commit comments