distance

how to sort rows by a distance from a given point, mysql?

I'm trying to get 100 points from my table with a lowest distance to a given point. I'm using SELECT *, GLENGTH( LINESTRINGFROMWKB( LINESTRING( ASBINARY( POINTFROMTEXT("POINT(40.4495 -79.988)") ), ASBINARY(pt) ) ) ...

Approximate Estimation of Distance Matrices

I have a set of N objects, and I'd like to compute a NxN distance matrix. Sometimes my set of N objects is very large, and I'd like to compute an approximation to the NxN distance matrix by only computing a subset of the distance comparisons. Can anyone point me in the direction of something that calculates approximations to a full dis...

select restaurant table entries within a certain distance from current location using php

i have a database table with a list of restaurants including their names, latitudes, and longitudes. i would like to select all the restaurants that are within a certain distance from my current location. the current location is determined in the php file (right now i'm just using a static lat & lng). i found code for calculating the dis...

How to calculate Mahalanobis distance between two time series of equal dimensions?

I am doing some data-mining on time series data. I need to calculate the distance or similarity between two series of equal dimensions. I was suggested to use Euclidean distance, Cos Similarity or Mahalanobis distance. The first two didn't give any useful information. I cannot seem to understand the various tutorials on the web. So, Gi...

Hamming distance and error detection/correction properties.

Hi guys, Let's assume I want to have a possibility of detecting 4-bit errors and recovering 2-bit errors. What the Hamming distance should be then? I wonder if it should be d = Max{2r+1, r+1} or d = s + r, where s is 4 and r is 2? Thanks in advance for the reply! Cheers ...

Color Remapping - Matching target palette using a 3D grid?

Let's say I have color 'FOO', and it is stored in RGB format. I need to recolor 'FOO' so it matches the closest color in a list of colors. Doing this on the fly, couldn't I view the RGB values from each color as points on a 3D grid (r=x, g=y, b=z) and compute the distance between point 'FOO' vs the points from each color in the list? ...

iphone accelerometer speed and distance

Hi, I want to find distance traveled and velocity from accelerometer events. Like iphone's gMeter application is doing. Any suggestion, by which value or formula I should use for that? Thanks in advance. ...

calculate distance between two images

please help me calculate the distance between each pixels present in two images thats stored in database in java code ...

Getting shortest route(distance) in google maps api

I want to get the road distance between severel points(distance from one node to each other) in google maps api and pass those to asp.net code and then calculate the shortest route using an algorithm and then again pass the seqence of the nodes(optimised) to google maps and draw the path. If you guys can help me its great!!! ...

Sorting ArrayList of shapes

I have an ArrayList of MCommand objects (cmdList) and I want to sort it so that shapes with closest points are next to each other in the ArrayList. For example, say I have three lines in the ArrayList: line(xs, ys, zs, xe, ye, ze) cmdList[0] = line1(1.3, 2.5, 3, 4, 5, 6) cmdList[1] = line2(1, 5, 6.77, 7, 8, 2) cmdList[2] = line3(1, 6,...

Conventions that can be used for distance work in a team project

What sort of conventions would you advise when doing some distance work (say through CVS or SVN) on a team project? More specifically, what can be done to avoid someone doing widescale changes, which might be necessary, and running the risk of confusing/delaying other team members? If testing is necessary, how should it be carried out so...

Distance between two points. East-west + North-south...

Hi, I need to calculate the distance between two points, but not in the regular way. I need to know 'the east to west distance' + 'the north to south distance'. I guess this is more simple then the regular 'as the crow flies' calculation but i still can't figure out how to do it. I want to do this using a MySQL query and preferably ha...

Measuring short distances

What's the best way to wirelessly measure the distance between two objects (computer, smartphones or a specialised device) that are a few meters apart down to a ~10cm accuracy? Is this possible by piggybegging on WLan, bluetooth or GPS? ...

Distance between two locations isn't right

I have used the algorithm on http://www.movable-type.co.uk/scripts/latlong.html to find the distance between two points. My two points are long1 = 51.507467; lat1 = -0.08776; long2 = 51.508736; lat2 = -0.08612; According to Movable Type Script the answer is 0.1812km My application gives the result (d) as 0.230km // Haversine formu...

develop distance matrix using coordinates

hey, I have been given a problem, I basically have been given a piece of grid paper of arbitary size and have to develop a distance matrix using only the coordinates for each of the grid points on the page. I'm thinking the best approach would be something like the Floyd-Warshall or Djikstra algorithms for shortest path pair, but don'...

How to calculate distance between 2 places.

I've been asked if i could create a website like these: http://www.trackdollarbills.com/tour/ http://www.wheresgeorge.com/hits_by_county.php/ http://www.wherehaveibeen.com/ I'm curious as to how i would be able to calculate distance between places. For example if i were to enter a dollar bill in the system form Minneapolis, and that ...

C# wiimote library - computing distance from sensor bar to wiimote

I'm working with the C# managed wiimote library for a little fun project I'm working on, But I'm having trouble finding a good tutorial on how to calculate how far the wiimote is from the monitor (i.e sensor bar). I want to create a zoom effect where an object will grow or shrink based on how far back you move the wiimote from the screen...

Android - Distance between two Cities

Hi, I need in my Android Application the Distance and the Driving Time between Two cities. Is there a possibility to calculate this things for example via Google Navigator or Google Maps? (the driving distance, not the air-line distance) ...

get all markers within a given radius in sql

I'm trying to get all locations stored in the database with an sql statement described here My sql statement is: SELECT TOP(10) *, ( 6371 * acos( cos( radians(<cfqueryparam cfsqltype="CF_SQL_Numeric" value="#FORM....

Google Maps API, distance from metro stations

How can I get the list of e.g 3 nearest metro stations from specified point and the distance from the point to station? ...