Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

4. The shortest distance between two points on the surface of the globe (greatci

ID: 2082283 • Letter: 4

Question

4. The shortest distance between two points on the surface of the globe (greatcircle distance can be calculated by using the haversine formula. If and are the latitude and longitude of point 1 and and are the latitude 42d longaude of point 2, the great circle distance between the points is given by (Va) d -2R sina a sin 2 cos cos, cos 4,sin 2 and R 3,959 mi is the Earth where radius. Write a user-defined function that determines the distance between two points on the Earth. For the function name and arguments, use dis reatCir where the input arguments are the latitude and longitude of the points (degrees in decimal format, and dis is the great-circle two distance in miles. Use the function to calculate the distance between London, UK (51.508530, -0.12574o) and New York City, USA (40.71427 74.00597°)

Explanation / Answer

function programme in matlab:

function[d]=GreatCirDis(lat1,lat2,long1,long2)
a=((sin((lat2-lat1)/2))^2)+cos(lat1)*cos(lat2)*cos(lat1)*((sin((long2-long1)/2))^2);
R=3959;
d=2*R*asin(sqrt(a));

function calling:

clc;
clear all;
close all;
disLon_New=GreatCirDis(51.50853,-0.12574,40.71427,-74.00597)

simple this programme in matlab.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote