From 126e2695225b0bb1c49bcc92f1d2d1de11f4616d Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 7 Jun 2024 19:07:48 -0400 Subject: [PATCH] TS defines tables as [y_row_count x x_column_count] and we follow that weird Y, X order of arguments here --- util/include/rusefi/interpolation.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/util/include/rusefi/interpolation.h b/util/include/rusefi/interpolation.h index 0765648..e78c1a6 100644 --- a/util/include/rusefi/interpolation.h +++ b/util/include/rusefi/interpolation.h @@ -93,13 +93,14 @@ float interpolate2d(const float value, const TBin (&bin)[TSize], const TValue (& return priv::linterp(low, high, frac); } -template -float interpolate3d(const VType (&table)[RNum][CNum], - const RType (&rowBins)[RNum], float rowValue, - const CType (&colBins)[CNum], float colValue) +// TS defines tables as [y_row_count x x_column_count] and we follow that weird Y, X order of arguments here +template +float interpolate3d(const VType (&table)[RNum][X_ColumnNum], + const RType (&rowBins)[RNum], float yRowValue, + const X_CType (&colBins)[X_ColumnNum], float xColValue) { - auto row = priv::getBin(rowValue, rowBins); - auto col = priv::getBin(colValue, colBins); + auto row = priv::getBin(yRowValue, rowBins); + auto col = priv::getBin(xColValue, colBins); // Orient the table such that (0, 0) is the bottom left corner, // then the following variable names will make sense