19 Topics

Member Avatar for
Member Avatar for vegaseat

One way to find the shortest distance between a series of surface (x, y) points is to let Python module itertools find the non-repeating combinations of point pairs. Now you can apply the Pythagoras' theorem to find all the distances and the minimum distance.

Member Avatar for gerisam
3
2K
Member Avatar for vegaseat

Knowing the longitude and latitude coordinates of two cities you can calculate the distance between them. Use the code in https://www.daniweb.com/software-development/python/code/490561/postal-code-zips-and-location-python to find the coordinates.

3
2K
Member Avatar for Auroch

Hello, I have the following problem: Entering coordinates of points on a plain with keyboard (as rows x,y). Analysing this coordinates. Replacing coordinates in vector (point - structure data type). Then calculating distance from the first point to all another points. I've written the code of this problem using arrays …

Member Avatar for Auroch
0
2K
Member Avatar for bradley1234

If I input an arbitrary amount of points [x1,y1].....[xn,yn] into a function I need to somehow return/print the shortest distance between all of the points. I understand how to find the distance between two points (fairly easy and straight forward), but how do I take an arbitrary amount of points …

Member Avatar for vegaseat
0
185
Member Avatar for Tiger1

How do i implement levenshtein disance on records in a database table using python? I know how to connect python with database, coding in python may not be problem, and I also have the records in a database table. The problem is how do i make it work. Below is …

Member Avatar for Lucaci Andrew
0
163
Member Avatar for AmieCutie

So I've been working on a page to locate shops based on zip code and mile distance. I used this tutorial as a walk-through http://htmlcampus.com/build-a-zip-code-store-locator-application-in-php/ Now I've changed a couple of things like the mySQL table is called locations instead of zip_codes. I've tested it and it connects to the …

Member Avatar for cereal
0
1K
Member Avatar for mags11

Hi all. I'm having trouble with this simple Java program. When I compile it, numerous errors would happen. I put in let's say 50 miles for the speed of the car and 2 hours for the traveling hours. I run it and it you see this: Hours Distance Traveled --------------------------------- …

Member Avatar for mags11
0
2K
Member Avatar for jade_91

Hi, basically ive been trying to write code to work out where the nearest station for a person is based on their current location. I did have it working to display nearest station name and distance from that station but something went wrong I must have accidently deleted something or …

Member Avatar for DavidKroukamp
0
139
Member Avatar for xecure

I have a database full of user. This is roughly how the database looks: [CODE]| username | sex | birthdate | zip_code | |----------+-----+------------+----------| | coolUser | M | 02-14-1987 | 90210 | | blueUser | F | 06-16-1982 | 10011 | | . | . | . | . …

Member Avatar for Sogo7
0
372
Member Avatar for xecure

I have a database full of user. This is roughly how the database looks: [CODE]| username | sex | birthdate | zip_code | |----------+-----+------------+----------| | coolUser | M | 02-14-1987 | 90210 | | blueUser | F | 06-16-1982 | 10011 | | . | . | . | . …

Member Avatar for smantscheff
0
171
Member Avatar for mavrick4sky

SELECT * , 3956 *2 * ASIN( SQRT( POWER( SIN( ( 122.4058 - ABS( dest.lat ) ) * PI( ) /180 /2 ) , 2 ) + COS( 122.4058 * PI( ) /180 ) * COS( ABS( dest.lat ) * PI( ) /180 ) * POWER( SIN( ( 37.7907 - …

Member Avatar for fobos
0
173
Member Avatar for wondering_ed

Problem: solve the following Source of SHORTEST DISTANCE path of A,B,C,D,E,F,G. I already did link the strings of dots of ABCDEFG and made a polygon which is the other objectives, my only problem now is calculating the source of the shortest distance part of A,B,C,D,E,F,G. Am using net beans. Guys …

Member Avatar for raymagosi
0
164
Member Avatar for iamuser_2007

i see this code in this thread, i want to know how to get input by user or from file in this code. for example this list how to use it as input in this code. i don't know how to modify and how to use it. Daniweb thread reference …

Member Avatar for iamuser_2007
0
187
Member Avatar for karthik_ppts
Member Avatar for karthik_ppts
-2
169
Member Avatar for pharoah85

Could someone give me help on how to simplify this? Trying to write code to solve this equation: Distance = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2) I subbed a,b,c as the second set of coords. Im probably using too many vars as weel but im …

Member Avatar for pharoah85
0
210
Member Avatar for toritza

hello. I am quite new in python so i have a question. I have a csv file in which i have names of 30 cities and their coordinates(lat and long). i want to generate a distance matrix for these cities. How can i do this ?

Member Avatar for Gribouillis
0
2K
Member Avatar for EkoX

Hi.. how to calculate distance between two points.. each point have a coordinates (x,y). please help..

Member Avatar for Jx_Man
2
406
Member Avatar for Malinka

Hello Everyone, I have a list of digits. What is the most efficient way to count the number of tokens between two known digits? Here is what I came up with: [CODE] def dis(l, a1, a2): i1 = l.index(a1) i2 = l.index(a2) distance = i2 - i1 - 1 return …

Member Avatar for TrustyTony
0
119
Member Avatar for ggeoff

Hi I have several PCs and want to connect them on a home network. It makes sense to upgrade to a gigbit system. The trouble is how far may I locate a pc from the keyboard, mouse, and display?

Member Avatar for ggeoff
0
210

The End.