Math Applets

Roots of Unity

Roots of unity:

For nNn\in\mathbb{N}, the nn-th roots of unity are the complex solutions of zn=1z^n=1.

They are given by zk=ei2πknz_k = e^{i\frac{2\pi k}{n}} for k=0,,n1k=0,\dots,n-1.

Equivalently, these are the nn equally spaced points on the unit circle.


Polygonal approximation of an arc (lecture note motivation):

Let x[0,2π]x\in[0,2\pi] and nNn\in\mathbb{N}. Define points on the unit circle by Ak:=eikxnA_k := e^{i\frac{kx}{n}} for k=0,,nk=0,\dots,n. Let n\ell_n be the length of the polygonal chain through A0,A1,,AnA_0,A_1,\dots,A_n: n:=k=1nAkAk1\ell_n := \sum_{k=1}^n |A_k-A_{k-1}|.

Then n=2nsin ⁣(x2n)\ell_n = 2n\sin\!\big(\frac{x}{2n}\big) and limnn=x\lim_{n\to\infty}\ell_n = x.


How to use the applet

  • Move the slider nn to choose how many roots of unity are displayed.
  • The blue points are the nn-th roots of unity
zk=ei2πkn,k=0,,n1. z_k = e^{i\frac{2\pi k}{n}}, \qquad k=0,\dots,n-1.
  • The blue polygon connects the points in order, showing that the roots form a regular nn-gon inscribed in the unit circle.
  • The roots are equally spaced: the angle between consecutive roots is 2πn\frac{2\pi}{n}.
  • Increasing nn makes the polygon look closer and closer to the circle (this is the geometric idea behind approximating circular quantities by polygons).

Loading graph…
  • Hold Shift + scroll to zoom
  • Hold Shift + drag to move
  • Points shaped like <> act as sliders

Description

Link to code.

Reference: Lecture Notes Calculus 1 ( May22,2022 ) Figure 5.5 page 89

This applet visualizes the nn-th roots of unity, i.e. the solutions of zn=1z^n=1. For a chosen integer nn (slider nSlider), the points zk=ei2πknz_k = e^{i\frac{2\pi k}{n}} for k=0,,n1k=0,\dots,n-1 are displayed on the unit circle as equally spaced points, and the blue polygon connects them to emphasize that the roots of unity form a regular nn-gon inscribed in the unit circle.

In the code, the roots are created as points on the unit circle with coordinates (cos(2πkn),sin(2πkn))\big(\cos(\frac{2\pi k}{n}),\sin(\frac{2\pi k}{n})\big), using the expressions Math.cos((TAU * k) / n) and Math.sin((TAU * k) / n) (with TAU = 2 * Math.PI). Concretely, the applet creates an array of points roots.

        const roots: JXG.Point[] = [];
        for (let k = 0; k < MAX_N; k++) {
          roots.push(
            createPoint(
              board,
              [
                () => Math.cos((TAU * k) / Math.floor(nSlider.Value())),
                () => Math.sin((TAU * k) / Math.floor(nSlider.Value())),
              ],
              {
                ...
              },
              ...
            )
          );
        }