70 template <
typename Real>
76 inline static void Get(Real
t, Real cosA, Real& f0, Real& f1);
84 inline static void GetEstimate(Real t, Real
y, Real& f0, Real& f1);
88 template <
typename Real>
inline 95 Real invSinA = ((Real)1) / sin(A);
96 f0 = sin(((Real)1 - t) * A) * invSinA;
97 f1 = sin(t * A) * invSinA;
107 template <
typename Real>
108 template <
int N>
inline 111 static_assert(1 <= N && N <= 16,
"Invalid degree.");
118 Real
const onePlusMu[16] =
120 (Real)1.62943436108234530,
121 (Real)1.73965850021313961,
122 (Real)1.79701067629566813,
123 (Real)1.83291820510335812,
124 (Real)1.85772477879039977,
125 (Real)1.87596835698904785,
126 (Real)1.88998444919711206,
127 (Real)1.90110745351730037,
128 (Real)1.91015881189952352,
129 (Real)1.91767344933047190,
130 (Real)1.92401541194159076,
131 (Real)1.92944142668012797,
132 (Real)1.93413793373091059,
133 (Real)1.93824371262559758,
134 (Real)1.94186426368404708,
135 (Real)1.94508125972497303
140 (N != 1 ? (Real)1 : onePlusMu[0]) / ((Real)1 * (Real)3),
141 (N != 2 ? (Real)1 : onePlusMu[1]) / ((Real)2 * (Real)5),
142 (N != 3 ? (Real)1 : onePlusMu[2]) / ((Real)3 * (Real)7),
143 (N != 4 ? (Real)1 : onePlusMu[3]) / ((Real)4 * (Real)9),
144 (N != 5 ? (Real)1 : onePlusMu[4]) / ((Real)5 * (Real)11),
145 (N != 6 ? (Real)1 : onePlusMu[5]) / ((Real)6 * (Real)13),
146 (N != 7 ? (Real)1 : onePlusMu[6]) / ((Real)7 * (Real)15),
147 (N != 8 ? (Real)1 : onePlusMu[7]) / ((Real)8 * (Real)17),
148 (N != 9 ? (Real)1 : onePlusMu[8]) / ((Real)9 * (Real)19),
149 (N != 10 ? (Real)1 : onePlusMu[9]) / ((Real)10 * (Real)21),
150 (N != 11 ? (Real)1 : onePlusMu[10]) / ((Real)11 * (Real)23),
151 (N != 12 ? (Real)1 : onePlusMu[11]) / ((Real)12 * (Real)25),
152 (N != 13 ? (Real)1 : onePlusMu[12]) / ((Real)13 * (Real)27),
153 (N != 14 ? (Real)1 : onePlusMu[13]) / ((Real)14 * (Real)29),
154 (N != 15 ? (Real)1 : onePlusMu[14]) / ((Real)15 * (Real)31),
155 (N != 16 ? (Real)1 : onePlusMu[15]) / ((Real)16 * (Real)33)
160 (N != 1 ? (Real)1 : onePlusMu[0]) * (Real)1 / (Real)3,
161 (N != 2 ? (Real)1 : onePlusMu[1]) * (Real)2 / (Real)5,
162 (N != 3 ? (Real)1 : onePlusMu[2]) * (Real)3 / (Real)7,
163 (N != 4 ? (Real)1 : onePlusMu[3]) * (Real)4 / (Real)9,
164 (N != 5 ? (Real)1 : onePlusMu[4]) * (Real)5 / (Real)11,
165 (N != 6 ? (Real)1 : onePlusMu[5]) * (Real)6 / (Real)13,
166 (N != 7 ? (Real)1 : onePlusMu[6]) * (Real)7 / (Real)15,
167 (N != 8 ? (Real)1 : onePlusMu[7]) * (Real)8 / (Real)17,
168 (N != 9 ? (Real)1 : onePlusMu[8]) * (Real)9 / (Real)19,
169 (N != 10 ? (Real)1 : onePlusMu[9]) * (Real)10 / (Real)21,
170 (N != 11 ? (Real)1 : onePlusMu[10]) * (Real)11 / (Real)23,
171 (N != 12 ? (Real)1 : onePlusMu[11]) * (Real)12 / (Real)25,
172 (N != 13 ? (Real)1 : onePlusMu[12]) * (Real)13 / (Real)27,
173 (N != 14 ? (Real)1 : onePlusMu[13]) * (Real)14 / (Real)29,
174 (N != 15 ? (Real)1 : onePlusMu[14]) * (Real)15 / (Real)31,
175 (N != 16 ? (Real)1 : onePlusMu[15]) * (Real)16 / (Real)33
178 Real term0 = (Real)1 - t, term1 = t;
179 Real sqr0 = term0 * term0, sqr1 = term1 * term1;
182 for (
int i = 0; i < N; ++i)
184 term0 *= (b[i] - a[i] * sqr0) * y;
185 term1 *= (b[i] - a[i] * sqr1) * y;
static void Get(Real t, Real cosA, Real &f0, Real &f1)
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean GLboolean b
static void GetEstimate(Real t, Real y, Real &f0, Real &f1)