Questions tagged [convex-polygon]

A convex polygon is a simple polygon whose interior is a convex set. In a convex polygon ,every internal angle is less than or equal to 180 degrees and every line segment between two vertices remains inside or on the boundary of the polygon.

99 questions
1
vote
3 answers

Queries to figure out if point lies inside polygon

I have been given a strictly convex polygon of S sides and Q queries to process. All points of polygon and query points are given in (x,y) pairs.The points of the polygon are given in anti-clockwise order. The aforementioned variables are limited…
1
vote
1 answer

Convex Hull with a predefined number of vertices

I am working on image segmentation and I thought the convex hull can provide me with a simple solution to my problem. Currently I have polygons with for sides (see image below). Due to image processing issues, the shape does not have clean straight…
1
vote
2 answers

Generate Graph of Connected Convex Polygons

I'm trying to take a dense graph of points such as this, and turn it into a graph of connected convex polygons. The polygons should be as large and as simple as possible while staying connected. The resultant graph will be used for pathfinding. Can…
Anthony
  • 158
  • 1
  • 7
1
vote
2 answers

Check if Point is located on(or close to) a convex polygon edges

So I'm loading KML files to my google map, they are shown as convex polygons on the map. I also have the user location , basically i want to know if the user is located on one of the polygon's edges (which is a convex polygon). and because location…
1
vote
1 answer

How do I find the Pareto-optimal points in O(nh) and O(nlog(h)) complexity?

Can anybody suggest an algorithm to find Pareto-optimal points (to form a staircase) just as given in diagram in O(n*h) and O(n*log(h)) time complexity, where h is the number of Pareto-optimal points? I used gift wrapping algorithm to solve this…
1
vote
1 answer

Multiple convex polygon intersection

I have multiple convex polygons that intersect. I want to find the areas, where many of them intersect. In an image, one could think of it as a "peak". I am searching for the local peaks. I have the software to intersect two polygons. Now I am…
1
vote
2 answers

can vertices coincide in convex polygons?

I am new to openGL and I am reading the redbook. Now, as an exercise I want to manually draw a sphere. For that I am dividing the sphere into slices and stacks, and thus I get multiple rectangles, but near the poles of the sphere I get triangles.…
Armen Tsirunyan
  • 130,161
  • 59
  • 324
  • 434
1
vote
2 answers

Position 3 polygons together in 3D

Given 3 polygons which all are defined as flat (when seen from the side they have no points out of line with the rest, so essentially they are 2D shapes in 3D space), made of exactly 4 points, convex and with the additional information that each…
Matt W
  • 11,753
  • 25
  • 118
  • 215
1
vote
0 answers

How to store edges of convex polygon?

I'm making my own simple 2D-Game's engine and I want to use Separating Axis Theorem to detect collisions but it requires objects to be convex polygons and I would really love to be able to create these polygons in an easy way because every physical…
1
vote
1 answer

Fit a convex polygon into a given rectangle

I would like to take a convex polygon and fit it into a given rectangle by turning and scaling. My approach is to turn the polygon in small steps (like 1°) and always measure the fraction (maximal horizontal distance / maximal vertical distance),…
J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
1
vote
1 answer

expand a polygon region in a matrix

I have the following matrix: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 3 1 1 2 2 2 2 1 3 1 1 1 1 2 1 1 3 1 1 1 1 1 1 1 1 I want to expand the region of value 2 by size 1, which means after expansion, the output is: 1 1 2 2 2 1 1 1 1 2 2 2 2 2…
user3919259
  • 75
  • 1
  • 9
1
vote
0 answers

How to (efficiently) find intersection of two polyhedral cones?

I have two polyhedral cones represented by their rays. I am looking to find their intersection, which would also be a polyhedral cone, hopefully efficiently. Does anybody know a way to do that? Thanks Deepanshu
1
vote
1 answer

Plot the solution of a system of linear inequalities

I have two arrays of numbers from [-1,1]: a = 2*np.random.sample(100)-1 and b = 2*np.random.sample(100)-1. These two arrays define the following system of linear inequalities a[i]*x + b[i]*y <= 1 for i = 0,1,..., 99 The solution-set of this system…
cheyp
  • 391
  • 2
  • 4
  • 12
1
vote
0 answers

Detect GPS in Polygon in Android Google Map API version 2

I am a new Android developer. I am developing an application about map using Google Map. I created a Polygon on the map and I want to detect through GPS when the position is within Polygon but I do not know how to detect it. Could you please…
shiteru
  • 635
  • 3
  • 9
  • 15
1
vote
1 answer

Representing a convex hull in higher dimensions (3+)

In 2d a convex hull is represented as basically a tour of points. Seems like this representation might fall apart beyond 2 dimensions. Since, I'm going to be working with them soon, I'd like to know ahead of time what the "standard" is for doing so,…
Nuclearman
  • 5,029
  • 1
  • 19
  • 35