«  on: April 17, 2021, 08:49:03 pm »
									
								 
							 
							
								https://rosettacode.org/wiki/Haversine_formula#QB64- '*** Haversine Formula 
- '*** 
- '*** By George McGinn (04/16/2021) 
- '***    Modified on 04/16/2021 From TechBASIC to QB64 
- '***    NOTE: This program was originally submitted to the Rosetta Code 
- '***          website as part of a solution to one of their challenges 
- '***          (http://www.rosettacode.org/wiki/Roman_numerals/Decode#TechBASIC) 
- '*** 
- '***    Code is set up so user can add input statements to get units of distance 
- '***    and Lat/Lon for FROM/TO. 
- '*** 
- '*** NOTE: A more accurate Radius is commented out. Code runs with original 
- '***       problem showing correct solution. 
-   
-   
-   
- '*** Units: K=kilometers  M=miles  N=nautical miles 
-   
- '*** Change the To/From Latittude/Logitudes for your run 
-   
- '*** LAT/LON for Nashville International Airport (BNA) 
- lat1 = 36.12 
- Lon1 = -86.67 
-   
- '*** LAT/LONG for Los Angeles International Airport (LAX) 
- Lat2 = 33.94 
- Lon2 = -118.40 
-   
- '*** Initialize Values 
- UNIT = "K" 
- Distance = "" 
- 'Radius = 6378.137 
- Radius = 6372.8 
-   
- '*** Calculate distance using Haversine Function 
- lat1  = (- lat1  * _PI / 180)
- Lon1  = (- Lon1  * _PI / 180)
- Lat2  = (- Lat2  * _PI / 180)
- Lon2  = (- Lon2  * _PI / 180)
- DLon = Lon1 - Lon2 
-   
-   
- '*** Adjust Answer based on Distance Unit (kilometers, miles, nautical miles) 
-             Result = ANSWER * 0.621371192 
-             Distance = "miles" 
-             Result = ANSWER * 0.539956803 
-             Distance = "nautical miles" 
-             Result = ANSWER 
-             Distance = "kilometers" 
-   
- '*** Change PRINT statement with your labels for FROM/TO locations 
- PRINT "The distance from Nashville International to Los Angeles International in "- ; Distance; 
 
-   
-   
 
							 
						 
						
							
							
							
								
								Logged
							
 
							____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)