<p>The notation Re() and Im() refer to the real and imaginary parts of a complex number.  Mathematicians and physicists are accustomed to using spherical harmonics (and Fourier transforms too) that are complex-valued, due to the factor $e^{im\phi}$.  You would then also have complex coefficients, in general, in the spherical harmonic expansion of a (real or complex) function.</p>

<p>Using <a href="https://en.wikipedia.org/wiki/Euler&#39;s_formula" rel="nofollow">Euler's formula</a>, $e^{im\phi} = \cos(m\phi) + i\sin(m\phi)$.  So that factor encodes cosine and sine waves  (that oscillate $m$ times as you move around the equator of the sphere) in its real and imaginary parts, respectively.</p>

<p>When we know we're going to be working strictly with real-valued functions, it may be more convenient to use real-valued variants of the spherical harmonics, where $e^{im\phi}$ is replaced by either $\cos(m\phi)$ or $\sin(m\phi)$, and using real coefficients instead of complex ones.  We trade a single complex coefficient for two real coefficients, so we haven't lost any information or flexibility; it's essentially a change of basis.  This formulation just explicitly ensures that everything always comes out real.</p>

CC BY-SA 3.0
2015-09-06T08:03:12.167Z
2015-11-03T20:25:54.380Z
2015-11-03T20:25:54.380Z
Nathan Reed
<p>I recently started to read about spherical harmonics. I have a question about this spherical harmonics basis function equation which is mentioned in this StupidSH article:</p>

<p><a href="https://i.sstatic.net/sBx4G.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sBx4G.png" alt="enter image description here"></a></p>

<p>What are those lm() and Re() used for?</p>

<p>The article can be found here: <a href="http://www.ppsloan.org/publications/StupidSH36.pdf" rel="nofollow noreferrer">http://www.ppsloan.org/publications/StupidSH36.pdf</a></p>

<lighting><spherical-harmonics>
Legendre Polynomial equation in Spherical Harmonics
user3059485
# Legendre Polynomial equation in Spherical Harmonics

(Asked by: username_0 on 2015-09-06)

I recently started to read about spherical harmonics. I have a question about this spherical harmonics basis function equation which is mentioned in this StupidSH article:

[![enter image description here](https://i.sstatic.net/sBx4G.png)](https://i.sstatic.net/sBx4G.png)

What are those lm() and Re() used for?

The article can be found here: <http://www.ppsloan.org/publications/StupidSH36.pdf>

**Tags:** lighting, spherical-harmonics


---

## 1 answers

### Answer by username_1 on 2015-09-06. Score: 4 | Accepted answer

The notation Re() and Im() refer to the real and imaginary parts of a complex number. Mathematicians and physicists are accustomed to using spherical harmonics (and Fourier transforms too) that are complex-valued, due to the factor $e^{im\phi}$. You would then also have complex coefficients, in general, in the spherical harmonic expansion of a (real or complex) function.

Using [Euler's formula](https://en.wikipedia.org/wiki/Euler's_formula), $e^{im\phi} = \cos(m\phi) + i\sin(m\phi)$. So that factor encodes cosine and sine waves (that oscillate $m$ times as you move around the equator of the sphere) in its real and imaginary parts, respectively.

When we know we're going to be working strictly with real-valued functions, it may be more convenient to use real-valued variants of the spherical harmonics, where $e^{im\phi}$ is replaced by either $\cos(m\phi)$ or $\sin(m\phi)$, and using real coefficients instead of complex ones. We trade a single complex coefficient for two real coefficients, so we haven't lost any information or flexibility; it's essentially a change of basis. This formulation just explicitly ensures that everything always comes out real.


---

