Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

mplete the following program that can calculate the direction from Greensboro to any point on be. You will have to convert the math equations to

image text in transcribed
image text in transcribed
mplete the following program that can calculate the direction from Greensboro to any point on be. You will have to convert the math equations to their proper C++ format. Note that atan2 thod of the cmath library that takes two parameters separated by a comma. Calculate the direction to any place on the earth. */ your name here / nclude nolude ing namespace std; t main () I double PI =3.141592653589793; / Declare two doubles, degrees and minutes, to hold the input. */ / Declare, latitude, longitude and direction to hold the destination and result */ / Declare two doubles, longDif and cosLat, to hold temporary values */ /* Declare gboroLat and gboroLong and set them to 0.629482084 and 1.36513836/ / Ask the user to enter the degrees and minutes of the destination longitude */ / Read degrees and minutes */ /* Calculate longitude =( degrees +60minutes)180 */ / Ask the user to enter the degrees and minutes of the destination latitude */ / Read degrees and minutes */ F Calculate latitude =( degrees +60minutes)180/ /* Set longDif to longitude minus gboroLong */ /* Set cosLat to the cosine of the latitude */ / Calculate direction =atan2(sin( longDif) cos Lat, cos( gboroLat ) sin( latitude ) sin( gboroLat) * cos Lat * cos( longDif) ) / / Convert the direction in radians to degrees by degrees = direction 180/ / Display the direction in degrees / Some interesting locations Sample input and output: Enter destination longitude in degrees and minutes 3948 Enter destination latitude in degrees and minutes 2125 The direction is 56.0834 degrees

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions