File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -261,12 +261,6 @@ class SquareWaveGenerator : public SineWaveGenerator<T> {
261
261
}
262
262
};
263
263
264
- // / sine approximation.
265
- float sine (float t) {
266
- float p = (t - (int )t) - 0 .5f ; // 0 <= p <= 1
267
- float pp = p * p;
268
- return (p - 6 .283211f * pp * p + 9 .132843f * pp * pp * p) * -6 .221086f ;
269
- }
270
264
271
265
/* *
272
266
* @brief Sine wave which is based on a fast approximation function.
@@ -292,6 +286,14 @@ class FastSineGenerator : public SineWaveGenerator<T> {
292
286
}
293
287
return result;
294
288
}
289
+
290
+ protected:
291
+ // / sine approximation.
292
+ inline float sine (float t) {
293
+ float p = (t - (int )t) - 0 .5f ; // 0 <= p <= 1
294
+ float pp = p * p;
295
+ return (p - 6 .283211f * pp * p + 9 .132843f * pp * pp * p) * -6 .221086f ;
296
+ }
295
297
};
296
298
297
299
/* *
You can’t perform that action at this time.
0 commit comments