private static double cas(double theta) { // Basis function. The cas can be computed in two ways: // 1. cos(theta) + sin(theta) // 2. sqrt(2) * cos(theta - Math.PI / 4) return Constants.Sqrt2 * Math.Cos(theta - Math.PI / 4); }