FastLED 3.9.15
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 27 of file engine_core.h.

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

References atan2f(), and hypotf().

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

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