AnsweredAssumed Answered

STM32F4 and double returning value divided by 10.

Question asked by anton.bogdan on Jun 16, 2014
Latest reply on Jun 16, 2014 by anton.bogdan
Hi guys, i recently started to work with orientations and quaternions.
Said to do a little math in paralel with my program with a excel spreadsheet.

I have the following q`s values

double q1=0.99551634;
double q2=-0.0699638;
double q3=-0.0396818;
double q4=-0.0497758;
char txt[10];
double qaa=2*q3*q4-2*q1*q2;
double qbb=2*q1*q1+2*q4*q4-1;
float qqq=atan2(qaa,qbb);
sprintf(pitch,"%f",qqq );
UB_LCD_2x16_String(1,1,text);

With the given values for each q, the atan2 result is 0.144122 on my lcd display.
Doing the same math and the same values in a excel spreadsheet, the result is
1.426674134.
Tryied even with double for my qqq, but the result is the same.

I wonder why... ?
                                   

Outcomes