distance

How to detect overlapping circles and fill color accordingly?

佐手、 提交于 2019-12-20 07:28:50
问题 I created 5 circles with random x and y coordinates and radii using 3 arrays (for x, y and radius size). However, I need the circles to dynamically change color based on whether or not they overlap with another circle. So if one of the 5 circles doesn't overlap at all, it should be colored black. Overlapping circles should be cyan. Two circles are considered to overlap if the distance between their center points is less than the sum of their radii. This is what I have written so far for the

Oracle code to calculate distance between point/centroids/polygons

风格不统一 提交于 2019-12-20 06:35:48
问题 I've centroids for customer A and customer B. Now I need to calculate distance between customer A and B into miles using centroids. How can I do it in Oracle? Right now, I'm using alteryx "distance" spatial tool for centroid distance calculation but need to convert it into oracle query. Thanks! 回答1: If you have Cartesian coordinates then the approximate distance if given by the Pythagorean theorem as already provided by Matthew. For Lat/Lon values you should use the Oracle build in SDO_GEOM

Vectorize haversine distance computation along path given by list of coordinates

China☆狼群 提交于 2019-12-19 22:12:33
问题 I have a list of coordinates and can calculate a distance matrix among all points using the haversine distance metric. Coordinates come a as numpy.array of shape (n, 2) of (latitude, longitude) pairs: [[ 16.34576887 -107.90942116] [ 12.49474931 -107.76030036] [ 27.79461514 -107.98607881] ... [ 12.90258404 -107.96786569] [ -6.29109889 -107.88681145] [ -2.68531605 -107.72796034]] I can also extract the distance along the path implied by the sequence of coordinates like so: coordinates = np

Vectorize haversine distance computation along path given by list of coordinates

十年热恋 提交于 2019-12-19 22:12:12
问题 I have a list of coordinates and can calculate a distance matrix among all points using the haversine distance metric. Coordinates come a as numpy.array of shape (n, 2) of (latitude, longitude) pairs: [[ 16.34576887 -107.90942116] [ 12.49474931 -107.76030036] [ 27.79461514 -107.98607881] ... [ 12.90258404 -107.96786569] [ -6.29109889 -107.88681145] [ -2.68531605 -107.72796034]] I can also extract the distance along the path implied by the sequence of coordinates like so: coordinates = np

how to find wifi signal direction of another device in android?

柔情痞子 提交于 2019-12-19 18:24:40
问题 I am using my android phone as Access Point. Now I want to find the distance and direction of the wifi devices connected with my phone. Please help me through suitable example and code. Thanks in advance. 回答1: I downloaded Wifi Radar that you mentioned and tried it. There's an important step there - it asks you to rotate on the spot for a bit while holding the device to your body. So my guess is that it uses the internal compass to figure out which direction you're pointing to, and then

K-Medoids / K-Means Algorithm. Data point with the equal distances between two or more cluster representatives

…衆ロ難τιáo~ 提交于 2019-12-19 11:24:13
问题 I have been researching and studying about partition-based clustering algorithms like K-means and K-Medoids. I have learned that K-medoids is more robust to outliers compared to K-means. However I am curious on what will happen if during the assigning of data points, two or more cluster representatives have the same distance on a data point. Which cluster will you assign the data point? Will the assignment of the data point to a cluster greatly affect the clustering results? 回答1: To prevent

How to track distance via GPS on Android?

风流意气都作罢 提交于 2019-12-19 11:05:54
问题 How would I go about tracking the distance a user travels? I don't necessarily care about storing waypoints, although that may be necessary to calculate distance anyway. So far, I am creating a LocationManager and regsitering an onLocationChanged listener, and then calculating the raw distance between two points when the listener fires. The problem here is that if I leave the app sit still on a desk for 10, 15 minutes, it will say I have traveled .5 miles. How should I go about checking for

Error in .pointsToMatrix(x) : longitude > 360 with calculating distance

旧街凉风 提交于 2019-12-19 09:56:53
问题 Im trying to calculate the nearest distance to a point. Therefore I create two df's Create list 1 long <- c(52.070498, 52.370216, 52.632381, 53.201233, 51.813298, 51.92442, 52.266075, 53.219383, 52.960561, 52.367027, 51.571915, 52.516775, 51.441642, 52.221537, 52.090737, 51.985103, 51.560596) lat <- c(4.3007, 4.895168,4.753375, 5.799913, 4.690093, 4.477733, 6.155217, 6.566502, 5.920522, 6.668492, 4.768323, 6.083022, 5.469722, 6.893662, 5.12142, 5.89873, 5.091914) stad <- c("Den Haag",

MySQL PHP zip code comparison specifically distance

一曲冷凌霜 提交于 2019-12-19 04:56:08
问题 I'm trying to figure out what would be the most efficient (with respect to load time) to compare the distance between one zip code (which the user provides) and a whole bunch of other zip codes (there's approximately 200 zip codes right now, but its subject to increase over time). I don't need anything exact just in the ball park. I downloaded a zip code csv file for all of the US, and I've got a function which produces the distance between two zip codes (in radians i believe.) I don't need

Geoalgorithm for finding coordinates of point from a known location by distance and bearing

那年仲夏 提交于 2019-12-19 04:11:30
问题 I'd like to use Google maps static API to display a map with a path overlay indicating a boundary. AFAICT the static API doesn't support polygons, so I intend to circumvent this by drawing the boundary using paths. To do this I need to determine the points to draw the straight lines (paths) between; so I'd like an algorithm that returns the geographic location (i.e. WGS84 coordinates) a given bearing and distance from a known point. Can anyone point me to such an algorithm. Preferably in C#,