package seng302.Networking.Utils;

/**
 * Created by fwy13 on 28/04/17.
 */
public class AC35UnitConverter {

    public static double convertGPS(int value){
        //converts latitude or longitue to angle
        return (double) value * 180.0 / 2147483648.0;//2^31 = 2147483648
    }

    public static int convertGPSToInt(double value){
        //converts latitude or longitue to angle
        return (int) (value * 2147483648.0/180.0);//2^31 = 2147483648
    }

    public static double convertHeading(long value){
        return (double) value * 360.0/65536.0;//2^15
    }

    public static double convertTrueWindAngle(long value){
        return (double) value * 180.0/32768.0;//-2^15 to 2^15
    }

}
