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 97 of file simplex.cpp.

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

References t, x, y, and z.