Archived

This topic is now archived and is closed to further replies.

Faze

Function help

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites