fix transform from carthesian to spherical coordinates
make phi and theta local variables
Merge pull request #20 from fourplusone/fix/spherical-transform

fixes fransform from carthesian to spherical coordinates