private static Point lambertToGeographic(Point org, LambertZone zone, double lonMeridian, double e, double eps) { double n = zone.n(); double C = zone.c(); double xs = zone.xs(); double ys = zone.ys(); double x = org.x; double y = org.y; double lon, gamma, R, latIso; R = Math.Sqrt((x - xs) * (x - xs) + (y - ys) * (y - ys)); gamma = Math.Atan((x - xs) / (ys - y)); lon = lonMeridian + gamma / n; latIso = -1 / n * Math.Log(Math.Abs(R / C)); double lat = latitudeFromLatitudeISO(latIso, e, eps); Point dest = new Point(lon, lat, 0); return(dest); }
public static Point convertToWGS84(Point org, Zone zone) { var lzone = new LambertZone(zone); if (zone == Zone.Lambert93) { return(lambertToGeographic(org, lzone, LambertZone.LON_MERID_IERS, LambertZone.E_WGS84, LambertZone.DEFAULT_EPS)); } else { Point pt1 = lambertToGeographic(org, lzone, LambertZone.LON_MERID_PARIS, LambertZone.E_CLARK_IGN, LambertZone.DEFAULT_EPS); Point pt2 = geographicToCartesian(pt1.x, pt1.y, pt1.z, LambertZone.A_CLARK_IGN, LambertZone.E_CLARK_IGN); pt2.translate(-168, -60, 320); //WGS84 refers to greenwich return(cartesianToGeographic(pt2, LambertZone.LON_MERID_GREENWICH, LambertZone.A_WGS84, LambertZone.E_WGS84, LambertZone.DEFAULT_EPS)); } }