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

◆ grad() [1/4]

static int32_t grad ( uint8_t hash,
int32_t x )
static

Definition at line 70 of file simplex.cpp.

70 {
71 uint8_t h = hash & 15;
72 int32_t grad = 1 + (h&7); // Gradient value 1.0, 2.0, ..., 8.0
73 if ((h&8) != 0) {
74 grad = -grad; // Set a random sign for the gradient
75 }
76 return grad * x; // Multiply the gradient with the distance (integer * 0.12 = *.12)
77}
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
static int32_t grad(uint8_t hash, int32_t x)
Definition simplex.cpp:70

References grad(), and x.

Referenced by grad(), snoise16(), snoise16(), snoise16(), and snoise16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: