Questions tagged [closest-points]

95 questions
1
vote
1 answer

Explain working of compareX in qsort() library function

I was searching for the closest pair code and i found this which has used qsort() library function. I basically didn't get the concept of how it's compare parameter works. Explanation related to this particular code will be more appreciated.…
lethal
  • 41
  • 1
  • 8
1
vote
3 answers

Finding closest (not equal) rows in two matrices matlab

I have two matrices A(m X 3) and B(n X 3); where m >> n. Numbers in B have close or equal values to numbers in A. I want to search closest possible values from A to the values present in B in a way that at the end of search, A will reduced to (n X…
Mushi
  • 357
  • 2
  • 4
  • 14
1
vote
0 answers

Closest-points set on simplicial complex

Given two (low-dimensional, probably 2D) simplicial complexes P and Q, is there an efficient algorithm for constructing P', the subset of P consisting of all points in P which are the closest point to some point q in Q? For instance, if P and Q were…
Sneftel
  • 34,359
  • 11
  • 60
  • 94
1
vote
3 answers

Closest pair of ten integers with only primitive data type in python

I really need help with the code. The user need to input 10 integers and the program must display the closest pair. I was able to do it using itertools but my prof won't accept the .sort (), min(), enumerate(), etc... I need to do it manually.…
Teacher Ai
  • 117
  • 1
  • 2
  • 8
0
votes
1 answer

Find three closest points which triangle contains a given point on a sphere

I have a 3D sphere with points on its surface. These points are represented in spherical coordinates, so azimuth, elevation and r. For example my dataset is a matrix with all the available points on the given sphere: azimuth elevation …
0
votes
0 answers

Remove closest points IronPython and Dynamo

this is my first participation, I tell you that I am working in a visual programming environment using Iron Python and this is my problem: I have a list of points, but I want to keep only those that are greater than a distance "n" between them, this…
0
votes
1 answer

Generalized ICP algorithm in PCL

I am trying to solve this exercise (slide 40). I downloaded the kitchen-small dataset an performed the following two steps. First step: Convert Depth-Images from the dataset to Pointclouds. #include #include…
aleio1
  • 66
  • 1
  • 12
0
votes
0 answers

Smallest distance between 2D points Python 3 Code

Given points on a plane, find the smallest distance between a pair of two (different) points. Recall that the distance between points (1, 1) and (2, 2) is equal to sqrt((x1-x2)**2 + (y1-y2)**2). I've written below Python code(Divide & Conquer) but…
py guy
  • 1
  • 1
0
votes
1 answer

Verify that all edges in a 2D graph are sufficiently far from each other

I have a graph where each node has coordinates in 2D (it's actually a geographic graph, with latitude and longitude.) I need to verify that if the distance between two edges is less than MAX_DIST then they share a node. Of course, if they intersect,…
lorg
  • 759
  • 1
  • 4
  • 21
0
votes
1 answer

Closest pair of points Planar case

I am looking at the wikipedia entry for how to solve this. It lists five steps 1.Sort points along the x-coordinate 2.Split the set of points into two equal-sized subsets by a vertical line x = xmid 3.Solve the problem recursively in the left and…
Aaron
  • 3,790
  • 11
  • 69
  • 121
0
votes
2 answers

Random garbage ouput when trying to find the minimum distance between points in an array

What's the fuss about? I'm trying to find the minimum distance between points (distance between 2 points in a 2D - plane: distance from (x1, y1) to (y1, y2)), which are stored in array arr and then calculate and return the minimum of those…
gourabix
  • 129
  • 3
  • 14
0
votes
1 answer

How can I write a function to find 2 closest points in 2D dimensional array in Java?

How can I find 2 closest points in an Array in Java? My input is, int[][] tour = {{0, 0}, {4, 0}, {4, 3}, {0, 3}}; static double calcDistanceBetweenWaypoints(int[] src, int[] dest) { assert src.length == 2; assert dest.length == 2; …
0
votes
1 answer

Getting the first k closest pairs of points from a set of n points in O(nlogn) time?

Is it possible to find the k pairs of closest points in a set of n points faster than O(n^2)? I know that I can calculate the closest pair of points in O(nlogn), but with that algorithm, not all of the distances are calculated, so I cannot return…
0
votes
2 answers

Create line network from closest points with boundaries

I have a set of points and I want to create line / road network from those points. Firstly, I need to determine the closest point from each of the points. For that, I used the KD Tree and developed a code like this: def closestPoint(source, X =…
botibo
  • 11
  • 4
0
votes
2 answers

Find the closest point on a road network coordinates list to a given point

Working with Python, so my actual problem is computationally finding the closest 2D point from an array (thousands of points) which represents a road network coordinates to a given point (the car location). This calculation required every time stamp…
Ran
  • 1
  • 5