2019-05-29 22:49:54 +00:00
|
|
|
#ifndef functions_H
|
|
|
|
#define functions_H
|
|
|
|
|
|
|
|
#include "prototypes.h"
|
|
|
|
#include "my_fastled.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
int XYsafe(int x, int y);
|
|
|
|
|
|
|
|
void setPixel(int x, int y, CRGB color);
|
|
|
|
|
|
|
|
void setPixel(int i, CRGB color);
|
|
|
|
|
|
|
|
void setPixel(Window win, int x, int y, CRGB color);
|
|
|
|
|
2019-05-30 09:12:40 +00:00
|
|
|
void addPixelColor(int i, CRGB color);
|
|
|
|
|
2019-05-29 22:49:54 +00:00
|
|
|
void clear(Window window, CRGB color);
|
|
|
|
|
|
|
|
void clear(Window window);
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
inline double sines(double x, double y) {
|
|
|
|
return ((cos(x) * sin(y)) * 0.5) + 0.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline double basefield(double x, double y) {
|
|
|
|
return (cos(x) * sin(y) * cos(sqrt((x*x) + (y*y))));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline double addmod(double x, double mod, double delta) {
|
|
|
|
x = x + delta;
|
|
|
|
while( x >= mod ) x -= mod;
|
|
|
|
while( x < 0.0 ) x += mod;
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline double addmodpi(double x, double delta) {
|
|
|
|
return addmod(x, 2*PI, delta);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|