double[][] CalcTheoreticalSVValues(Variogram vario,double MaximumDisplyDistanst){
  double[][] res=new double[2 * NumberOfLags + 1][2];
  for (int i=0; i < res.length; i++) {
    res[i][0]=i * MaximumDisplyDistanst / (2 * NumberOfLags);
switch (vario.Type) {
case EXPONENTIAL:
      if (res[i][0] != 0) {
        res[i][1]=vario.Nugget + vario.Sill * (1 - Math.exp(-res[i][0] / vario.Range));
      }
 else {
        res[i][1]=vario.Nugget;
      }
    break;
case GAUSSIAN:
  if (res[i][0] != 0) {
    res[i][1]=vario.Nugget + vario.Sill * (1 - Math.exp(-3 * (Math.pow(res[i][0],2)) / (Math.pow(vario.Range,2))));
  }
 else {
    res[i][1]=vario.Nugget;
  }
break;
case SPHERICAL:
if (res[i][0] > vario.Range) {
res[i][1]=vario.Nugget + vario.Sill;
}
 else if (res[i][0] > 0 && res[i][0] <= vario.Range) {
res[i][1]=vario.Nugget + vario.Sill * (1.5 * res[i][0] / vario.Range - 0.5 * Math.pow((res[i][0] / vario.Range),3));
}
 else {
res[i][1]=vario.Nugget;
}
break;
}
}
return res;
}

double [ ] [ ] CalcTheoreticalSVValues ( Variogram vario , double MaximumDisplyDistanst ) { double [ ] [ ] res = new double [ 2 * NumberOfLags + 1 ] [ 2 ] ; for ( int i = 0 ; i < res . length ; i ++ ) { res [ i ] [ 0 ] = i * MaximumDisplyDistanst / ( 2 * NumberOfLags ) ; switch ( vario . Type ) { case EXPONENTIAL : if ( res [ i ] [ 0 ] != 0 ) { res [ i ] [ 1 ] = vario . Nugget + vario . Sill * ( 1 - Math . exp ( - res [ i ] [ 0 ] / vario . Range ) ) ; } else { res [ i ] [ 1 ] = vario . Nugget ; } break ; case GAUSSIAN : if ( res [ i ] [ 0 ] != 0 ) { res [ i ] [ 1 ] = vario . Nugget + vario . Sill * ( 1 - Math . exp ( - 3 * ( Math . pow ( res [ i ] [ 0 ] , 2 ) ) / ( Math . pow ( vario . Range , 2 ) ) ) ) ; } else { res [ i ] [ 1 ] = vario . Nugget ; } break ; case SPHERICAL : if ( res [ i ] [ 0 ] > vario . Range ) { res [ i ] [ 1 ] = vario . Nugget + vario . Sill ; } else if ( res [ i ] [ 0 ] > 0 && res [ i ] [ 0 ] <= vario . Range ) { res [ i ] [ 1 ] = vario . Nugget + vario . Sill * ( 1.5 * res [ i ] [ 0 ] / vario . Range - 0.5 * Math . pow ( ( res [ i ] [ 0 ] / vario . Range ) , 3 ) ) ; } else { res [ i ] [ 1 ] = vario . Nugget ; } break ; } } return res ; }
calculates the points for drawing the theoretical variogram
