Questions tagged [closest-points]
107 questions
0
votes
0 answers
Closest pairs of elements in two sorted arrays
We are looking for an efficient algorithm to solve the following problem:
Given two increasingly sorted arrays.
Find the closest corresponding elements in each array that difference is
below a user given threshold. But only the closest of possible…

sgibb
- 25,396
- 3
- 68
- 74
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 …

Mattia Surricchio
- 1,362
- 2
- 21
- 49
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
- 94
- 1
- 15
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
- 1,160
- 1
- 10
- 27
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
- 4,380
- 19
- 85
- 141
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
- 99
- 1
- 5
- 22
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;
…

Nguyen Ngoc Hai
- 61
- 7
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…

Zach Romano
- 29
- 6
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
- 5
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
0
votes
1 answer
nd array object of numpy module
I am writing code to find out if a point 'npA' from the set 'pA' has a closest neighbour from a set 'pB' containing randomly generated points. (In the code I have a single point but in my application, the points would be randomly generated). My…

Joshwin Paul
- 3
- 1
- 3
0
votes
1 answer
Closest pair of points Divide&Conquer with vectors
So I have decided to implement an algorithm based on vectors to solve the Closest pair of points problem (2D). It seems to work with easy cases like
1.2 4.5
2.4 1.2
3.3 1.1
4.4 4.4
7.7 1.1
1.1 2.1
8.6 1.9
3.3 9.0
And the output is correct (for this…

alienflow
- 400
- 7
- 19
0
votes
1 answer
Storing (x,y) point into array
I am trying to store a point into an array. The array has to be a size of 10 and the points have to be a random number from 0 to 100. I am going to be using this array and then organize it through quick sort, and figure out which points are the…

Programmer1010
- 51
- 7
0
votes
0 answers
How to match two sets of points?How to find those points that have similar positions (close enough) in python?
I have two sets of extracted points (each element of points set include (x,y) coordinates) in two different image (d:database image, q:query image), each set may have a different number of points (d={(xj,yj)}, where j=1:n) and (q={(xi,yi)}, where…

S.EB
- 1,966
- 4
- 29
- 54