Commit f2d4291d authored by Egmont Koblinger's avatar Egmont Koblinger

Fix the linear interpolation during weight mapping

Fixes #164
parent c0dc7626
Pipeline #43843 passed with stage
in 8 minutes and 40 seconds
......@@ -46,7 +46,7 @@ static double lerp(double x, int x1, int x2, int y1, int y2)
int dx = x2 - x1;
int dy = y2 - y1;
assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2);
return y1 + (dy*(x-x1) + dx/2) / dx;
return y1 + (x-x1) * dy / dx;
}
double
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment