Spherical Harmonics: Difference between revisions
| (9 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Spherical Harmonics are a set of orthonormal basis functions defined over a sphere.<br> | Spherical Harmonics are a set of orthonormal basis functions defined over a sphere.<br> | ||
<math>f: (\phi, \theta) \ | <math>f: (\phi, \theta) \mapsto f(\phi, \theta) \in \mathbb{R}</math> | ||
==Background== | ==Background== | ||
| Line 11: | Line 11: | ||
===Associated Legendre Polynomials=== | ===Associated Legendre Polynomials=== | ||
{{main | Wikipedia:Associated Legendre polynomials}} | {{main | Wikipedia:Associated Legendre polynomials}} | ||
Associated Legendre Polynomials are a set of orthogonal polynomials defined over \([-1, 1]\). | Associated Legendre Polynomials are a set of orthogonal polynomials defined over \([-1, 1]\). | ||
Each is represented as \(P^m_l\) where \(0 \leq m \leq l\). | |||
I.e. | |||
\(P^0_0(x)\) | |||
\(P^0_1(x), P^1_1(x)\) | |||
\(P^0_2(x), P^1_2(x), P^2_2(x)\) | |||
The following 3 recurrance relations define the associated legendre polynomials: | The following 3 recurrance relations define the associated legendre polynomials: | ||
| Line 28: | Line 33: | ||
==Definition== | ==Definition== | ||
Spherical Harmonics are a set of orthonormal basis functions defined on the sphere. | Spherical Harmonics are a set of orthonormal basis functions defined on the sphere. | ||
Below are some explicit formulas for Laplace spherical harmonics stolen from <ref name="stupidsh">Peter-Pike Sloan, [http://www.ppsloan.org/publications/StupidSH36.pdf Stupid Spherical Harmonics (SH) Tricks]</ref>< | Below are some explicit formulas for Laplace spherical harmonics stolen from Sloan<ref name="stupidsh">Peter-Pike Sloan, [http://www.ppsloan.org/publications/StupidSH36.pdf Stupid Spherical Harmonics (SH) Tricks]</ref>. You can also find alternative equations in DLMF<ref name="dlmf">Digital Library of Mathematical Functions, 14.30. [https://dlmf.nist.gov/14.30 https://dlmf.nist.gov/14.30]</ref>. | ||
There are <math>2l+1</math> functions for each band. | |||
There are <math>2l+1</math> functions for each band. | |||
* <math>Y_l^m(\theta, \varphi) = K_l^m e^{i m \varphi} P_l^{|m|} \cos(\theta)</math> for <math>-l \leq m \leq l</math> | * <math>Y_l^m(\theta, \varphi) = K_l^m e^{i m \varphi} P_l^{|m|} \cos(\theta)</math> for <math>-l \leq m \leq l</math> | ||
| Line 49: | Line 55: | ||
\end{cases}</math> | \end{cases}</math> | ||
===Visualizations | ==Properties== | ||
Copied from Green<ref name="green2003lighting">Robin Green (2003). ''Spherical Harmonic Lighting'' URL: [http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf]</ref> | |||
* Orthonormal | |||
* Rotationally Invariant | |||
* Integration of two spherical harmonic functions is a dot product of their coefficients | |||
{{hidden | Proof| | |||
This follows from being orthonormal:<br> | |||
<math> | |||
\begin{align} | |||
\int_{S}\tilde{L}(s)\tilde{t}(s)ds &= \int_{S}\left(\sum_i L_i y_i(s)\right)\left(\sum_j t_j y_j(s)\right)ds \\ | |||
&= \sum_i\sum_j L_i t_j \int_{S} y_i(s) y_j(s)ds \\ | |||
&= \sum_i^{n^2} L_i t_i \int_{S}( y_i(s) y_i(s))ds\\ | |||
&\qquad\text{ because orthogonal}\\ | |||
&= \sum_i^{n^2} L_i t_i\\ | |||
&\qquad\text{ because orthonormal} | |||
\end{align} | |||
</math> | |||
}} | |||
==Operations== | |||
===Addition=== | |||
Just add the coefficients | |||
===Multiplication=== | |||
===Rotation=== | |||
==Visualizations== | |||
Below are distorted sphere visualizations where the radius corresponds to the value at each point. | Below are distorted sphere visualizations where the radius corresponds to the value at each point. | ||
* [https://www.shadertoy.com/view/lsfXWH iq's 0-3] | * [https://www.shadertoy.com/view/lsfXWH iq's 0-3] | ||
| Line 55: | Line 89: | ||
==Applications== | ==Applications== | ||
===Lighting=== | |||
See Green<ref name="green2003lighting></ref>. | |||
===Saliency=== | ===Saliency=== | ||
* [http://duruofei.com/Research/SphericalHarmonics Ruofei's Website] | * [http://duruofei.com/Research/SphericalHarmonics Ruofei's Website] | ||
| Line 60: | Line 97: | ||
==Resources== | ==Resources== | ||
* [http://www.ppsloan.org/publications/StupidSH36.pdf Stupid SH] | * [http://www.ppsloan.org/publications/StupidSH36.pdf Stupid SH by Peter-Pike Sloan] | ||
* [ | * [http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf Spherical Harmonics Lighting by Robin Green] | ||
* [[Wikipedia:Spherical Harmonics]] | |||
==References== | ==References== | ||
<references /> | <references /> | ||