Computers and Technology

C++ assignment - Calculating the distance between latitudes and longitudes The following is an example of the program's execution, as it should appear in the shell. Boldfaced, italicized text indicates input, while normal text indicates ouptut.
33.9425/N 118.4081/W Los Angeles International Airport
3
20.8987/N 156.4305/W Kahului Airport
47.4647/N 8.5492/E Zurich Airport
23.4356/S 46.4731/W Sao Paolo-Guarulhos International Airport
Start Location: 33.9425/N 118.408/W (Los Angeles International Airport)
Closest Location: 20.8987/N 156.43/W (Kahului Airport) (2483.3 miles)
Farthest Location: 23.4356/S 46.4731/W (Sao Paolo-Guarulhos International Airport) (6164.9 miles)
Formula:
let lat1 be the latitude of the first location
let lat2 be the latitude of the second location
let lon1 be the longitude of the first location
let lon2 be the longitude of the second location
let dlat be the difference in latitudes between the locations
let dlon be the difference in longitudes between the locations
let a = sin2(dlat/2) + cos(lat1) * cos(lat2) * sin2(dlon/2)
let c = 2 * atan2(sqrt(a), sqrt(1 - a))
let d = R * c R, in this part of the formula, is the radius of the Earth R = 3,959.9 miles

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:10, kellysimkin6196
Read the code below. what will the computer print if the input for year_variable is 1700? if year_variable == 1776: print("your answer is correct. the declaration of independence was signed in “year_variable”.") elif year_variable < 1776: compute_variable = 1776 - year_variable. print("add “compute_variable“ years to your answer for the correct answer.") elif year_variable > 1776: compute_variable = year_variable - 1776 print("subtract “compute_variable” years from your answer for the correct answer.")
Answers: 1
image
Computers and Technology, 23.06.2019 01:30, marmar72
Negative methods of behavior correction include all but this: sarcasm verbal abuse setting an example for proper behavior humiliation
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, scoutbuffy2512
On early television stations, what typically filled the screen from around 11pm until 6am? test dummies test patterns tests testing colors
Answers: 1
image
Computers and Technology, 24.06.2019 06:30, titalili0204
Adrawing that places all lines parallel to the z axis at an angle from the horizon is 99 ! a. an oblique drawing b. a perspective drawing c. an auxiliary view d. a one-point perspective drawing
Answers: 2
Do you know the correct answer?
C++ assignment - Calculating the distance between latitudes and longitudes The following is an exa...

Questions in other subjects:

Konu
Mathematics, 31.01.2020 08:03
Konu
Chemistry, 31.01.2020 08:03