package org.usfirst.frc.team4536.robot;

import java.lang.Math;

public class Utilities {
	
	/*
	 * Takes in values and makes them between -1 and 1
	 */
	public static double limit (double input) {
		double output;
		
		if(input > 1) {
			output = 1;
		}
		else if(input < -1) {
			output = -1;
		}
		else {
			output = input;
		}
		
		return output;
	}
		
	/*
	 * Takes in values and makes sure they are both above deadZone and below -deadZone
	 * We use it to create a small region on our joysticks that outputs 0
	 * Once the joystick gets outside of the dead zone, it outputs their actual values
	 */
	public static double deadZone (double input, double deadZone) {
        double output;
		
		if ((input < deadZone) && (input > -deadZone))      //if the input is within the dead zone, return 0
            output = 0;
        else
            output = input;
		
		return output;
     	}
	
	
	/*
	 * 
	 */
	public static double speedCurve(double input, double curve) {
        double output;
        double adjustedCurve = curve;
        
        //We don't want to have bases smaller than 0.1 because of weird math
        if(curve <= 0.1) {         
            adjustedCurve = 0.1;
        }
        
        //If the input is negative then pretend that it's positive 
        if(input < 0) {            
            output = -(Math.pow(-input, adjustedCurve));  //and reflect it over the X axis
        }
        //If it's positive then simply take it to the power of the adjustedCurve
        else {                     
            output = Math.pow(input, adjustedCurve);
        }
        
        //output has to be between -1 and 1
        limit(output);
        
        return output;
    }
}

package org.usfirst.frc.team4536.robot;

import java.lang.Math;

public class Utilities {
	
	/*
	 * Takes in values and makes them between -1 and 1
	 *Suggested improvement: there is no need to have "output" in this method. Just use "return" in multiple places instead. Caleb
	 */
	public static double limit (double input) {
		double output;
		
		if(input > 1) {
			output = 1;
		}
		else if(input < -1) {
			output = -1;
		}
		else {
			output = input;
		}
		
		return output;
	}
		
	/*
	 * Takes in values and makes sure they are both above deadZone and below -deadZone
	 * We use it to create a small region on our joysticks that outputs 0
	 * Once the joystick gets outside of the dead zone, it outputs their actual values
	 *Suggested improvement: Same as for limit(). Caleb
	 */
	public static double deadZone (double input, double deadZone) {
        double output;
		
		if ((input < deadZone) && (input > -deadZone))      //if the input is within the dead zone, return 0
            output = 0;
        else
            output = input;
		
		return output;
     	}
	
	
	/*
	 * Suggested improvement: have comments right here. Caleb
	 */
	public static double speedCurve(double input, double curve) {
        double output;
        double adjustedCurve = curve;
        
        //We don't want to have bases smaller than 0.1 because of weird math
        if(curve <= 0.1) {         
            adjustedCurve = 0.1;
        }
        
        //If the input is negative then pretend that it's positive 
        if(input < 0) {            
            output = -(Math.pow(-input, adjustedCurve));  //and reflect it over the X axis
        }
        //If it's positive then simply take it to the power of the adjustedCurve
        else {                     
            output = Math.pow(input, adjustedCurve);
        }
        
        //output has to be between -1 and 1
        limit(output);
        
        return output;
    }
}

Update Utilities.java