Quote:
Originally Posted by ratdude747
edit- i see now... its the lowest integer function. however the equations doesn't work. did you mean somethign else?
|
What do you mean by "the equations don't work" ?
Please post an example.
Here's a complete C program. Compile and run it:
Code:
#include <math.h>
#include <stdio.h>
void test(double target, double measured){
double angle_error;
printf("\n%12.3f target\n%12.3f measured\n",target,measured);
angle_error=target-measured;
angle_error -= 360*floor(0.5+angle_error/360.0);
printf("%12.3f angle_error\n\n",angle_error);
}
int main(void){
test(2,359);
test(354,4);
return 0;
}
Here's the output:
Code:
2.000 target
359.000 measured
3.000 angle_error
354.000 target
4.000 measured
-10.000 angle_error