Questions tagged [closest-points]

107 questions
0
votes
0 answers

Plot Iine on Bing Maps on closest road

The following code plots a simple line on bing maps. Is there a way that the starting and end points of the line are on a closest road. I don't want to use the routing service. It would be great if the load time is as fast it would be for the code…
RukTech
  • 5,065
  • 5
  • 22
  • 23
0
votes
3 answers

Applying same function to every element in an array in C

Say I need to find the euclidean distance from one (x,y) coordinate to every coordinate in an array of million coordinates and then select the coordinate with the smallest distance. At present I loop though the million element array, calculate…
Lipika Deka
  • 3,774
  • 6
  • 43
  • 56
0
votes
2 answers

Find the closest two numbers and its the distance

I have a file like: 0.000000 0.000051 0.000076 0.000102 0.000152 0.000178 0.000203 0.000229 0.000254 0.000279 0.000305 0.000356 0.000381 0.000406 And I wanna find the two numbers and its closest distance. I'm using shell script. At the time I…
Rafael Castro
  • 579
  • 5
  • 14
0
votes
1 answer

CouchDB emit all documents pairwise in map function

I need to make a view that emits a value for each pair of documents (A cartesian product of _all_docs with itself) For example, assume DB has documents with IDs a, b, c -> then the view should emit 9 keys aa, ab, ac, ba, ... , cc (assuming no…
wizzard0
  • 1,883
  • 1
  • 15
  • 38
0
votes
1 answer

In the closest pair of points divide and conquer algorithm, what is the significance of sorting the "strip" by the points' y values?

I believe I understand the algorithm quite clearly, except for the step where you look to see if there's any points that are close by looking across the division and create a strip where points within the strip are candidates. But then the algorithm…
user2005643
0
votes
2 answers

JAVA 2D Find the K closest points to the origin in 2D plane

Find the K closest points to the origin in 2D plane, given an array containing N points. You can assume K is much smaller than N and N is very large. This is what i have so far: public class OriginQuestion { public static class Point { …
user2789485
  • 3
  • 1
  • 3
0
votes
2 answers

How to get 10 closest locations from table

I want to get 10 closest locations with longitude and latitude. I store longitude and latitude as double. I tried this: SELECT * FROM company as dest where 3956 * 2 * ASIN(SQRT( POWER(SIN((122.4058 - abs( dest.latitude)) * pi()/180 / 2),2) +…
malinchhan
  • 767
  • 2
  • 8
  • 28
0
votes
2 answers

Where does the O(n) come from in the time complexity of the closest pair algorithm?

The time complexity of the closest pair problem is T(n) = 2T(n/2) + O(n). I understand that 2T(n/2) comes from the fact that the algorithm is applied to 2 sets of half the original's size, but why does the rest come out to O(n)? Thanks.
user2100791
0
votes
2 answers

Shortest distance between two points. Brute-Force Algorithm

I'm supposed to determine the closest points using a brute-torce algorithm. I can't get this to compile. The algorithm is the first algorithm on this webpage. #include #include #include #include struct…
Darius Stewart
  • 49
  • 1
  • 2
  • 5
-1
votes
1 answer

How to find the closest pair distance for a point set in two dimensions?

I came across the below question and I am unable to find a way to find the closest pair distance using Divide and Conquer for the same, could someone please help? L is the closest pair distance among all points with negative x co ordinate and R is…
-1
votes
2 answers

Find the closest pair of points in a given set of points

Q) Find the closest pair of points in a given set of points. Expected time complexity: O(nlog2(n)) / O(nlog(n)) i was reading up this problem from here. However i am unable to understand a few things: what do we achieve by sorting points by Y which…
-1
votes
1 answer

How can I select data points based on similar coordinates and year with Python?

I have two datasets (shp files (converted into csv)) in which one contains fire history and the other lightning strikes. Both data sets have latitude and longitude coordinates (same projection) and year of fire/lightning strike. I want to be able to…
Thomas
  • 441
  • 3
  • 16
-1
votes
3 answers

Get the two closest points from a list of points

I am given a list of integers/floats and I need to find the two numbers closest together. How would I do that using only nested for loops?
PythonSOS
  • 339
  • 5
  • 16
-1
votes
2 answers

Computational geometry algorithm in finance?

Hi ive done some researchs in this forum and didnt really find a prpoer answer to my problem. I need to solve , with the fastest algorithm possible a financial problem. Given p set of points , each set have n points , i need to find the algorithm…
-2
votes
1 answer

Implementing closest points divide and conquer algorithm in C++

I'm trying to implement a divide and conquer closest points algorithm. As standard as it gets, yet my head is about to explode, because my code seems to (randomly) give incorrect answers. I wrote a random number generator using stl for testing…
A.F.K.
  • 69
  • 7