@Override public double calculateDistance(double[] x1,double[] x2){
  double expression=norm2(x1,x2) / sigma;
  if (expression > 1) {
    return 0.0d;
  }
 else {
    double minus=1.0d - expression;
    return Math.pow(minus,degree);
  }
}

@ Override public double calculateDistance ( double [ ] x1 , double [ ] x2 ) { double expression = norm2 ( x1 , x2 ) / sigma ; if ( expression > 1 ) { return 0.0d ; } else { double minus = 1.0d - expression ; return Math . pow ( minus , degree ) ; } }
calculates kernel value of vectors x and y .
