Skip to content
Snippets Groups Projects
Commit 75e8e5bf authored by zhaknafein's avatar zhaknafein
Browse files

Test endpoint method only using spherical calculation.

parent 323e5451
No related branches found
No related tags found
No related merge requests found
...@@ -217,8 +217,10 @@ class CalculationsTest < Test::Unit::TestCase ...@@ -217,8 +217,10 @@ class CalculationsTest < Test::Unit::TestCase
rdistance = [*0..100].sample rdistance = [*0..100].sample
startpoint = [45.0906, 7.6596] startpoint = [45.0906, 7.6596]
endpoint = Geocoder::Calculations.endpoint(startpoint, rheading, rdistance) endpoint = Geocoder::Calculations.endpoint(startpoint, rheading, rdistance)
assert_in_delta rdistance, Geocoder::Calculations.distance_between(startpoint, endpoint), 1E-5 assert_in_delta rdistance,
assert_in_delta rheading, Geocoder::Calculations.bearing_between(startpoint, endpoint), 1E-2 Geocoder::Calculations.distance_between(startpoint, endpoint, :method => :spherical), 1E-5
assert_in_delta rheading,
Geocoder::Calculations.bearing_between(startpoint, endpoint, :method => :spherical), 1E-2
end end
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment