distance

Distance Calculation for massive number of devices/nodes Part 2

一世执手 提交于 2019-12-10 11:53:29
问题 This question is an enhancement to the previous SO question. Distance Calculation for massive number of devices/nodes I have N mobile devices/nodes (say 100K) and I periodically obtain their location ( latitude , longtitude ) values. Some of the devices are "logically connected" to roughly M other devices (say 10 in average). My program periodically compares the distance between the each device and its logically connected devices and determines if the distance is within a threshold (say 100

Operations “intra” & “inter” lists

十年热恋 提交于 2019-12-10 04:36:08
问题 Please Consider the following : lesDisques={{14.2065, 10.609, 0.974938}, {19.5653, 6.92721, 0.974938}, {30.4607,17.4802, 0.974938}, {27.4621, 10.0393, 0.974938}, {15.915, 20.4278,0.974938}, {28.6921, 5.2132, 1.53205}, {27.0317, 24.8346,1.53205}, {20.8853, 18.8588, 1.53205}} where lesDisques[[#]] is {X,Y,R} frmCorner = {{6.5946, 1.5946`}, {6.5946, 28.4054`}, {60.2162`,28.4054`}, {33.4054`, 28.4054`}} cog = {23.91871026577044`, 15.010499627383863`} scrCenter = {20, 15} frmXY={{6.5946, 1.5946},

SQL Server 2008 Geography .STBuffer() distance measurement units

心不动则不痛 提交于 2019-12-10 03:07:05
问题 I'm working with a geographic point using lat/long and need to find other points in our database within a 5 mile radius of that point. However, I can't seem to find out what the "units" are for STBuffer, it doesn't seem to conform to feet, miles, meters, kilometers, etc. The documentation only refers to them as "units", any suggestions? Thanks [...] from geography::STGeomFromText('POINT(x y)', 4326).STBuffer(z).STIntersects(geography::STGeomFromText('POINT(' + CAST(v.Longitude as varchar(max)

Internationalization of distances in java

元气小坏坏 提交于 2019-12-10 02:22:28
问题 Is it possible in Java without any extra library to internationalize distances? I mean it is possible to handle that with date, time, currencies, numbers... I would have expected to find a NumberFormat.getDistanceInstance or something. Is there something like that already embedded or should i make my own internationalization system for distances (mostly miles vs kilometers) 回答1: I would love to hear about such formatter but unfortunately I never did. The problem is, there is no such data in

Optimization from partial solution: minimize sum of distances between pairs

最后都变了- 提交于 2019-12-10 01:45:05
问题 I have a problem which I like and I love to think about solutions, but I'm stuck unfortunately. I hope you like it too. The problem states: I have two lists of 2D points(say A and B) and need to pair up points from A with points from B, under the condition that the sum of the distances in all pairs is minimal. A pair contains one point from A and one from B, a point can be used only once, and as many as possible pairs should be created(i.e. min(length(A), length(B)) ). I've made a simple

Distance between elements in 2D array

一曲冷凌霜 提交于 2019-12-09 18:21:34
问题 How can I determine the distance between 1's in a 2D array. For example, we have a 2D array like this: 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 The algorithm has to output the distance from each element to the nearest 1. Like this: 2 3 2 1 1 2 1 0 0 1 2 1 0 1 2 2 How can I solve it ? 回答1: You can iterate over the matrix and find the coordinates of all the 1's (x1, y1). Then for each position in the cell (x2, y2), for all (x1, y1) in your list, find the minimum |x2 - x1| + |y2 - y1| (the Manhattan

Finding a point on a Bézier curve when given the distance from the start point?

五迷三道 提交于 2019-12-09 10:38:08
问题 I created a 4 point Bézier curve, and a distance. Starting at the start point, how do I find the x,y coordinates of a point which is that distance away from the start point? I've looked at the other examples, and from what I can tell, they approximate the values by dividing the curve into several thousand points, then finding the nearest point. This will not work for me. For what I'm doing, I'd like to be accurate to only two decimal places. Below is a simple form of what I have to create my

how to get Distance between wifi access point and Mobile Device

眉间皱痕 提交于 2019-12-09 07:18:43
问题 i am developing an android application which have module to search all nearest / detected wifi hotspot. i can get all detail from searched wifi hotspot like, SSID, BSSID, capabilities, frequency, level and timestamp with these information, i also need Distance of wifi ( The distance between wifi accesspoint and Mobile Device ) i am using below lines to get Distance. double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(levelInDb)) / 20.0; double distanceM = Math.pow(10.0, exp); this

The best way for finding the closest line segment to a point

℡╲_俬逩灬. 提交于 2019-12-09 06:28:48
问题 As can be seen in figure below, I have some lines (finite length) between any two joints (red points), such as the line between joints J1 and J2. I have also some points such as P1 and P2. I have the coordinates of points and joints. So, it is possible to calculate the line equations (y=mx+b). So, it is possible to calculate the distance between a point to any line. So, the lowest distance gives me the closest line to the point. Since there are a huge number of points in this problem, it

Effective clustering of a similarity matrix

人盡茶涼 提交于 2019-12-09 06:24:07
问题 my topic is similarity and clustering of (a bunch of) text(s). In a nutshell: I want to cluster collected texts together and they should appear in meaningful clusters at the end. To do this, my approach up to now is as follows, my problem is in the clustering. The current software is written in php. 1) Similarity: I treat every document as a "bag-of-words" and convert words into vectors. I use filtering (only "real" words) tokenization (split sentences into words) stemming (reduce words to