Are you really shure ?
In the case when
incoming reading 150°
previous reading 120°
DeltaDir=150-120=30
in your example DeltaDir<180 Then
DeltaDir = DeltaDir + 360 = 390
Do you want that ?
That's not what I want, I want results between -180 to + 180
In my code the result remains 30 because Abs(DeltaDir) is less than 180
Best regards.
__________________
Klaus
Switzerland
Last edited by klaus : 07-06-2009 at 09:02 AM.
|