This supplemental material contains a Matlab implementation of our algorithm.
The code is meant to demonstrate the computations and allow the reviewers to 
verify some of our claims. The complete source code of the project will be made
available upon publication.

Instructions:

1. Open Matlab and locate the current directory to the root folder of the 
   supplemental material (we recommend Matlab version 7.6 or later although we
   were able to run the code also on Matlab version 7.2).

2. Type 'algo1' or 'algo2' on the Matlab command line to execute Algo. 1
   or Algo. 2 from the paper with a test signal.

Some comments:

Each script generates three figures, two containing the unrotated and rotated 
test signal and a graph showing the condition number and rotation error as a 
function of band.

We encourage the reviewers to set breakpoints in the scripts and step through 
the computations. The oversampling rate and the method for generating the 
well-distributed points on the hemisphere can be chosen at the beginning of 
'algo1.m'. Analogously, the latitude employed for equi-latitude sampling points
can be changed in 'algo2.m',

The file 'pre.m' contains the setup for the computations. There, for example
the maximum Spherical Harmonics band and the signal can be changed. For the 
sake of speed, by default precomputed Spherical Harmonics coefficients are 
employed. However, we also provide functionality to compute basis function 
coefficients given a spherical (texture) map as input. The image file 
'world.jpg' used to generate the precomputed coefficients is located in the 
folder 'signals/'.

The file 'post.m' contains post-processing code for computing the reference 
solution and the per band rotation error.

The autors.
