FastLED 3.9.15
Loading...
Searching...
No Matches

◆ grad() [3/4]

static fl::i32 grad ( fl::u8 hash,
fl::i32 x,
fl::i32 y,
fl::i32 z )
static

Definition at line 90 of file simplex.cpp.hpp.

90 {
91 fl::i32 h = hash & 15; // Convert low 4 bits of hash code into 12 simple
92 fl::i32 u = h < 8 ? x : y; // gradient directions, and compute dot product.
93 fl::i32 v = h < 4 ? y : (h == 12 || h == 14 ? x : z); // Fix repeats at h = 12 to 15
94 return ((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -v : v);
95}
int y
Definition simple.h:93
int x
Definition simple.h:92
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93

References x, y, and z.