# Euler's sine and cosine

### Euler’s formulas for sine and cosine

$\sin \omega t = \dfrac{1}{2} (e^{+j\omega t} - e^{-j\omega t})$

$\cos \omega t = \dfrac{1}{2} (e^{+j\omega t} + e^{-j\omega t})$

Sine and cosine emerge from vector sum of three spinning numbers in Euler’s Formula,

The green vector is $\dfrac{1}{2} e^{+j\omega t}$

The pink vector is $-\dfrac{1}{2} e^{-j\omega t}$ (used to make sine)

The red vector is $+\dfrac{1}{2} e^{-j\omega t}$ (used to make cosine)

Sine is the yellow dot, the vector sum of green and pink.

Cosine is the orange dot, the vector sum of green and red.

Notice the $90\degree$ phase shift between sine and cosine created by the simulation. Watch the dots as they pass through the origin.

Just music, no narration. The background music is *Sunday Stroll* by Huma Huma.

Animated with d3.js, source code. The image is not a video. It’s being computed on the fly by your device.

Created by Willy McAllister.