computational-geometry

Triangulation algorithm using signal strength

主宰稳场 提交于 2019-12-08 09:14:45
问题 I want to have an estimation of the location of a user using the surrounding cell towers. For each tower, I have a location and a signal strength. Now I use a simple means of the coordinates but it is not very accurate (the user is not necessarily between the two towers). I guess the solution is to draw a circle around each tower (the less the signal strength is, the larger it will be) and them compute the intersection between the circles. I usually don't have more than 3 cell towers. Any

Find the biggest rectangular area consisting only of 2 types of letter in a given MxN board

不羁的心 提交于 2019-12-08 08:32:29
问题 Possible duplicate: find largest submatrix algorithm I need help with a problem. Given a MxN board represented with M letters (a-z) in each of the N lines, i have to find the biggest area in which there are only 2 types of letters in it. The area must have rectangular shape. Here's an example : 4x4: AAAA ABBC BBCA DCAA The output will be 6, because the biggest rectangular area in which there are only 2 types of letters is in the upper corner AAA-ABB, there are only A and B (2 types). 回答1:

Finding midlines of polygons using Voronoi diagrams

泪湿孤枕 提交于 2019-12-08 06:56:27
问题 I am using the Voronoi diagram-based approach outlined here to find midlines of binary masks of root images. I am using the Python code more or less exactly as described: import skimage.morphology as morphology WHITE = 255 image_bool = binary_mask == WHITE d = morphology.disk(2) img = morphology.binary_closing(image_bool, selem=d) skeleton = morphology.medial_axis(img) Then comes the graphing: I feed the skeletonized image into buildTree, as described in user Gabriel's iPython notebook: https

Concave Hull implementation

我的未来我决定 提交于 2019-12-08 06:23:51
问题 I am trying to implement the algorithm described in the following http://repositorium.sdum.uminho.pt/bitstream/1822/6429/1/ConcaveHull_ACM_MYS.pdf I am using the following class libraries. Loyc libs come from http://core.loyc.net/ using System; using System.Collections.Generic; using System.Linq; using System.Device.Location; using Loyc.Collections; using Loyc.Geometry; using Loyc; Here is the basic class public class Hulls { private static List<Point<double>> KNearestNeighbors(List<Point

calculate the area of a polygon in ruby

人盡茶涼 提交于 2019-12-08 03:16:44
问题 I have an array of latitude/longitude coordinate pairs that represent a polygon. I'm trying to determine the total area within that polygon. How would I go about doing that in Ruby? Here's an example array of the polygon: [[37.7663613767094, -122.452969210084], [37.7674219449606, -122.444718340349], [37.7701838510542, -122.445330289514], [37.7709974013834, -122.439159589248], [37.7700761930893, -122.438861402472], [37.7703501163684, -122.436868738421], [37.7712650571321, -122.437078116573],

polygon triangulation reflex vertex

一曲冷凌霜 提交于 2019-12-08 02:45:16
问题 Hi i am trying to perform polygon triangulation. I understood the ear clipping method for a simple Polygon ( Concave or Convex ). i am stuck at finding whether a vertex is reflex or not . what i have read at multiple places is about clock-wise and counter clockwise orientations which i am unable to understand . in short what are those orientations referring to and please give me some hint on checking whether the vertex is reflex or not . here is the link of an article i am following: and here

Visibility of polygons from an edge

北慕城南 提交于 2019-12-08 01:50:48
问题 Given is a 2D are with the polygons. I need to find out the polygons visible in a perpendicular line of sight from the a given line segment lying within that area. e.g. Further, What can be the optimizations when the polygons have only vertical and horizontal edges. 回答1: I'd suggest the following ... Rotate the problem so your 'line of sight' segment is aligned to the x axis. Find the (axis aligned) bounding rectangle (BR) of each polygon. Sort the polygons using the Y coordinate of the

Algorithm to find intersections in a polar plane

痴心易碎 提交于 2019-12-07 23:18:53
问题 I have a polar plane relative to a base point (colored green in the diagram below). The points and segments are represented thus: class Node { int theta; double radius; } class Segment { //each segment must have node that is northern relative to other Node northern; Node southern; } I want to figure out if the red line going from the base point to each segment node intersects any other segment. In this example, the red line does intersect. What algorithmic approach should I apply?

How to test if a line intersects a convex polygon?

可紊 提交于 2019-12-07 19:44:31
问题 Assume you are given the equation of a line (in 2d), and the equations of lines that form a convex polygon (the polygon could be unbounded). How do I determine if the line intersects the polygon? Furthermore, are there computational geometry libraries where such tasks are pre-defined? I ask because I'm interested not just in the 2D version but n-dimensional geometry. 回答1: For the 2D case, I think the problem simplifies a bit. The line partitions the space into two regions. If the polygon is

Ray-triangle intersetion

拟墨画扇 提交于 2019-12-07 19:37:34
问题 How can I test intersesion ray and triangle, and if it exist how to get distance from ray origin to intersection point?? What optimization I can use, if in my program I've got to check 1 ray to ~10000 triangles ?? 回答1: A single polygon-ray intersection test is trivial and just involves making sure that the ray crosses at least one side of it (check them individually) or across the plane defined by the triangle between the sides of it. The optimization comes into not checking against polygons