package org.usfirst.frc.team4342.api.pnuematics;

import org.usfirst.frc.team4342.robot.components.Repository;

import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Relay.Value;

/**
 * This class is for controlling a compressor
 */
public class Compressor 
{
	private Relay relay;
	
	public Compressor(Relay relay)
	{
		this.relay = relay;
	}
	
	public void handle()
	{
		final double velocity = Math.sqrt(Math.pow(Repository.Navx.getVelocityX(), 2) + Math.pow(Repository.Navx.getVelocityY(), 2));
		final double throttle = Math.sqrt(Math.pow(Repository.DriveStick.getX(), 2) + Math.pow(Repository.DriveStick.getY(), 2));
		final double ratio = (velocity/throttle);
		final double PushValue = 20.0;
		
		if((ratio < PushValue) || DriverStation.getInstance().isBrownedOut())
		{
			relay.set(Value.kOff);
		}
		else
		{
			relay.set(Value.kForward);
		}
	}
	
	public Relay getRelay()
	{
		return relay;
	}
}

@@ -664,32 +664,35 @@
 ck.getY(), 2));%0A
+%09%09%0A
 %09%09final double r
@@ -699,31 +699,107 @@
 atio
- = (velocity/throttle);
+;%0A%09%09if (Math.abs(throttle - 0.0) %3E= 0.0001)%0A%09%09%09ratio = (velocity/throttle);%0A%09%09else%0A%09%09%09ratio = 1;%0A%09%09
 %0A%09%09f

Update Compressor.java