Discussion:
Algorithm needed
(too old to reply)
Ron Harter
2006-02-05 20:02:41 UTC
Permalink
I need an algorithm or code snippet that does Angular Interpolation. can
someone point me in the right direction please. It should just do a linear
type interpolation and if the value exceeds 360 it wraps around.


Thanks



--
Ron Harter | Tongue, Tied and Twisted
***@pobox.com | Just an earth bound misfit ... I
| Pink Floyd
Barry Schwarz
2010-05-26 01:36:40 UTC
Permalink
Post by Ron Harter
I need an algorithm or code snippet that does Angular Interpolation. can
someone point me in the right direction please. It should just do a linear
type interpolation and if the value exceeds 360 it wraps around.
Interpolation is not sensitive to the units of the "dependent"
variable. If you have two pairs of data, (value-1, angle-1) and
(value-2, angle-2), you compute the value of angle-3 for some new
value-3 using the standard formula

angle-3 =
[(value-3 - value-1)/(value-2 - value-1)]*[angle-2 - angle-1]

If the result is not in the range 1-360, add or subtract 360 as
appropriate.
--
Remove del for email
Continue reading on narkive:
Loading...