code: private void precompute() {
          sinTheta = Math.sin(theta);
          cosTheta = Math.cos(theta);
          sinPhi = Math.sin(phi);
          cosPhi = Math.cos(phi);
      }
docs: Pre-computes sin and cos of rotation angles.