[Groonga-commit] groonga/groonga [master] test: fix calculation logic for longitude on equator

Back to archive index

HAYASHI Kentaro null+****@clear*****
Wed Oct 31 15:09:27 JST 2012


HAYASHI Kentaro	2012-10-31 15:09:27 +0900 (Wed, 31 Oct 2012)

  New Revision: ef1d51ea1f4460d9b66bc6e027ed04580e1fe3d4
  https://github.com/groonga/groonga/commit/ef1d51ea1f4460d9b66bc6e027ed04580e1fe3d4

  Log:
    test: fix calculation logic for longitude on equator

  Modified files:
    test/command/tools/geo/generate-grntest-data.rb

  Modified: test/command/tools/geo/generate-grntest-data.rb (+4 -3)
===================================================================
--- test/command/tools/geo/generate-grntest-data.rb    2012-10-31 11:16:53 +0900 (fec43d4)
+++ test/command/tools/geo/generate-grntest-data.rb    2012-10-31 15:09:27 +0900 (747c191)
@@ -583,12 +583,13 @@ class GrnTestData
                                                 @latitude_end.to_i)
           else
             slope = latitude_delta / longitude_delta.to_f
-            intercept = -latitude_delta / slope
-            north_distance = calculate_distance(intercept * GRN_GEO_RESOLUTION,
+            intercept = @latitude_start_degree - slope * @longitude_start_degree
+            longitude_on_equator = -intercept / slope * GRN_GEO_RESOLUTION
+            north_distance = calculate_distance(longitude_on_equator,
                                                 0,
                                                 @longitude_start.to_i,
                                                 @latitude_start.to_i)
-            south_distance = calculate_distance(intercept * GRN_GEO_RESOLUTION,
+            south_distance = calculate_distance(longitude_on_equator,
                                                 0,
                                                 @longitude_end.to_i,
                                                 @latitude_end.to_i)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index