polygon

What is the fastest way to find the “visual” center of an irregularly shaped polygon?

故事扮演 提交于 2019-11-26 07:25:30
问题 I need to find a point that is a visual center of an irregularly shaped polygon. By visual center, I mean a point that appears to be in the center of a large area of the polygon visually. The application is to put a label inside the polygon. Here is a solution that uses inside buffering: https://web.archive.org/web/20150708063910/http://proceedings.esri.com/library/userconf/proc01/professional/papers/pap388/p388.htm If this is to be used, what is an effective and fast way to find the buffer?

Largest circle inside a non-convex polygon

风格不统一 提交于 2019-11-26 07:23:14
问题 How can I find the largest circle that can fit inside a concave polygon? A brute force algorithm is OK as long as it can handle polygons with ~50 vertices in real-time. 回答1: The key to solving this problem is first making an observation: the center of the largest circle that will fit inside an arbitrary polygon is the point that is: Inside the polygon; and Furthest from any point on the edges of the polygon. Why? Because every point on the edge of a circle is equidistant from that center. By

Check if Point Is Inside A Polygon

走远了吗. 提交于 2019-11-26 04:19:52
问题 I want to check if a point lies within a specific polygon. The polygon is: polygon= [ [-73.89632720118, 40.8515320489962], [-73.8964878416508, 40.8512476593594], [-73.8968799791431, 40.851375925454], [-73.8967188588015, 40.851660158514], [-73.89632720118, 40.8515320489962] ] The points I want to check are: 1 = [40.8515320489962,-73.89632720118] 2 = [40.8512476593594,-73.8964878416508] 3 = [40.851375925454,-73.8968799791431] 4 = [40.851660158514,-73.8967188588015] 5 = [40.8515320489962,-73

How to draw free hand polygon in Google map V2 in Android?

风流意气都作罢 提交于 2019-11-26 03:33:25
问题 I want to draw a Free Hand Polygon on the Map in Google Map V2 . This task was possible with Overlay Map V1 but Google Map has removed that class from V2. (Per this Google Map V2 has Remove Overlay Class). Good Example for Google Map V1 to draw free style polygon. In Map V2, we can draw a polygon programmatically with the help of Google Official Doc but what should a user do? I have found Unclear answer for Map V2 I started with simple Google Map & draw polygon to do this programmatically &

How to determine if a list of polygon points are in clockwise order?

Deadly 提交于 2019-11-26 03:24:18
问题 Having a list of points, how do I find if they are in clockwise order? For example: point[0] = (5,0) point[1] = (6,4) point[2] = (4,5) point[3] = (1,5) point[4] = (1,0) would say that it is anti-clockwise (or counter-clockwise, for some people). 回答1: Some of the suggested methods will fail in the case of a non-convex polygon, such as a crescent. Here's a simple one that will work with non-convex polygons (it'll even work with a self-intersecting polygon like a figure-eight, telling you

A simple algorithm for polygon intersection

怎甘沉沦 提交于 2019-11-26 01:29:49
问题 I\'m looking for a very simple algorithm for computing the polygon intersection/clipping. That is, given polygons P , Q , I wish to find polygon T which is contained in P and in Q , and I wish T to be maximal among all possible polygons. I don\'t mind the run time (I have a few very small polygons), I can also afford getting an approximation of the polygons\' intersection (that is, a polygon with less points, but which is still contained in the polygons\' intersection). But it is really

An algorithm for inflating/deflating (offsetting, buffering) polygons

末鹿安然 提交于 2019-11-26 00:17:32
问题 How would I \"inflate\" a polygon? That is, I want to do something similar to this: The requirement is that the new (inflated) polygon\'s edges/points are all at the same constant distance from the old (original) polygon\'s (on the example picture they are not, since then it would have to use arcs for inflated vertices, but let\'s forget about that for now ;) ). The mathematical term for what I\'m looking for is actually inward/outward polygon offseting . +1 to balint for pointing this out.

How do CSS triangles work?

不打扰是莪最后的温柔 提交于 2019-11-25 22:13:24
问题 There\'re plenty of different CSS shapes over at CSS Tricks - Shapes of CSS and I\'m particularly puzzled with a triangle: #triangle-up { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom: 100px solid red; } <div id=\"triangle-up\"></div> How and why does it work? 回答1: CSS Triangles: A Tragedy in Five Acts As alex said, borders of equal width butt up against each other at 45 degree angles: When you have no top border, it looks like

How to determine if a list of polygon points are in clockwise order?

为君一笑 提交于 2019-11-25 20:08:33
Having a list of points, how do I find if they are in clockwise order? For example: point[0] = (5,0) point[1] = (6,4) point[2] = (4,5) point[3] = (1,5) point[4] = (1,0) would say that it is anti-clockwise (or counter-clockwise, for some people). Beta Some of the suggested methods will fail in the case of a non-convex polygon, such as a crescent. Here's a simple one that will work with non-convex polygons (it'll even work with a self-intersecting polygon like a figure-eight, telling you whether it's mostly clockwise). Sum over the edges, (x 2 − x 1 )(y 2 + y 1 ). If the result is positive the