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

◆ grad() [4/4]

static int32_t grad ( uint8_t hash,
int32_t x,
int32_t y,
int32_t z,
int32_t t )
static

Definition at line 93 of file simplex.cpp.

93 {
94 uint8_t h = hash & 31; // Convert low 5 bits of hash code into 32 simple
95 int32_t u = h < 24 ? x : y; // gradient directions, and compute dot product.
96 int32_t v = h < 16 ? y : z;
97 int32_t w = h < 8 ? z : t;
98 return ((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -v : v) + ((h&4) != 0 ? -w : w);
99}
uint32_t z[NUM_LAYERS]
Definition Fire2023.ino:82
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:81

References x, y, and z.