一、将正负180的值转成0-360
/// <summary> /// 正负180, 0--->360 /// </summary> /// <param name="p"></param> /// <returns></returns> public static double Conv_k(double p) { while (p > 180) { p = p - 360; } while (p < -180) { p = p + 360; } if(p<=90) { return 90 - p; } if(p>90) { return 360 + (90 - p); } return 0; }