Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

can anyone give me a program to find the distance between two places on earth. Can be python,c,c++,java, html,etc

0 votes
asked Oct 30, 2021 by 5 G-16 Jain Bharggav Mukul (350 points)

1 Answer

0 votes
answered Oct 30, 2021 by Peter Minarik (86,640 points)
edited Oct 30, 2021 by Peter Minarik

If you want to find a distance, you can just use existing services, e.g. Google Maps: see here.

If you want to measure distance in a plane (2D) or in spaced (3D), then you can use vector arithmetics. See an example here.

If you want to create a program that actually calculates the real distance of real locations, then it's quite a complex task. You need to have access to a service with real-life data (Google Maps probably), gain access to this service, make queries regarding locations then calculate the distance based on the returned data. Maybe Google Maps offers API to ask for distances.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...