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

◆ render_polar_lookup_table()

void fl::render_polar_lookup_table ( float cx,
float cy,
fl::vector< fl::vector< float > > & polar_theta,
fl::vector< fl::vector< float > > & distance,
int num_x,
int num_y )
inline

Definition at line 28 of file engine_core.h.

31 {
32 polar_theta.resize(num_x, fl::vector<float>(num_y, 0.0f));
33 distance.resize(num_x, fl::vector<float>(num_y, 0.0f));
34
35 for (int xx = 0; xx < num_x; xx++) {
36 for (int yy = 0; yy < num_y; yy++) {
37 float dx = xx - cx;
38 float dy = yy - cy;
39 distance[xx][yy] = fl::hypotf(dx, dy);
40 polar_theta[xx][yy] = fl::atan2f(dy, dx);
41 }
42 }
43}
void resize(fl::size n) FL_NO_EXCEPT
Definition vector.h:593
float hypotf(float x, float y) FL_NO_EXCEPT
Definition math.h:508
float atan2f(float y, float x) FL_NO_EXCEPT
Definition math.h:398

References atan2f(), FL_NO_EXCEPT, and hypotf().

Referenced by fl::Engine::init().

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