/* @x0: x value of point 0 @y0: y value of point 0 @x1: x value of point 1 @y1: y value of point 1 @x: the linear interpolant  */
static int ntc_fixp_linear_interpolate(int x0, int y0, int x1, int y1, int x)
/* @x0: x value of point 0 @y0: y value of point 0 @x1: x value of point 1 @y1: y value of point 1 @x: the linear interpolant  */
static int ntc_fixp_linear_interpolate(int x0, int y0, int x1, int y1, int x)
{
	if (y0 == y1 || x == x0) {
		return y0;
	}
	if (x1 == x0 || x == x1) {
		return y1;
	}
	return y0 + ((y1 - y0) * (x - x0) / (x1 - x0));
}