double KOUEIX = 21162.65;
double KOUEIY = 22828.56;
Convert(KoueiYToLAT((long)KOUEIY), KoueiXToLNG((long)KOUEIX), ref lat, ref lng, 0);
Console.WriteLine(String.Format("{0:F20}", lat));
Console.WriteLine(String.Format("{0:F20}", lng));
public void KOUEIXYGConvertWGS84Deg(string KOUEIX, string KOUEIY, ref double LATDegd, ref double LNGDegd)
if (string.IsNullOrEmpty(KOUEIX) || string.IsNullOrEmpty(KOUEIY))
double ilng = (double.Parse(KOUEIX) / 3000.0 + 7680.0) / 60.0;
double ilat = (2760.0 - double.Parse(KOUEIY) / 3680.0) / 60.0;
Convert(ilat, ilng, ref LATDegd, ref LNGDegd, 0);
public void Convert(double ilat, double ilng, ref double olat, ref double olng, int mode)
MolodenskyConvert(ilat, ilng, 0.0, 6377397.155, 0.0033427731799399794, -148, 507, 685, 6378137.0, 0.0033528106710763545, 0, 0, 0, out olat, out olng, out num);
MolodenskyConvert(ilat, ilng, 0.0, 6378137.0, 0.0033528106710763545, 0, 0, 0, 6377397.155, 0.0033427731799399794, -148, 507, 685, out olat, out olng, out num);
private void MolodenskyConvert(double i_lat, double i_lng, double i_h, double from_a, double from_f, int from_dx, int from_dy, int from_dz, double to_a, double to_f, int to_dx, int to_dy, int to_dz, out double o_lat, out double o_lng, out double o_h)
double num = 2.0 * from_f - from_f * from_f;
double num2 = to_a - from_a;
double num3 = to_f - from_f;
int num4 = -(to_dx - from_dx);
int num5 = -(to_dy - from_dy);
int num6 = -(to_dz - from_dz);
double num7 = Math.Sin(i_lat * 0.017453292519943295);
double num8 = Math.Cos(i_lat * 0.017453292519943295);
double num9 = Math.Sin(i_lng * 0.017453292519943295);
double num10 = Math.Cos(i_lng * 0.017453292519943295);
double num11 = 1.0 / (1.0 - from_f);
double num12 = from_a / Math.Sqrt(1.0 - num * num7 * num7);
double num13 = from_a * (1.0 - num) / Math.Pow(1.0 - num * num7 * num7, 1.5);
double num14 = ((double)(-(double)num4) * num7 * num10 - (double)num5 * num7 * num9 + (double)num6 * num8 + num2 * num12 * num * num7 * num8 / from_a + num3 * (num13 * num11 + num12 / num11) * num7 * num8) / (num13 + i_h);
double num15 = ((double)(-(double)num4) * num9 + (double)num5 * num10) / ((num12 + i_h) * num8);
double num16 = (double)num4 * num8 * num10 * ((double)num5 * num8 * num9) + (double)num6 * num7 - num2 * (from_a / num12) + num3 * num12 * num7 * num7 / num11;
o_lat = (i_lat * 0.017453292519943295 + num14) / 0.017453292519943295;
o_lng = (i_lng * 0.017453292519943295 + num15) / 0.017453292519943295;
public double KoueiXToLNG(long X)
return ((double)X / 3000.0 + 7680.0) / 60.0;
public double KoueiYToLAT(long Y)
return (2760.0 - (double)Y / 3680.0) / 60.0;