mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-09 15:17:24 -05:00
2252 DMR Decoder error where LinearyInterpolator gets mu value outside 0 to 1.0 range. (#2253)
Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
@@ -33,9 +33,13 @@ public class LinearInterpolator
|
||||
*/
|
||||
public static float calculate(float x1, float x2, float mu)
|
||||
{
|
||||
if(mu < 0 || mu > 1)
|
||||
if(mu < 0)
|
||||
{
|
||||
throw new IllegalArgumentException("mu [" + mu + "] must be between 0 and 1");
|
||||
return x1;
|
||||
}
|
||||
else if(mu > 1)
|
||||
{
|
||||
return x2;
|
||||
}
|
||||
|
||||
return x1 + ((x2 - x1) * mu);
|
||||
|
||||
Reference in New Issue
Block a user