#### Archived

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

# Function help

This topic is 5567 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 on other sites
That works great, thanks.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632995
• Total Posts
3009771
• ### Who's Online (See full list)

There are no registered users currently online

×