public void Svy21ToLatLongTest() { LatLongCoordinate expected, actual; Svy21Coordinate test; // SVY21 reference point. expected = new LatLongCoordinate(1.366666, 103.833333); test = new Svy21Coordinate(38744.572, 28001.642); actual = Svy21.ComputeLatitudeLongitude(test); Assert.AreEqual(expected.Latitude, actual.Latitude, ToleranceLatLong); Assert.AreEqual(expected.Longitude, actual.Longitude, ToleranceLatLong); // Corner of Ang Mo Kio 66kV Substation. expected = new LatLongCoordinate(1.3699278977737488, 103.856950349764668); test = new Svy21Coordinate(39105.269, 30629.967); actual = Svy21.ComputeLatitudeLongitude(test); Assert.AreEqual(expected.Latitude, actual.Latitude, ToleranceLatLong); Assert.AreEqual(expected.Longitude, actual.Longitude, ToleranceLatLong); // Corner of Jurong Lake Canal 400kV Cable Bridge. expected = new LatLongCoordinate(1.3446255443241177, 103.72794378041792); test = new Svy21Coordinate(36307.704, 16272.970); actual = Svy21.ComputeLatitudeLongitude(test); Assert.AreEqual(expected.Latitude, actual.Latitude, ToleranceLatLong); Assert.AreEqual(expected.Longitude, actual.Longitude, ToleranceLatLong); // Corner of Sembawang 66kV Substation. expected = new LatLongCoordinate(1.4520670518379692, 103.83080332777138); test = new Svy21Coordinate(48187.789, 27720.130); actual = Svy21.ComputeLatitudeLongitude(test); Assert.AreEqual(expected.Latitude, actual.Latitude, ToleranceLatLong); Assert.AreEqual(expected.Longitude, actual.Longitude, ToleranceLatLong); }
public static LatLongCoordinate ComputeLatitudeLongitude(Svy21Coordinate coordinate) { return(ComputeLatitudeLongitude(coordinate.Northing, coordinate.Easting)); }
public static LatLongCoordinate ComputeLatitudeLongitude(Svy21Coordinate coordinate) { return ComputeLatitudeLongitude(coordinate.Northing, coordinate.Easting); }