package org.usfirst.frc.team2503.r2016;

/**
 * You can use this class for testing non-WPIlib code on your machine.
 */
public class Main {
	
	public static double[] VALUE_RANGE = {0.0, 1.0};
	public static double[] DEGREE_RANGE = {-91.0, 87.0};

	public static double MAPPING_SLOPE = (DEGREE_RANGE[1] - DEGREE_RANGE[0]) / (VALUE_RANGE[1] - VALUE_RANGE[0]);
	
	public static double valueToDegrees(double value) {
		return DEGREE_RANGE[0] + MAPPING_SLOPE * (value - VALUE_RANGE[0]);
	}
	
	public static double degreesToValue(double degrees) {
		return VALUE_RANGE[0] + (1.0 / MAPPING_SLOPE) * (degrees - DEGREE_RANGE[0]);
	}
	
	public static void main(String[] args) {
		for(double d = 0.0; d <= 1.0; d += 0.125) {	
			double degrees = valueToDegrees(d);
			System.out.println(degrees + " - " + degreesToValue(degrees));
		}
	}
	
}

@@ -34,16 +34,71 @@
 r2016;%0A%0A
+import org.usfirst.frc.team2503.lib.util.WarriorMath;%0A%0A
 /**%0A * Y
@@ -194,492 +194,8 @@
 %7B%0A%09%0A
-%09public static double%5B%5D VALUE_RANGE = %7B0.0, 1.0%7D;%0A%09public static double%5B%5D DEGREE_RANGE = %7B-91.0, 87.0%7D;%0A%0A%09public static double MAPPING_SLOPE = (DEGREE_RANGE%5B1%5D - DEGREE_RANGE%5B0%5D) / (VALUE_RANGE%5B1%5D - VALUE_RANGE%5B0%5D);%0A%09%0A%09public static double valueToDegrees(double value) %7B%0A%09%09return DEGREE_RANGE%5B0%5D + MAPPING_SLOPE * (value - VALUE_RANGE%5B0%5D);%0A%09%7D%0A%09%0A%09public static double degreesToValue(double degrees) %7B%0A%09%09return VALUE_RANGE%5B0%5D + (1.0 / MAPPING_SLOPE) * (degrees - DEGREE_RANGE%5B0%5D);%0A%09%7D%0A%09%0A
 %09pub
@@ -303,90 +303,83 @@
 s = 
-valueToDegrees(d);%0A%09%09%09System.out.println(degrees + %22 - %22 + degreesToValue(degrees)
+WarriorMath.map(-90.0, 90.0, 87.5, 0.0, 1.0);%0A%09%09%09System.out.println(degrees
 );%0A%09

Use WarriorMath for mapping