class LatLonAlt implements Serializable, SizeProvider {

    public static double normalizeLatitude(double in)
    {
        final double limit1 = 270.;
        final double limit2 = 450.;
        final double limit3 = 540.;
        double out = in;
        if (out > 90.)
        {
            if (out > limit3)
            {
                out %= 360.;
                if (out > limit1)
                {
                    out = out - 360;
                }
                else if (out > 90.)
                {
                    out = 180. - out;
                }
            }
            else if (out > limit1)
            {
                if (out > limit2)
                {
                    out = limit3 - out;
                }
                else
                {
                    out = out - 360;
                }
            }
            else if (out > 90.)
            {
                out = 180. - out;
            }
        }
        else if (out < -90)
        {
            if (out < -limit3)
            {
                out %= 360.;
                if (out < -limit1)
                {
                    out = out + 360;
                }
                else if (out < -90)
                {
                    out = -180 - out;
                }
            }
            else if (out < -limit1)
            {
                if (out < -limit2)
                {
                    out = -limit3 - out;
                }
                else
                {
                    out = out + 360;
                }
            }
            else if (out < -90)
            {
                out = -180 - out;
            }
        }
        return out;
    }

    private  LatLonAlt(double latitudeDegrees, double longitudeDegrees);

}