Questions tagged [euclidean-distance]

the Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, and is given by the Pythagorean formula.

In mathematics, the Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, and is given by the Pythagorean formula. By using this formula as distance, Euclidean space (or even any inner product space) becomes a metric space. The associated norm is called the Euclidean norm.

http://en.wikipedia.org/wiki/Euclidean_distance

941 questions
4
votes
2 answers

GLSL Distance Field transparency

I am after smooth texture based outline effect in OpenGL. So far I tried mostly all kinds of edge detection algorithms which result mostly in crude and jagged outlines. Then I read about Distance Field. I found an example which does pretty nice…
Michael IV
  • 11,016
  • 12
  • 92
  • 223
4
votes
2 answers

Quickest way to calculate the Euclidean-Distance between two points in N-Dimensional space

I have to calculate the Euclidean Distance between two points in N-Dimensional space, and speed is crucial. I have two C style float arrays representing the two points in N-Dimensional space. The formula for the distance between them is (^ just…
user1357607
  • 214
  • 4
  • 13
4
votes
1 answer

Calculate squared Euclidean distance matrix on GPU

Let p be a matrix of first set of locations where each row gives the coordinates of a particular point. Similarly, let q be a matrix of second set of locations where each row gives the coordinates of a particular point. Then formula for pairwise…
Alexey
  • 5,898
  • 9
  • 44
  • 81
3
votes
4 answers

Alternative to using squareform (Matlab)

At the moment i am using the pdist function in Matlab, to calculate the euclidian distances between various points in a three dimensional cartesian system. I'm doing this because i want to know which point has the smallest average distance to all…
user1218247
3
votes
3 answers

Euclidean distance returning strange results

im writing a program to compare two images against each other based on color and im using the Euclidean distance algorithm however when i run it and pass in two images i get one distance and then when i pass in the same images but the other way…
Roy James Schumacher
  • 636
  • 2
  • 11
  • 27
3
votes
2 answers

Calculating a Voronoi diagram for planes in 3D

Is there a code/library that can calculate a Voronoi diagram for planes (parallelograms) in 3D? I checked Qhull and it seems it can only work with points, in its examples Voro++ works with different size of spheres but I couldn't find anything for…
zamazalotta
  • 423
  • 1
  • 6
  • 11
3
votes
1 answer

Euclidean Distance for Arrays of 3D points in Python

I have two .csv files of 3D points (numeric coordinate data) and associated attribute data (strings + numeric). I need to calculate the Euclidean distance between each point and every other point, and maintain the attribute data for each point…
COIh0rp
  • 63
  • 4
3
votes
1 answer

Calculate Distance Metric between Homomorphic Encrypted Vectors

Is there a way to calculate a distance metric (euclidean or cosine similarity or manhattan) between two homomorphically encrypted vectors? Specifically, I'm looking to generate embeddings of documents (using a transformer), homomorphically…
3
votes
2 answers

R: calculate Euclidean distance between two raster layers pixels

I have two raster layers for same area. I need to find the Euclidean distance between cell of coarse resolution raster and cell of fine resolution raster that fall within each cell of the pixels from my coarse resolution raster. For example: The…
Nikos
  • 426
  • 2
  • 10
3
votes
1 answer

Making an Euclidean Distance Matrix with Random Points in Python

I wrote a code that produces the desired number of points in a certain width and length range in the coordinate system. How can I calculate and tabulate the distance matrix of these points I produced using the Euclidean method? import…
user16726326
3
votes
4 answers

How to find most optimal number of clusters with K-Means clustering in Python

I am new to clustering algorithms. I have a movie dataset with more than 200 movies and more than 100 users. All the users rated at least one movie. A value of 1 for good, 0 for bad and blank if the annotator has no choice. I want to cluster similar…
3
votes
2 answers

Path that gets within given distance of each point in order

I have an ordered list of points in a 2D plane. I'd like to find the shortest route such that it gets at least within distance X (or closer) from each point, in the given order. How do I find this route? I realize that the points that will determine…
M. Volf
  • 1,259
  • 11
  • 29
3
votes
2 answers

What is the fastest way to compute the Euclidean distances of a very large matrix with complex numbers?

I have a very large input data set of 50,000 samples with 9 dimensions (i.e. a 50000x9 matrix). This data has been transformed using DFT: dft_D = data.dot(dft(9).T) / np.sqrt(9) I want to calculate the euclidean distance for each pair of rows. I…
mtruong1999
  • 129
  • 1
  • 10
3
votes
0 answers

Distance Metric different units

I am trying to cluster a radar database. The observations of a radar are given in Azimuth angle and range. For processing speed reasons I do not want to transform this polar data into a Cartesian system. A normal Euclidean distance metric needs the…
Metz
  • 73
  • 1
  • 5
3
votes
2 answers

Fastest way to calculate the shortest (euclidean) distance between points, in pandas dataframe

Consider the following pandas dataframe: print(df) Id X Y Type X of Closest Y of Closest 0 201 73.91 34.84 A NaN NaN 1 201 74.67 32.64 A NaN NaN 2 201 74.00 33.20 A …
MRHarv
  • 491
  • 1
  • 10
  • 22