public void Vincenty_CorrectlyCalculatesBearingFromPointBearingDistanceConcurrently(double latA, double lonA, double bearingInRadians, double distanceInMeters,
                                                                                            double expectedBearing, int maxIterations, double tolerance)
        {
            IGeographicCoordinate pointA = new GeographicCoordinate(latA, lonA);
            IAngle    initialBearing     = new Angle(bearingInRadians, AngleMeasurement.Radians);
            IDistance distance           = new Distance(distanceInMeters, DistanceMeasurement.Meters);

            IAngle expected = new Angle(expectedBearing, AngleMeasurement.Radians);

            var angles = new ConcurrentQueue <IAngle>()
            {
            };

            void action() => angles.Enqueue(pointA.BearingFrom(initialBearing, distance, maxIterations, tolerance));

            Action[] actions = Enumerable.Repeat((Action)action, 10).ToArray();

            while (angles.Count > 0)
            {
                angles.TryPeek(out IAngle result);

                Assert.Equal(expected, result);

                angles.TryDequeue(out result);
            }
        }
        public void Vincenty_CorrectlyCalculatesBearingFromConcurrently(double latA, double lonA, double latB, double lonB, double bearingInRadians, int maxIterations, double tolerance)
        {
            IGeographicCoordinate pointA = new GeographicCoordinate(latA, lonA);
            IGeographicCoordinate pointB = new GeographicCoordinate(latB, lonB);

            IAngle expected = new Angle(bearingInRadians, AngleMeasurement.Radians);

            var angles = new ConcurrentQueue <IAngle>()
            {
            };

            void action() => angles.Enqueue(pointA.BearingFrom(pointB, maxIterations, tolerance));

            Action[] actions = Enumerable.Repeat((Action)action, 10).ToArray();

            Parallel.Invoke(actions);

            while (angles.Count > 0)
            {
                angles.TryPeek(out IAngle result);

                Assert.Equal(expected, result);

                angles.TryDequeue(out result);
            }
        }
        public void Vincenty_CorrectlyCalculatesBearingFrom(double latA, double lonA, double latB, double lonB, double bearingInRadians, int maxIterations, double tolerance)
        {
            IGeographicCoordinate pointA = new GeographicCoordinate(latA, lonA);
            IGeographicCoordinate pointB = new GeographicCoordinate(latB, lonB);

            IAngle expected = new Angle(bearingInRadians, AngleMeasurement.Radians);

            IAngle result = pointA.BearingFrom(pointB, maxIterations, tolerance);

            Assert.Equal(expected, result);
        }
        public void Vincenty_CorrectlyCalculatesBearingFromPointBearingDistance(double latA, double lonA, double bearingInRadians, double distanceInMeters,
                                                                                double expectedBearing, int maxIterations, double tolerance)
        {
            IGeographicCoordinate pointA = new GeographicCoordinate(latA, lonA);
            IAngle    initialBearing     = new Angle(bearingInRadians, AngleMeasurement.Radians);
            IDistance distance           = new Distance(distanceInMeters, DistanceMeasurement.Meters);

            IAngle expected = new Angle(expectedBearing, AngleMeasurement.Radians);

            IAngle result = pointA.BearingFrom(initialBearing, distance, maxIterations, tolerance);

            Assert.Equal(expected, result);
        }