small test - // cos = sqrt(1-sin*sin); to calculate a faster cos()
"draw" your conclusions.
// Released to the public domain
uint32_t start;
uint32_t stop;
float deg_to_rad = 3.14159265/180;
int x;
int y;
void setup()
{
Serial.begin(115200);
Serial.println("Start ");
start = micros();
drawGauge(100, 10);
stop = micros();
Serial.println(stop - start);
start = micros();
drawGauge1(100, 10);
stop = micros();
Serial.println(stop - start);
Serial.println(x);
Serial.println(y);
}
void loop()
{
}
void drawGauge(int value, int rad)
{
x = sin((value-90) * deg_to_rad) * (rad-2);
y = cos((value-90) * deg_to_rad) * (rad-2);
}
void drawGauge1(int value, int rad)
{
x = sin((value-90) * deg_to_rad);
y = sqrt(1-x*x) * (rad-2); // cos = sqrt(1-sin*sin)
x = x * (rad-2);
}