Use precomputed trigonometric functions in SphereDomain

In real application, the trigonometric functions of sphere coordinates
(longitude and latitude) will be used frequently, so precompute them when
coordinates are changed for later use.