public static double[] powerCurve(double lower,double mid,double upper){
  final double[] curve=new double[3];
  curve[0]=((lower * upper) - (mid * mid)) / (lower - (2 * mid) + upper);
  curve[1]=Math.pow((mid - lower),2) / (lower - (2 * mid) + upper);
  curve[2]=2 * Math.log((upper - mid) / (mid - lower));
  return curve;
}

public static double [ ] powerCurve ( double lower , double mid , double upper ) { final double [ ] curve = new double [ 3 ] ; curve [ 0 ] = ( ( lower * upper ) - ( mid * mid ) ) / ( lower - ( 2 * mid ) + upper ) ; curve [ 1 ] = Math . pow ( ( mid - lower ) , 2 ) / ( lower - ( 2 * mid ) + upper ) ; curve [ 2 ] = 2 * Math . log ( ( upper - mid ) / ( mid - lower ) ) ; return curve ; }
given a range of values which change continuously in a non - linear way , we can map back and forth to a linear scale using some quadratic equations . the linear scale ranges from 0 - > 1 . this method will calculate the coefficients needed to solve the conversion functions in the next two methods . lower = actual value when linear value = 0 mid = actual value when linear value = . 5 upper actual value when linear value = 1
