2019-05-29 22:49:54 +00:00
|
|
|
#ifndef functions_H
|
|
|
|
#define functions_H
|
|
|
|
|
|
|
|
#include "prototypes.h"
|
|
|
|
#include "my_fastled.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
2019-06-05 04:27:55 +00:00
|
|
|
uint16_t XYsafe(int x, int y);
|
2019-05-29 22:49:54 +00:00
|
|
|
|
2019-06-05 04:27:55 +00:00
|
|
|
void blur(fract8 blur_amount);
|
|
|
|
|
|
|
|
void blur_row(uint8_t row_index, fract8 blur_amount);
|
|
|
|
|
|
|
|
void blur_column(uint8_t column_index, fract8 blur_amount);
|
|
|
|
|
2019-05-29 22:49:54 +00:00
|
|
|
inline double sines(double x, double y) {
|
2019-06-07 04:24:16 +00:00
|
|
|
return ((cos(x) * sin(y)) * 0.5) + 0.5;
|
2019-05-29 22:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline double basefield(double x, double y) {
|
2019-06-07 04:24:16 +00:00
|
|
|
return (cos(x) * sin(y) * cos(sqrt((x*x) + (y*y))));
|
2019-05-29 22:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline double addmod(double x, double mod, double delta) {
|
2019-06-07 04:24:16 +00:00
|
|
|
x = x + delta;
|
|
|
|
while( x >= mod ) x -= mod;
|
|
|
|
while( x < 0.0 ) x += mod;
|
|
|
|
return x;
|
2019-05-29 22:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline double addmodpi(double x, double delta) {
|
2019-06-07 04:24:16 +00:00
|
|
|
return addmod(x, 2*PI, delta);
|
2019-05-29 22:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct Matrix multiply(struct Matrix m1, struct Matrix m2);
|
|
|
|
|
|
|
|
struct Vector multiply(struct Matrix m, struct Vector v);
|
|
|
|
|
|
|
|
struct Vector add(struct Vector v1, struct Vector v2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|