FastLED 3.10.6
Loading...
Searching...
No Matches

◆ ringOffset()

float mood_ring::ringOffset ( float a,
float b )

Signed shortest offset from b to a on the ring, in (-0.5, 0.5].

Definition at line 35 of file ring_canvas.cpp.

35 {
36 float d = wrapTurns(a) - wrapTurns(b);
37 if (d > 0.5f)
38 d -= 1.0f;
39 if (d <= -0.5f)
40 d += 1.0f;
41 return d;
42}
float wrapTurns(float t)
Wrap into [0, 1).

References wrapTurns().

Referenced by ringDistance().

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