FastLED
3.9.15
Loading...
Searching...
No Matches
◆
grad()
[2/4]
static int32_t grad
(
uint8_t
hash
,
int32_t
x
,
int32_t
y
)
static
Definition at line
79
of file
simplex.cpp
.
79
{
80
uint8_t h =
hash
& 7;
// Convert low 3 bits of hash code
81
int32_t u = h < 4 ?
x
:
y
;
// into 8 simple gradient directions,
82
int32_t v = h < 4 ?
y
:
x
;
// and compute the dot product with (x,y).
83
return
((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -2*v : 2*v);
84
}
x
uint32_t x[NUM_LAYERS]
Definition
Fire2023.ino:82
y
uint32_t y[NUM_LAYERS]
Definition
Fire2023.ino:83
fl::anonymous_namespace{noise_woryley.cpp}::hash
uint16_t hash(int32_t x, int32_t y)
Definition
noise_woryley.cpp:18
References
x
, and
y
.
simplex.cpp
Generated on Mon Jun 16 2025 06:27:48 for FastLED by
1.13.2