Skip to content

Commit

Permalink
Merge pull request #55 from WaterDesk/xuxi/fix-Curve_getYofX
Browse files Browse the repository at this point in the history
fix a typo in Curve::getYofX(double x) method
  • Loading branch information
LRossman committed Jul 1, 2020
2 parents 0c568d5 + b46b67e commit 72bf6bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Elements/curve.cpp
Expand Up @@ -71,7 +71,7 @@ double Curve::getYofX(double x)
{
double dx = xData[i] - xData[i-1];
if ( dx == 0.0 ) return yData[i-1];
return yData[i-1] + (x - yData[i-1]) / dx * (yData[i] - yData[i-1]);
return yData[i-1] + (x - xData[i-1]) / dx * (yData[i] - yData[i-1]);
}
}
return yData[xData.size()-1];
Expand Down

0 comments on commit 72bf6bf

Please sign in to comment.