예제 #1
0
파일: Svy21Test.cs 프로젝트: jcheng31/SVY21
        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);
        }
예제 #2
0
 public static Svy21Coordinate ComputeSvy21(LatLongCoordinate coordinate)
 {
     return(ComputeSvy21(coordinate.Latitude, coordinate.Longitude));
 }
예제 #3
0
파일: Svy21.cs 프로젝트: jcheng31/SVY21
 public static Svy21Coordinate ComputeSvy21(LatLongCoordinate coordinate)
 {
     return ComputeSvy21(coordinate.Latitude, coordinate.Longitude);
 }