(nx: f64, ny: f64)
| 73 | } |
| 74 | |
| 75 | fn heat_value(nx: f64, ny: f64) -> f64 { |
| 76 | let gx = (nx - 0.35) / 0.18; |
| 77 | let gy = (ny - 0.65) / 0.22; |
| 78 | let gaussian = (-0.5 * (gx * gx + gy * gy)).exp(); |
| 79 | let waves = (nx * 4.5).sin() * (ny * 3.5).cos(); |
| 80 | gaussian + 0.35 * waves |
| 81 | } |
| 82 | |
| 83 | // An ad-hoc colormap for the heatmap values. |
| 84 | fn heat_color(value: f64) -> Color { |