Python Forum

Full Version: Distance between two points!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(Apr-28-2017, 03:02 AM)volcano63 Wrote: [ -> ]
(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 waist of forum space to show how big is yours  Naughty ?!
I beg to differ... If we are talking about longitude and latitude this remark completely makes sense. But maybe the OP is confusing Cartesian plane coordinates with longitude and latitude.
(Apr-28-2017, 09:45 AM)Ofnuts Wrote: [ -> ]I beg to differ... If we are talking about longitude and latitude this remark completely makes sense. But maybe the OP is confusing Cartesian plane coordinates with longitude and latitude.
Yep, for a 2-week students of language who can barely understand his/her assignment - full 3-dimensional distance between points by Earth surface Hand ?! You must be kidding me Wall
First off, lets be very clear, insulting other members of this forum will not be tolerated.

Secondly, there is no mention what so ever of latitude and longitude in the OP's description or the actual wording of the assignment that he posted.  So please, as the OP must do, confine your replies to the actual assignment.
Quote:Yes, latitude and longitude.

The following is a really good writeup on the various methods of calculating distance
using latitude and longitude: http://www.movable-type.co.uk/scripts/latlong.html.

AussieSusan is exactly correct.

I was involved in a project that controlled spin and distance traveled by a stratospheric balloon,
and we had to take curvature and altitude into account. Calculating distance taken from an
on-board GPS. The paper for this is still on the web somewhere.
Lars60+, the subject of latitude and longitude is not mentioned until you asked.  If we look at the original post and the later post of the "Exact assignment", there is no mention of them.  In fact, if we look at his distance formula, we can see it is nothing more than Pythagoren's  Theorem.  If we graph out the x,y coordinates, we find the intersection of the two lines create the base and height and the formula solves for the hypotenuse.  The "unit" of measurement is immaterial as far as the assignment goes.

As for using the "try/except", who cares what the instructors reasons are, though it's easy enough to imagine.  The fact is, they are told to incorporate it into their solution.

That is why it is so important that students who posts here be as explicit as possible about the assignment and just as important that those who reply to keep their suggestions within those parameters.

There is no denying there are many smart and talented people in this community, but in this forum, it is the students grade that is on the line, not ours.  So when you enter this forum, leave the ego at the door.
Pages: 1 2