Why do trig functions appear in Euler's formula?