Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[PROLOG] Give a predicate that calculates the distance between two geographic locations specified by latitude and longitude in radians. ?- distance( 45.421016, -75.690018, 45.4222, -75.6824,

[PROLOG]

Give a predicate that calculates the distance between two geographic locations specified by latitude and longitude in radians.

?- distance( 45.421016, -75.690018, 45.4222, -75.6824, D). D = 0.6089563918931657. 

image text in transcribed

This distance can be found as follows (great circle interpolation): Input: lat1,lon, and lat2, lon2 in radians Output: distance in kilometers lat -latz dradians = 2 * asin sqrt sin + cos(lat1) * cos(lat2) lony - lon2 sin distance = 6371.0 * drad ians Note that the GPS location use angles in degree but the above formula expects angles in radians. The angles can be converted as usual: angledegrees pi* 180 angle,adians =

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

Students also viewed these Databases questions

Question

How are arbitrators credentialed?

Answered: 1 week ago