MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / heat_value

Function heat_value

examples/heatmap.rs:75–81  ·  view source on GitHub ↗
(nx: f64, ny: f64)

Source from the content-addressed store, hash-verified

73}
74
75fn 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.
84fn heat_color(value: f64) -> Color {

Callers 1

newFunction · 0.85

Calls 1

expMethod · 0.80

Tested by

no test coverage detected