4 ms·
Why do it numerically? Show that e^ix converges, then you can reorder the sums, grouping the odd and even terms you get series expansions for cos(x) and i sin(x
by fennecs 5y ago
Why do it numerically? Show that e^ix converges, then you can reorder the sums, grouping the odd and even terms you get series expansions for cos(x) and i sin(x).
- subset 5y agoJust to be pedantic, the Taylor series definition of the exponential converges absolutely, hence we can reorder the terms by odd/even powers without changing the sum.
- adrusi 5y agoYou actually have to understand calculus for that to actually prove it to you, but, you can show that it seems to work out numerically with a bit of programming knowledge, which I imagine is more common on Hacker News. I don't think either the numerical or symbolic proofs really help build intuition though. This video [1] kinda helps, although it glosses over the critical fact "multiplying by i rotates counterclockwise 90°." [1] https://youtu.be/v0YEaeIClKY https://youtu.be/v0YEaeIClKY
- sillysaurusx 5y agoHmm. This is the second time I've seen that "multiplying by i rotates counterclockwise 90 degrees." I agree that this is one way to interpret the result. But is it literally equivalent to matrix multiplication by a 2D rotation matrix? Someone tried to say it was, which I felt skeptical about. (Also, thank you.)
- adrusi 5y agoIt is literally equivalent to a rotation matrix: [cos π/2 -sin π/2] [x] = [0 -1] [x] = [0 - y] = [-y] [sin π/2 cos π/2] [y] [1 0] [y] [x + 0] [ x] Compare to: i (x + iy) = ix + i²y = -y + ix For the general case of rotation in the complex plane, multiplying by a complex number with an absolute value of 1 (i.e. on the unit circle) rotates by that number's angle from the positive reals. Normally you'd write such a number as e^iθ, but since that's what we're trying to get to, we can instead write it as cos θ + i sin θ. [cos θ -sin θ] [x] = [x cos θ - y sin θ] [sin θ cos θ] [y] = [x sin θ + y cos θ] Compare to: (cos θ + i sin θ) (x + iy) = x cos θ + ix sin θ + iy cos θ + i²y sin θ = (x cos θ - y sin θ) + i (x sin θ + y cos θ) Maybe the cause of your skepticism is that it seems unintuitive that complex numbers, which are 2-dimensional in linear-algebra-speak, could be as powerful as 2×2 matrices, which are 4-dimensional. But keep in mind that 2×2 matrices can perform any linear transformation on 2-dimensional vectors using only matrix multiplication, whereas complex number multiplication can only scale and rotate, and you need to use complex addition to get translation, and I'm not sure off the top of my head if it's possible to get shear transformations using complex numbers.
- sillysaurusx 5y agoI just wanted to say, thank you so much for explaining this so thoroughly. I feel much more comfortable using complex numbers now that I allowed myself to believe "it's literally equivalent to a rotation matrix." (I'm a former gamedev, so rotation matrices are very intuitive. But for some reason, I never made the connection to complex numbers, except in an abstract math-y sort of way.) @mayfer also tried to explain to me that it was a rotation matrix. This tweet chain was helpful; posting it here in case anyone needs further convincing: https://twitter.com/theshawwn/status/1400591835052056580 https://twitter.com/theshawwn/status/1400591835052056580