As well as multiplying twice by 1.0E6 (instead of multiplying and then 
dividing), another error is

​smoothingCoor[i] = smoothingCoor [i] +alpha * (coor[i] - 
smoothingCoor[i]); 

This should be

smoothingCoor[i] = (smoothingCoor [i] * (1.0 - alpha))  +  alpha * (coor[i] 
- smoothingCoor[i]); 

and the same for your bearing smoothing.

Actually there is another problem with the bearing smoothing - consider 
what happens when the bearing goes from 359 to 1. 359 = 1 degree West of 
North so the 'smoothed' version would be close to zero degrees. However 
your simple smoothing might give a value close to 180 - which is completely 
wrong.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to