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

74 {
75 uint8_t h = hash & 15;
76 int32_t grad = 1 + (h&7); // Gradient value 1.0, 2.0, ..., 8.0
77 if ((h&8) != 0) {
78 grad = -grad; // Set a random sign for the gradient
79 }
80 return grad * x; // Multiply the gradient with the distance (integer * 0.12 = *.12)
81}
int x
Definition simple.h:92
static int32_t grad(uint8_t hash, int32_t x)
Definition simplex.cpp:74

References grad(), and x.

Referenced by fl::anonymous_namespace{wave.cpp}::BatchDraw::BatchDraw(), grad(), snoise16(), snoise16(), snoise16(), and snoise16().

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