How to create a formula for a Period/Fourier Series from a set of numbers

33 Views Asked by At

Please bear with me as I ask this question, I am sort of having to 'relearn' (or indeed just learn), way more about Math these days than I ever was taught in school, and so a lot of concepts and terminology can be alien to me (e.g. the difference between a series and sequence and the various types of series in existence).

I basically want to create two series of numbers, which will then be plotted on a graph like so: How to derive a formula for plotting points on an xy grid . After many conversations, head scratching and reading, I THINK I understand correctly that I need to create what is called a 'Periodic Series' in order to generate these sequences of numbers:

0,0,1,1,1,0,-1,-1,-1,-1,0,1,2,2,2,2,2,1,0,-1,-2,-2,-2,-2,-2,-2,-1,0
0,1,1,0,-1,-1,-1,0,1,2,2,2,2,1,0,-1,-2,-2,-2,-2,-2,-1,0,1,2,3,3,3

Ultimately, what I want to do is create a 'spiral', but in a sort of 'minecraft' (fixed chess/style grid), whereby a set of numbers (as above) will be created from an index ranging from 0 (or 1) to n. Any help on how to create a formula for deriving these series from an index, would be greatly appreciated!