Is this a valid visualization of Euler's identity as a more generic pattern? I was reading this nice question about a demonstration of Euler's identity, and tried to visualize how would look the left part of the identity in the complex plane by using the following function:


*

*Def. $f(k_1,k_2,k_3)=k_1e^{ik_2\pi}+k_3 \in \Bbb Z \land k_i \in [-n,n] \  n \in \Bbb R$

It is a tryout of a generic version of the left side of Euler's identity $e^{i\pi}+1 = 0$. If I did correctly the calculations $e^{ib}=cos(b)+sin(b)i$, thus:



*$f(k_1,k_2,k_3)=k_1e^{ik_2\pi}+k3=((k_1cos(\pi k_2))+k_3)+(k_1sin(\pi k_2))i  \in \Bbb Z$

For instance, to be able to see the patterns, taking $k_1,k_2,k_3 \in [-10,10]$ stepping in the interval by $0.1$, and calculating all the possible combinations of triplets $(k_1,k_2,k_3)$ and their values $f(k_1,k_2,k_3)$, this is the pattern that it generates when the complex values $a+bi$ are represented in Cartesian coordinates $(a=x,b=y)$:

A closer approach to $0+0i$:

Euler's identity $f(1,1,1) = e^{i\pi}+1 = 0+0i$ would be located at the center and the rest of points are the closer values of the more generic function $f(k_1,k_2,k_3)$ as it was defined above for the example. As expected is periodic and symmetrical. This is a little animation:

I would like to ask the following questions:


*

*Is the conversion in step (2) correct or should be modified? Did I make some step wrong?


*Could this visual approach provide another point of view or insights about Euler's identity?

Thank you!
 A: Your analysis is correct.  I don't think it really gives insight into Euler's identity per se, but it does help illustrate some geometric intuition about complex arithmetic, which is a great way to understand Euler's identity.
First, $r e^{i \theta} = r (\cos \theta + i \sin \theta)$ represents a point in the complex plane in polar coordinates, with a distance of $r$ from the origin and making an angle of $\theta$ with the positive x-axis.  (To see this, draw a right triangle with angle $\theta$ and hypotenuse $r$ and think about the lengths of the legs.)  
So considering $e^{i \pi k_2}$ as $k_2$ changes by steps of 0.1, we expect to see 20 dots arranged in a radius-1 circle around the origin.  If we include $k_1$ changing by steps of 0.1, i.e. $k_1 e^{i \pi k_2}$, then it has the effect of shrinking or expanding the circle, so this looks like 20 radial lines extending from the origin, with each line formed by dots which are 0.1 unit apart.
Finally, adding $k_3$ shifts the whole thing along the real axis to the right (when $k_3$ is positive) or left (when negative).  So $k_1 e^{i \pi k_2} + k_3$, as $k_1$, $k_2$, and $k_3$ all vary by steps of $0.1$, gives a bunch of copies of the radial lines arranged along the horizontal axis, and this is exactly what we see in your picture.  (Though it appears you must have used a bigger step than $0.1$ for $k_3$ to make your picture---or else a smaller step for $k_1$---since the space between adjacent dots is smaller than the space between adjacent circle centers.)
As for Euler's identity, given this geometric intuition, note that $e^{i\pi}$ is a point in the complex plane $1$ unit away from the origin at an angle of $\pi$---that is, along the negative x-axis.  Adding $1$ then shifts it one unit to the right, which puts it back at the origin.
