diff --git a/CHANGES/v2.4.md b/CHANGES/v2.4.md index 528c07701664b35ced89212e614a228a121e265a..95e4050186b6c9abe310a0cdf5404a5ec8d38f98 100644 --- a/CHANGES/v2.4.md +++ b/CHANGES/v2.4.md @@ -193,3 +193,8 @@ For developers: - `LDSHARED` is now correctly taken into account when launching `./configure`. - Fixed installation with `--disable-shared`. - Cppcheck upgraded to 1.84. + +## Version 2.4.3 (to be released) + +For users: + - Module VES: Fixed a bug in TD_GRID for 2D grids where the grid spacing is not the same for both dimensions. diff --git a/src/ves/GridLinearInterpolation.cpp b/src/ves/GridLinearInterpolation.cpp index 67b70a0b593c9bb2fc57403ac4f68c32db4cd9e1..dbf72c38d8b46c05972504633c92138f601c0d7f 100644 --- a/src/ves/GridLinearInterpolation.cpp +++ b/src/ves/GridLinearInterpolation.cpp @@ -68,8 +68,8 @@ double GridLinearInterpolation::getGridValueWithLinearInterpolation_2D(Grid* gri i00[0] = i01[0] = unsigned( std::floor( (arg[0]-grid_min[0])/grid_delta[0] ) ); i10[0] = i11[0] = unsigned( std::ceil( (arg[0]-grid_min[0])/grid_delta[0] ) ); - i00[1] = i10[1] = unsigned( std::floor( (arg[1]-grid_min[1])/grid_delta[0] ) ); - i01[1] = i11[1] = unsigned( std::ceil( (arg[1]-grid_min[1])/grid_delta[0] ) ); + i00[1] = i10[1] = unsigned( std::floor( (arg[1]-grid_min[1])/grid_delta[1] ) ); + i01[1] = i11[1] = unsigned( std::ceil( (arg[1]-grid_min[1])/grid_delta[1] ) ); // https://en.wikipedia.org/wiki/Bilinear_interpolation double x = arg[0];