Jump to content

[SOLVED] Calculating distances ...


budimir

Recommended Posts

Hey guys,

 

I'm creating a script where I should display distances between two cities. User can choose From - To cities and then distance is displayed

 

For example:

 

City 1    ->    City2    = 56km

City55    ->  City72  = 110km

...

 

In my DB I have this fields:

ID

date

from_city

to_city

distance

 

How do I calculate which is distance from one city to another???

 

Link to comment
Share on other sites

Here it is:

 

ID  From        To        Distance

1    Zagreb    Karlovac  52Km

2    Zagreb    Knin        274Km

3    Zagreb    Virovitica 154Km

4    Zagreb    Split        374Km

5    Karlovac  Pula        234Km

 

These are values from DB.

 

I'm not sure how to calculate distance (for example) from Karlovac to Knin??? And other combinations??

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.