FastLED 3.10.8
Loading...
Searching...
No Matches

◆ compute()

vec2f fl::CirclePath::compute ( float alpha)
overridevirtual

Implements fl::XYPathGenerator.

Definition at line 42 of file xypath_impls.cpp.hpp.

42 {
43 // α in [0,1] → (x,y) on the unit circle [-1, 1]
44 float t = alpha * 2.0f * FL_PI;
45 float x = cosf(t);
46 float y = sinf(t);
47 return vec2f(x, y);
48}
#define FL_PI
Definition math.h:26
float sinf(float value) FL_NO_EXCEPT
Definition math.h:360
vec2< float > vec2f
Definition geometry.h:333
float cosf(float value) FL_NO_EXCEPT
Definition math.h:366

References fl::cosf(), fl::FL_NO_EXCEPT, FL_PI, fl::sinf(), fl::t, fl::x, and fl::y.

+ Here is the call graph for this function: