Python Forum
Distance between two points!
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Distance between two points!
#11
(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.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#12
(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
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
#13
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.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#14
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.
Reply
#15
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.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple Distance Between Points Calculator Spade 1 1,742 Sep-17-2021, 03:14 PM
Last Post: DeaD_EyE
  Distance between indicies of a list johnissa 2 3,028 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