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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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