Calculate the distance in nautical miles using given formula

Assignment Help C/C++ Programming
Reference no: EM131218902

C Program Assignment

According to https://en.wikipedia.org/wiki/Great-circle_distance, the great circle distance based on two coordinates in nautical miles is given by:

d = r * Δσ where r is the radius of the earth and

Δσ = acos(sin(θ1) * sin(θ2) + cos(θ1)*cos(θ2) * cosΔλ)

The radius of the earth is a constant and its value in radians is r = 10800 / PI

Given 2 coordinates (Lat1, Long1, Lat2, and Long2) the formula can be re-written as:

Δσ = acos(sin(Lat1) * sin(Lat2) + cos(Lat1) * cos(Lat2) * cos(Long1 - Long2))

Because the coordinates on earth are given in degrees, you need to convert the degrees into radians by multiplying the degrees * PI / 180.

In this assignment, you will ask the user to enter two coordinates (Lat1, Long1, Lat2, Long2) and you will calculate the distance in nautical miles using the formula above. You will need to create a separate method call getDistance and pass the four coordinates as arguments and return the distance in nautical miles. Then you will display to the user the correspondent distance rounded to one decimal (i.e. 105.5 NM).

Reference no: EM131218902

Questions Cloud

How does this relate to database redesign : Explain the following statement in your own words: "Information systems and organizations create each other." How does this relate to database redesign?
Capture of traps based on thresholds : Your white paper must describe the establishment of a baseline, the capture of traps based on thresholds, the generation of alerts, and a discussion of alert handling. Your paper must be between two to three pages in length in APA format.
Describe why database redesign is necessary : Explain, one more time, the three ways that databases arise.
Find the impulse response and transfer function : Find the impulse response and transfer function of a filter matched to a triangular waveform as shown in the accompanying figure.
Calculate the distance in nautical miles using given formula : In this assignment, you will ask the user to enter two coordinates (Lat1, Long1, Lat2, Long2) and you will calculate the distance in nautical miles using the formula above.
Describe the logic of the stored procedure : Suppose you want to use a stored procedure to store a new row in COMPUTER. List the minimum list of parameters that need to be in the procedure. Describe, in general terms, the logic of the stored procedure.
How might that ethical dilemma impact strategic planning : Describe the ethical and legal considerations of a professional strategic financial management function in an organization. What would you do if faced with a legal or ethical dilemma related to financial management in a health care organization? ..
Which method provided more information : Are there any differences? Which method provided more information? Paste the photos into a Word document followed by a list of each photo's EXIF data.
What is the advantage of using different types of cursors : What is the advantage of using different types of cursors?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Recursive function

What is the result of the following recursive function when called with mm(10)? Write out the execution trace of this call to mm(10).

  C++ code to find the greatest common divisor

C++ Code to find the Greatest common divisor between two numbers.

  Store user input - write c++ program

Write C++ program to provide the following functionality - Ask users to enter 10 integer numbers.

  Lab11

ltbrgt

  Write some code that puts a zero in every element of q

Given a two-dimensional array of integers named q, with 2 rows and 4 columns, write some code that puts a zero in every element of q. Declare any variables needed to help you.

  After the array is created and loaded

After the array is created and loaded, the problem is then to sort the array and print out the contents of the sorted array. Please use a separate function for the sort routine and also a separate function for the print out of the array.

  Prepare a program to find the area of a triangle

Write a program that prompts the user to enter three point (x1, y1), (x2, y2), (x3, y3) of a triangle and display its area.

  Can you provide the constructor

Can you provide the constructor, copy constructor, copy assignment operator, destructor, move copy constructor, and move assignment operator on "------" ?

  Determining the purchase of new aircraft

Southern Air is considering purchase of new aircraft and has set aside $1.5B dollars for this. They have enough pilots to crew 30 new planes and enough maintence personnel to crew 40 new short range planes.

  Create a program that will input a group of floating point

Create a program that will input a group of floating point values, storing them as double values in an array. This array will then be sent to three functions.

  Explain how to implement two stacks in one array

Explain how to implement two stacks in one array A[1..n] in such a way that neither stack overflows unless the total number of elements in both stacks together is n. The PUSH and POP operations should run in O(1) time. You may provide your approac..

  Find the occupation and the score of each player

We saw in class how to represent a binary search tree in Prolog. Write a predicate lca (K1, K2, T) which allows one to find the smallest common ancestor of K1 and K2 in the tree T. The predicate lca shall print the subtree T such that the root is ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd