Jump to content
  • Advertisement

Archived

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

Faze

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.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!