template<typename TrigFunc >
requires std::invocable<TrigFunc, double> && std::same_as<std::invoke_result_t<TrigFunc, double>, double>
| void MayaFlux::Kinesis::Discrete::apply_trig |
( |
std::span< double > |
data, |
|
|
TrigFunc |
func, |
|
|
double |
frequency, |
|
|
double |
amplitude, |
|
|
double |
phase |
|
) |
| |
|
noexcept |
Trigonometric map y = amplitude * f(frequency*x + phase) applied in-place.
- Template Parameters
-
| TrigFunc | Callable matching double(double) |
- Parameters
-
| data | Target span |
| func | Trigonometric function (std::sin, std::cos, etc.) |
| frequency | Frequency scaling applied to x |
| amplitude | Amplitude scaling applied to output |
| phase | Phase offset added to x before the function |
Definition at line 81 of file Transform.hpp.
86{
87 std::ranges::transform(data, data.begin(),
88 [&](double x) { return amplitude * func(frequency * x + phase); });
89}