I'm practicing and I get an error
interpolacion.interpolacion@15db9742
package interpolacion;
public class interpolacion {
public static void Interpo(double X, float[] rango_X, float[] rango_Y ){
int Leng , xp1;
float dif ,difn , pro;
double X0, X1 ;
double y0 , y1 ;
double interpol;
Leng = rango_X.length - 1;
if (Leng >= 1){
dif = rango_X[0] - rango_X[1];
if (dif == 0){
System.out.println("varios valores iguales");
return ;
}
for ( int K = 2;K< Leng-1;K++){
if (Leng == 1){
break;
}
difn = rango_X[K - 1] - rango_X[K];
pro = dif * difn;
if (pro <= 0){
System.out.println("");
return ;
}
}
xp1 = 0;
for(float C : rango_X){
if (dif < 0){
if (C > X)
break;{
}
}else{
if (C < X){
break;
}
xp1 = xp1 + 1;
}
}
if (xp1 > Leng){
xp1 = Leng;
}
if (xp1 < 1){
xp1 = 1;
}
X0 = rango_X[xp1 - 1];
X1 = rango_X[xp1];
y0 = rango_Y[xp1 - 1];
y1 = rango_Y[xp1];
interpol=y0 + (X - X0) * (y1 - y0) / (X1 - X0);
System.out.println(interpol);
}
return ;