Python Forum
Distance between two points!
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Distance between two points!
#7
(Apr-28-2017, 02:49 AM)AussieSusan Wrote: If you are dealing with latitude and longitude then you also need to know how far apart the two locations can be. If they are more that a few 10's of km then you may need to use formulae that take the curvature of the Earth into account.
The equations you are using require a flat plane which the Earth approximates only for relatively short distances.
There are a number of other problems with your code andsome have already been mentioned. Had you even tried to run your code?
Susan
Why are you trying to confuse a guy? That is not the way to help - but a good way to annoy people.

Idiotic waste of forum space to show how big is yours  Naughty ?!

Functions are supposed to be called
distance(x1, x2, x3, x4)
main()
are function calls; you did not call main
distance - in your case - just returns function object

Remove stupid  Wall try/else, call main, fix call to distance - and your code should work

BTW, why are you importing math? You don't need it
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
Distance between two points! - by zepel - Apr-28-2017, 01:51 AM
RE: Distance between two points! - by Larz60+ - Apr-28-2017, 02:19 AM
RE: Distance between two points! - by zepel - Apr-28-2017, 02:26 AM
RE: Distance between two points! - by volcano63 - Apr-28-2017, 02:38 AM
RE: Distance between two points! - by AussieSusan - Apr-28-2017, 02:49 AM
RE: Distance between two points! - by volcano63 - Apr-28-2017, 03:02 AM
RE: Distance between two points! - by Ofnuts - Apr-28-2017, 09:45 AM
RE: Distance between two points! - by volcano63 - Apr-28-2017, 09:54 AM
RE: Distance between two points! - by zepel - Apr-28-2017, 02:52 AM
RE: Distance between two points! - by Turry - Apr-28-2017, 07:00 AM
RE: Distance between two points! - by Mekire - Apr-28-2017, 07:28 AM
RE: Distance between two points! - by Turry - Apr-28-2017, 07:31 AM
RE: Distance between two points! - by sparkz_alot - Apr-28-2017, 02:38 PM
RE: Distance between two points! - by Larz60+ - Apr-28-2017, 05:17 PM
RE: Distance between two points! - by sparkz_alot - Apr-28-2017, 08:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple Distance Between Points Calculator Spade 1 1,782 Sep-17-2021, 03:14 PM
Last Post: DeaD_EyE
  Distance between indicies of a list johnissa 2 3,084 Apr-25-2018, 01:04 AM
Last Post: johnissa

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020