Questions tagged [distance]
Distance is a numerical description of how far apart objects are.
3,753
questions
-1
votes
0
answers
7
views
get pin code list in India by using google map apis in given area
I am trying to get all the pin code lists around a given Pincode by distance. For eg., if my Pincode location is set to 121006 and the distance is 5 km it should give me 121001,12002,121003 etc. all ...
-1
votes
0
answers
5
views
What is the difference between Orthogonal Distance Regression (ODR) and Nonlinear Orthogonal Regression (ONLS)?
I found out by looking up information that:
1.Orthogonal Distance Regression (ODR) calculation is ([https://www.geeksforgeeks.org/orthogonal-distance-regression-using-scipy/][1]) Orthogonal Distance ...
-1
votes
1
answer
22
views
Form a list of pairwise metrics (distance) using a matrix lookp comming from a python pandas dataframe
I have a distance matrix as a dataframe:
data_map = {
'startNode':["0","0","0","0","0","455","455","455","455",...
0
votes
0
answers
16
views
Using different distance calculate kmeans cluster
i'm a program beginner, i have two datasets, one of dataset just have one feature, other have three features, i want to use use k-means predict cluster by different distance, but one feature of my ...
0
votes
0
answers
17
views
How to get GPS coordinates of the centre of an rectangular area?
I have 4 GPS points that form the boundaries of a marine area. I need to know the GPS coordinates of the centre of this area, to use it as a basis for calculating the distance to other marine areas. ...
1
vote
1
answer
25
views
Plot coastline and calculate distances (marmap and ggmap)
I am working on a research project in marine ecology, using R, and I would like to create a map of a small and precise part of the French Mediterranean coast. From this map I would like to add the ...
0
votes
1
answer
21
views
r - Select a numerical value in a Matrix which is based of another string dataset (Distance between two countries)
I have a dataset(1) of investments where the target and the host country are listed.
In addition, I have a matrix(2) which shows the distance between all countries.
Right now I would like to add a ...
0
votes
0
answers
9
views
Mesh lab and angles
How can I measure angles using mesh lab? the software only measures linear distances! I am working on a project to supeimpose study models and measure angles and it is not working !
1
vote
1
answer
14
views
Understanding broadcasting and arithmetic operations on different dimension tensors
I'm currently working on computing various similarity metrics between vectors such as cosine similarity, euclidean distance, mahalanobis distance, etc. As I'm working with vectors that can be very ...
0
votes
0
answers
6
views
Euclidean distance for every 10 rows
I am working an video observations for my master thesis and I am analysing this in RStudio. There are 10 pigs and there are 5 frames. I want to calculate the euclidean distance for each frame ...
0
votes
1
answer
19
views
How can i round 2 numbers but keep their rankings intact in node?
I have a distance calculation code where i take the distance and use toFixed(1) to make it a single digit after comma. The code looks like this:
const distance = parseFloat(!sortInfo?.length || ...
0
votes
0
answers
32
views
Distance Between Two DFs With A Few Variables
I'd like some help with a kind of complex situation. I'll try to be very objective and thanks in advance:
I have two dataframes. 1) df has a list of a few thousand coordinates of services done on the ...
1
vote
0
answers
28
views
Polygonal scatter diagram with python
I have a matrix of N observations and F features. Among the N observations, 5 represent reference samples that I wish to compare with others (with distance or similarity measures). Depending on how ...
-3
votes
0
answers
11
views
Step-wise by row Haversine distance calculation
I have a data frame containing latitude - longitude positions and I want to calculate the distance in meters between these positions step-wise, row-by-row. I have been using the Haversine formula and ...
-1
votes
0
answers
10
views
German postcodes with travel time
I'm looking for a dataset about the average travel time in minutes by car from any German postcode to another. Since there are about 29000 German postcodes we get about 420 Million combinations. I ...
0
votes
0
answers
8
views
select points in a specific condition between two point layers
I want to select two point set between two point layers.
Each set has multiple coordination of Gas Stations.
But, There's an error between two set.
For example, set A's Coordination of Westhofen Gas ...
1
vote
1
answer
16
views
R terra calculate area moment of inertia OR how to get (weighted) raster-cell distance from patch-centroid
I'm trying to calculate a measure akin to the moment of inertia using a raster layer and I am struggling to figure out how to get the distance of each cell to a patch's centroid and then extracting ...
0
votes
1
answer
90
views
Haskell - Incorrect distance returning from Haversine
I have the code below for calculating the Haversine distance between a list of airports, however it is consistently returning the incorrect value. For example, running the code below on ORD (Chicago) ...
0
votes
2
answers
47
views
Geopy distance between two point tuples of (lat, lon) coordinates
I've been trying to measure geographic distance between points in a GeoDataframe (gdb['geometry']) and one specific point, let's say, b_xy.
gdb['geometry'] is a geodatabase containing tuples of lon/...
0
votes
1
answer
29
views
Iterate over a list of distances in Netlogo
I need help for the following issue.
Basically, I have four turtles and a list of distances among them, let's say [ 0 1 2 3 ]. Zero is the distance of a turtle from itself.
I want to obtein the ...
-1
votes
1
answer
29
views
Google distance matrix API works on Windows not on webserver
Google distance matrix API is enabled and works on Windows but on webserver all I get is NULL for an answer. I checked on Google API Console and this API is enabled for ALL PLATFORMS. All can think ...
0
votes
1
answer
41
views
how to calculate pairwise similarity (Jaccard Distance) between sets
I have a huge json file (at least thousands of keys) like:
{"A": ["5-65", "5-66", "5-67", "6-12", "6-59"],
"B": ["5-65",...
1
vote
4
answers
55
views
how to calculate Manhattan distance (or L1/ cityblock) for two 2D array?
For 1D vector/array it's easier. For example:
array1 = [1, 2, 3]
array2 = [1, 1, 1]
manhattan distance will be: (0+1+2) which is 3
import numpy as np
def cityblock_distance(A, B):
result = np....
0
votes
0
answers
44
views
OpenCV: Distance between fixed camera and an object
I have a fixed camera so I know the distance between the camera to the ground, as well as the distance between the camera and the bottom line in the image (which is the floor).
I have an object in the ...
0
votes
0
answers
9
views
Smart pool swimming tracking
I'm a competitive swimmer and would like more detailed feedback on my swims.
A regular smartwatch has gyro/accererometer/gps/magnetometer, but has a few issues:
Laps aren't being counted instantly, ...
0
votes
0
answers
17
views
Find position with most closer points but with priority
How can i find a (x, y) position that is closer to the maximum points possible given a distance. But also we want to always be in range of a specific point. I added 2 cases to explain better.
Image
To ...
0
votes
1
answer
42
views
How to calculate hamming distance for more than 2 inputs
here the question
1001110
1110101
1010011
0011011
How can calculate hamming distance for this example. Can you explain pls for more than 2 inputs.
0
votes
0
answers
18
views
Error when applying decay.model from betapart
I used to apply the decay.model function from betapart package without problems with R version 3.6 but since updating it to 4.1.3 I am having an error when applying the decay.model:
Error in xj[i, , ...
0
votes
0
answers
53
views
Splitting Polyline based on starting point using Shapely
I have a network of polylines and point data that I am trying to split out into individual line segments based on a given starting point of the network. I know that this can be done using the ArcGIS ...
0
votes
0
answers
48
views
Manhattan Distance
How can I calaulate the 3D Manhattan distance on excel.
I know the 2D formula but I have absolutely no idea about the Manhattan distance formula for 3D
for example, now I have 2 points:
c1 = (6.25, 4....
0
votes
0
answers
26
views
Is it possible to use jump flood to generate dijkstra map in GLSL
I'm trying to optimize the performance of my Dijkstra map generation shader.
Currently I'm using the traditional method I've learned from
http://www.roguebasin.com/index.php/Dijkstra_Maps_Visualized
...
0
votes
0
answers
25
views
Finding the distance between points, specifically in x and y values
I've been trying to develop a sort of, arena shooter using John Zelle's graphics library, and I've run into a snag when trying to make the enemies move. Zelle's graphics.move() function only takes an ...
0
votes
1
answer
72
views
shortest distance between a point and a rectangle based on numpy implementation
Goal:
For a point a and a rectangle B, I would like to calculate the shortest distance between these two objects.
Motivation
Because this calculation is part of the innermost loop of multiple loops, I ...
0
votes
0
answers
3
views
How to calculate Distance D to object from a tilted camera with known H?
Considering the camera is not tilted, it is easy to get the distance. However, can you refer a source where camera is tilted at some angle on y axis. By tilt i mean pitch. Also the camera is not ...
2
votes
1
answer
61
views
Create dissimilarity matrix from data.frame with three columns
This data.frame contains the dissimilarity y between two communities comm1 and comm2. I would like to convert it to a dissimilarity matrix of type dist.
library(tidyverse)
library(RcppAlgos)
k<-10 ...
1
vote
0
answers
50
views
Why is Math.hypot so slow?
I am performing a ton of distance calculations in my code, to the point where Math.sqrt(a*a + b*b) is run hundreds of thousands of times.
I then recalled how there is a Math.hypot function that does ...
0
votes
0
answers
11
views
Generalize Kendall tau distance to ordered groups?
If we have two ordered lists, e.g., A=[1,2,3,4,5], B=[3,5,4,2,1], then we could use Kendall tau distance (which is 0.8) to measure the dissimilarity between ordered lists A and B.
However, if now what ...
1
vote
1
answer
49
views
How to solve this problem with the st_distance function from sf giving an error when inspecting the data?
I have this data:
df <- data.frame (pc_home = c(1042, 2052, NA, 4021, 9423, NA, 1502, 5942),
pc_work = c(NA, 2105, NA, 4352, 8984, NA, 1495, 6050),
centroid_home ...
0
votes
1
answer
40
views
How do I apply velocity and acceleration to match the result of math formulas
So I have an initial velocity iv a final velocity fv (that is always 0) a time t and an acceleration variable a
I use these variables to calculate final distance fd
Note: language used here is Kotlin
...
0
votes
1
answer
18
views
Do you know how to input the object from the same class in python?
I am python beginner.
I have to define a method distanceFromOther() that takes the different dot as a factor and returns the distance between itself and the other point.
Class Point is for treating ...
0
votes
0
answers
12
views
Using TSP package in R to calculate the shortest distance through multiple points without forming a closed loop
I have multiple latitudinal and longitudinal points for which I have generated a distance matrix. I use the TSP function to calculate the minimum distance connecting all the points. I have also added ...
0
votes
0
answers
44
views
estimating distance between two raspberry in same wifi network using RSSI
I am currently working on a small project and I need your help regarding the estimation of the distance between two raspberries in the same wifi network I tried to research on the RSSI technique by ...
0
votes
0
answers
17
views
Obtain distance from a binary condition with a lists of lists
I have the following setting:
Column of IDS
Column with a binary condition
Column with bonds between IDS
What I am trying the obtain is the distance of each ID from the condition==1
Baiscally, if an ...
1
vote
0
answers
44
views
Extract points which are located along a path which connects two points in coordinates
Hi I have over 100 data points which are located across a region and 120 station pairs.
I want to extract some of them which are located along a station pair.
Therefore, maybe the code will be needed ...
0
votes
0
answers
48
views
Python Multiprocessing for Docker Requests to Get Distance
I am using OSRM backend with Docker to get distance between two places. It works fine, I don't have any problem here. However, it takes too long as my table has many rows(approx. 200k rows,30 minutes) ...
2
votes
2
answers
99
views
Calculate distance between multiple latitude and longitude points
I have a dataset that has latitude and longitude information for participants' home and work, and I'd like to create a new column in the dataset containing the euclidean distance between home and work ...
-1
votes
1
answer
98
views
Calculate distance in large list of coordinates
I'd like some help with a task. I'm a Python begginer and I'm trying to calculate the distance between sequential items. For ex. item1 to item2 then item2 to item3 and so on.
There's only one problem, ...
1
vote
1
answer
50
views
Why does my implementation of the Great Circle distance formula give wrong results?
I'm trying to implement algorithm which will calculate distance between 2 points using great circle distance formula according to guide
My function:
from math import sin, cos, radians
def ...
1
vote
1
answer
59
views
Find the 3 nearest neighbours (dist()?) and calculate mean in new column
This is a sample of the data
structure(list(Season = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("2018/2019",
"2019/2020&...
0
votes
1
answer
39
views
creating KNN algo in R self code using euclidean distance
as part of a homework assignment, I need to write my code for KNN regression with euclidean_distance.
my thought was to :
create a function for euclidean_distance.
compute the distance between all ...