コード例 #1
0
        public void Test(double srcLat, double srcLng, double dstLat, double dstLng, double expectedResult)
        {
            var src = new MapPoint(srcLat, srcLng);
            var dst = new MapPoint(dstLat, dstLng);

            Assert.AreEqual(expectedResult, calculator.CalculateInKm(src, dst), expectedResult * 0.01);
        }
コード例 #2
0
        private async Task <bool> LivesInRadiusOfCenter(double radiusInKilometers, Address address, MapPoint centerCoordinates)
        {
            MapPoint addressCoordinates = await addressToCoordinatesTranslator.Translate(address);

            double distance = distanceCalculator.CalculateInKm(addressCoordinates, centerCoordinates);

            return(distance <= radiusInKilometers);
        }