Function help

Started by
1 comment, last by Faze 20 years, 9 months ago
I haven''t had Trig in like two years and I''ve forgotten how to create functions from two patterns (X and Y). Can someone help me out? The two patterns are: X: 0 1 2 3 4 5 6 7 Y: 2 1 0 7 6 5 4 3 I need a function to determine the Y when I only have X.
Advertisement
quote:Original post by Faze
X: 0 1 2 3 4 5 6 7
Y: 2 1 0 7 6 5 4 3

There''s no obvious polynomial or trigonomic pattern that fits. It does appear to be a shifted sawtooth wave though:
7     \      \6      \      \5       \      \4        \      \3         \      \2  \       \      \1   \       \      \0    \       \      \X: 01234567__________ 

Y = 7 - (X + 5) mod 8; // (or whatever the modulus operator is...)

With that many numbers in the sample, you could fit a 7th order polynomial, but that''s probably not what you''re looking for.
That works great, thanks.

This topic is closed to new replies.

Advertisement