Spherical polygon c++ conversion
Merge pull request from kh