distance

Finding nearest neighbor between 2 sets of dated points

*爱你&永不变心* 提交于 2019-12-08 07:56:39
问题 I have 2 sets of points, set1 and set2 . Both sets of points have a data associated with the point. Points in set1 are "ephemeral", and only exist on the given date. Points in set2 are "permanent", are constructed at a given date, and then exist forever after that date. set.seed(1) dates <- seq(as.Date('2011-01-01'),as.Date('2011-12-31'),by='days') set1 <- data.frame(lat=40+runif(10000), lon=-70+runif(10000),date=sample(dates,10000,replace=TRUE)) set2 <- data.frame(lat=40+runif(100), lon=-70

Unity3D - Get smooth speed and acceleration with GPS data

左心房为你撑大大i 提交于 2019-12-08 07:56:29
问题 I'm using Unity3D and I created simple distance, speed and acceleration calculator using latitude and longitude of last position. I'm calculating last distance, speed and acceleration in each GPS update (approximately once per second). But sometimes (2-3 second interval) latitude and longitude values changes rapidly (in clear weather and no obstacles). That's why speed and acceleration values gets unreal results. For example, at stable 40 km/h speed, speed value becomes 60 km/h and returns to

Show markers on map within a given radius (Xamarin.Android)

限于喜欢 提交于 2019-12-08 07:52:20
问题 Here is the scenario that I need to implement: Assume that I have a database table that contains Latitudes and Longitudes of all the restaurants of my city, say 500 restaurants. Now I am standing somewhere in the city using my app and want to know my nearby restaurants, say within 10 miles radius. To achieve this, the app must first know my current location (I have done that). Once my location is known, the app needs to put markers on all the restaurants that are within 10 miles (assume only

finding the distance between a set of points using scipy.spatial.distance.cdist(X, Y) in python

ぃ、小莉子 提交于 2019-12-08 07:10:51
问题 I have an array of data, called A that looks something like: array([[0.59, 1.23], [0.89, 1.67], [0.21,0.99]...]) and has about 400 sets of [x,y] points in it. I want to find the distance between every set of points in A to each sets of points in B, which is another array which looks exactly the same as A but is half the length (So about 200 sets of[x,y] points). So if I wanted to find the distance between the q-th pair of [x,y] values in B against all [x,y] values in A, I've tried doing

Calculating Mahalanobis distance with C#

烂漫一生 提交于 2019-12-08 06:32:16
问题 I'm trying to calculate the mahalanobis distance with c#. I can't find any real good examples online and I'm new to C#. I am especially having trouble getting the covariance matrix to run right. Any help would be appreciated. Thanks! using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MathNet.Numerics.LinearAlgebra.Double; namespace MahalanobisDistance { class Program { static void Main(string[] args) { Program p = new

Possible to measure distance with an iPhone and laser pointer?

ぃ、小莉子 提交于 2019-12-08 05:08:14
问题 I want to make this phone app that can measure distance. I want to know how far away something is from the phone. So let's say I want to know how far away a wall is...I'd like my phone to tell me. So how might this work? Well, I can shine an ordinary red laser pointer against the wall (in the dark) and have the phone's camera "see" the dot. The further away the phone is from the dot, the smaller the dot will be. The picture below shows the dot from 1 foot, 5 feet, 10 feet, 20 feet, and 25

Find the distance between points and line and achieve the projection distance that the point takes in a line

不想你离开。 提交于 2019-12-08 04:50:50
问题 I am new in python. But I have a challenging task for me: I have CSV files with GPS coordinates and 1 file with reference trajectory (coordinates points) which represent the track of the vehicle. So the task is to all points calculate the perpendicular distance to reference trajectory and define in which kilometer this point is in the reference trajectory I was trying to solve it with QGIS but the problem is that it is too much data and QGIS all the time crashed. I was using the distance

C, Calculating the distance between two GPS locations?

谁都会走 提交于 2019-12-08 03:20:23
问题 If I have two GPS locations, say 51.507222, -0.1275 and 48.856667, 2.350833, what formula could I use to calculate the distance between the two? I've heard a lot about a haversine formula, but can't find any information about it, or how to apply it to C. I've written the following code, however, it's very innacurate. Anybody know why? I can't figure it out. The problem comes from the function itself, but I don't know what it is. float calcDistance(float A, float B, float C, float D) { float

to calculate driving distance between two coordinates on earth in php

╄→гoц情女王★ 提交于 2019-12-08 02:41:50
问题 Well i am working in a location based app and i need to find driving distance between two location on earth at the server end. i am coding the web service in php. Till now i am able to calculate the aerial distance using the Haversine formula, but now i want to calculate the driving distance. There can be possible duplicates for this question, but i was not able to find any help to calculate the "Driving distance" between two "coordinates" ie latitude and longitude instead of addresses in PHP

Color Remapping - Matching target palette using a 3D grid?

孤街浪徒 提交于 2019-12-08 02:39:33
问题 Let's say I have color 'FOO', and it is stored in RGB format. I need to recolor 'FOO' so it matches the closest color in a list of colors. Doing this on the fly, couldn't I view the RGB values from each color as points on a 3D grid (r=x, g=y, b=z) and compute the distance between point 'FOO' vs the points from each color in the list? The closest point to 'FOO' would be the replacement color? 回答1: In theory, yes. In reality, computing the closest color is non-trivial if you want to do it well.