MCPcopy Create free account
hub / github.com/audacity/audacity / InterpolatePoints

Function InterpolatePoints

libraries/lib-mixer/Envelope.cpp:1151–1158  ·  view source on GitHub ↗

A few helper functions to make the code below more readable.

Source from the content-addressed store, hash-verified

1149
1150// A few helper functions to make the code below more readable.
1151static double InterpolatePoints(double y1, double y2, double factor, bool logarithmic)
1152{
1153 if(logarithmic)
1154 // you can use any base you want, it doesn't change the result
1155 return exp(log(y1) * (1.0 - factor) + log(y2) * factor);
1156 else
1157 return y1 * (1.0 - factor) + y2 * factor;
1158}
1159static double IntegrateInterpolated(double y1, double y2, double time, bool logarithmic)
1160{
1161 // Calculates: integral(interpolate(y1, y2, x), x = 0 .. time)

Callers 3

IntegralMethod · 0.85
IntegralOfInverseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected