Based on my quite old blog post back to 2003. http://lucille.sourceforge.net/blog/archives/000005.html
TinySHRot is good for your rendering engine and game engine.
- C89 + Header-only
- SH rotation only
- Shold work (visually) correctly with unit tests, but not verified in terms of mathematical correctness(Contribution is welcome!).
If you want fast and full-featured SH rotation code, there are good OSS codes these days, e.g. https://github.com/google/spherical-harmonics.
- Evaluation of the rotation matrices in the basis of real spherical harmonics
- Z. Gimbutas and L. Greengard, "A fast and stable method for rotating spherical harmonic expansions", 2009
MIT license
- Takeshi Haga haga.takeshi@gmail.com : Fixing bugs in original code.