I was talking with my math professor about complex numbers and he said there is a really easy way to use complex numbers to change a sequence of one's and minus one's into a set of coordinates. In these coordinates, minus one means a turn to the right and one means a turn to the left. His hint was to note that multiplying with complex $i$ means a counter clockwise turn, while a turn to the is the same as multiplying with $-i$ is the same as turning clockwise.
E.g. the sequence $(1, 1, -1)$ would include the coordinates $(0, 0)$ and $(0, 1)$ given: $$ (0, 0) \to (0, 1) \to (1, 1) \to (0, 1) \to (0,2) $$
Any tips on how this works? Thanks in advance
What I think you're trying to do is akin to mapping the path of someone who takes either one step to the left of the direction they're facing or to the right, which is nothing but a composition of translation maps.
I don't like my method. I hope you can make a better algorithm or improve mine.
I thought of the direction it is facing as a complex no. where $1$ is in the direction of the positive reals, $-1$ is in the direction of the negative reals, $i$ is in the direction of positive complex and $-i$ is in the direction of negative complex.
So say you had a sequence $\langle x_n\rangle=1,-1,1,1,1,-1,-1,1,-1,1,-1,..$
You can generate a sequence of complex numbers given by the recurrence relation
$z_n=z_{n-1}*x_n*i\ \forall n\geq2$ and $ z_1=i*x_1$
So, $z_1 =i, z_2=i*-1*i=1, z_3=1*1*i=i,...$
$\langle z_n\rangle=i,1,i,-1,-i,-1,i,-1,i..$
Then, we have $y_n =z_0+\sum_{k=1}^{n}z_k $ is our position at the $n^{th}$ step, where $z_0$ is our intial position.
So, if we start from $0$ in the complex plane facing in the direction of the positive real axis we move to $y_1=i$
then to $y_2=i+1$
then to $y_3=i+1+i=1+2i$
and so on...
So in $\mathbb{R^2} $ we have $(0,0)\to(0,1)\to(1,1)\to(1,2)\to(0,2)\to(0,1)\to(-1,1)\to...$ and so on