(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.Why are you trying to confuse a guy? That is not the way to help - but a good way to annoy people.
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
Idiotic waste of forum space to show how big is yours ?!
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
try/else
, call main
, fix call to distance
- and your code should workBTW, 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.