All Posts

A Lightweight Derivation of CORDIC for Trigonometric Functions

Heath Davison Lunt June 2026

Download as PDF Markdown

Abstract

A short, simple derivation of CORDIC using matrices and infinite series, abstracted away from hardware details.

Let $$\begin{aligned} M= \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \end{aligned}$$ It follows, by factoring out a cos θ from M, $$\begin{aligned} M= \cos\theta \begin{pmatrix} 1 & -\tan\theta \\ \tan\theta & 1 \end{pmatrix}. \end{aligned}$$


Set $$\begin{aligned} \theta_0 = 0, \quad \theta_{n+1} = \sum_{k=0}^{n} a_k \tan^{-1}\left(2^{-k}\right), \end{aligned}$$ With $$\begin{aligned} a_k = \begin{cases} +1 & \text{if } \theta_k < \theta,\\ -1 & \text{if } \theta_k > \theta. \end{cases} \end{aligned}$$ That is to say, write θ as an infinite summation of arctangents of the reciprocals of powers of two using the algorithm seen in the definition of ak, which can be surmised as follows:

If the current angle approximation overshoots the target, subtract, otherwise, add.


Note that, for $$\begin{aligned} \tan\alpha = 2^{-k}, \end{aligned}$$ we have $$\begin{aligned} \cos\alpha = \frac{1}{\sqrt{1+2^{-2k}}}. \end{aligned}$$

Hence, $$\begin{aligned} M = \prod_{k=0}^{\infty} \frac{1}{\sqrt{1+2^{-2k}}} \begin{pmatrix} 1 & -a_{k}2^{-k} \\ a_{k}2^{-k} & 1 \end{pmatrix}. \end{aligned}$$

We use the fact that ak ∈ { − 1, 1} as to move it within the value of the tangent.


Splitting the product, $$\begin{aligned} M = \left( \prod_{k=0}^{\infty} \frac{1}{\sqrt{1+2^{-2k}}} \right) \left( \prod_{k=0}^{\infty} \begin{pmatrix} 1 & -a_{k}2^{-k} \\ a_{k}2^{-k} & 1 \end{pmatrix} \right). \end{aligned}$$

We see that our left product is independent of θ, and can be treated as a constant. $$\begin{aligned} \prod_{k=0}^{\infty} \frac{1}{\sqrt{1+2^{-2k}}} \approx 0.607252935\ldots \end{aligned}$$ The decimal expansion of this constant is sequence A273413 in the OEIS

We can then write

$$\begin{aligned} M = \left(0.607252935\ldots\right) \prod_{k=0}^{\infty} \begin{pmatrix} 1 & -a_{k}2^{-k} \\ a_{k}2^{-k} & 1 \end{pmatrix}. \end{aligned}$$

Expanding this infinite product into an iterative formula, we get

$$\begin{aligned} \begin{aligned} x_{k+1} &= x_k - a_k 2^{-k} y_k,\\ y_{k+1} &= y_k + a_k 2^{-k} x_k, \end{aligned} \qquad k\in\mathbb{N}\cup\{0\} \end{aligned}$$

$$\begin{aligned} \lim_{n\to\infty} \begin{pmatrix} 0.60725\ldots\cdot x_n\\ 0.60725\ldots\cdot y_n \end{pmatrix} = M \begin{pmatrix} x\\ y \end{pmatrix}. \end{aligned}$$