mirror of
https://github.com/wled/WLED.git
synced 2025-04-23 22:37:18 +00:00
minor improvement
This commit is contained in:
parent
a0a46850f5
commit
fa4c23b76e
@ -7737,9 +7737,9 @@ uint16_t mode_2Doctopus() {
|
||||
const int C_Y = (rows / 2) + ((SEGMENT.custom2 - 128)*rows)/255;
|
||||
for (int x = 0; x < cols; x++) {
|
||||
for (int y = 0; y < rows; y++) {
|
||||
rMap[XY(x, y)].angle = int(40.7436f * atan2_t((y - C_Y), (x - C_X))); // avoid 128*atan2()/PI
|
||||
int dx = (x - C_X);
|
||||
int dy = (y - C_Y);
|
||||
rMap[XY(x, y)].angle = int(40.7436f * atan2_t(dy, dx)); // avoid 128*atan2()/PI
|
||||
rMap[XY(x, y)].radius = sqrtf(dx * dx + dy * dy) * mapp; //thanks Sutaburosu
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user