Computational Geometry on the Sphere With Application to Automated Machining