Josherich's Blog

HOME SOFTWARES DRAWING ABOUT RSS

Euler's formula as power series

21 Mar 2019

Visualize

is the points on unit circle, at angle , here is a visualization of how such circle is derived from the sum of power series:

Assume we have a function with the property of its derivative is equal to itself, just as , such function should have the form:

Expand to complex number :

Draw these complex numbers as vectors on complex plane, we have a end point for each , and a unit circle with all s

move mouse horizontally to draw the circle

Complex number as a Power Series

Any point on C plane can be written as

Let’s first compute the value of z using complex logarithm:

each term in the series is a vector, we add up these vectors to recover a in complex plane.

move mouse to draw the vectors

Euler’s formula

corresponds to imagenary axis

Compound interest

if n is large

Inverse

The inverse can be seen the image of z wrt. the unit circle, the mapping has some interesting trajectories, draw some strokes below to explore…

move mouse to draw 1/z
function drawETheta(theta, iter, scale) {
  var itheta = new Complex(0, theta);
  var res = new Complex(1, 0).add(itheta);

  var path = new Path();
  path.strokeColor = 'black';

  path.add(origin);
  path.add(cord(new Complex(1, 0) * scale));

  var itheta_pow = new Complex(itheta);

  for (var i = 2; i < iter; i++) {
    path.add(cord(res * scale));
    itheta_pow = itheta_pow.multiply(itheta);
    res = res.add(itheta_pow.divide(factorial(i)));
    path.add(cord(res * scale));
  }
  return path;
}


function drawExpZ(z, iter) {
  // res = 1 + z
  var w = z.log();
  var res = new Complex(1 * scale, 0).add(w * scale);
  var w_pow = new Complex(w);

  var path = new Path();
  path.strokeColor = 'black';
  path.add(origin);
  path.add(cord(new Complex(1 * scale, 0)));

  for (var i = 2; i < iter; i++) {
    path.add(cord(res));

    w_pow = w_pow.multiply(w);
    res = res.add(w_pow.divide(factorial(i)) * scale);
    path.add(cord(res));
  }
  return path;
}