Questions tagged [convex-hull]

Convex-hull of a set of points X in a Euclidean space is the convex set with smallest area that contains all points of X.

474 questions
139
votes
15 answers

How to tell whether a point is to the right or left side of a line

I have a set of points. I want to separate them into 2 distinct sets. To do this, I choose two points (a and b) and draw an imaginary line between them. Now I want to have all points that are left from this line in one set and those that are right…
Aaginor
  • 3,964
  • 8
  • 43
  • 70
53
votes
11 answers

What's an efficient way to find if a point lies in the convex hull of a point cloud?

I have a point cloud of coordinates in numpy. For a high number of points, I want to find out if the points lie in the convex hull of the point cloud. I tried pyhull but I cant figure out how to check if a point is in the ConvexHull: hull =…
AME
  • 2,119
  • 4
  • 23
  • 37
27
votes
11 answers

Create non-intersecting polygon passing through all given points

Suppose I have an array of points in random order, and I need to find a polygon (by sorting them, such that every adjacent pair represents a side) which passes through all of the points, and its sides are non-intersecting of course. I tried to do it…
max
  • 3,900
  • 2
  • 22
  • 36
24
votes
6 answers

Convex hull of (longitude, latitude)-points on the surface of a sphere

Standard convex hull algorithms will not work with (longitude, latitude)-points, because standard algorithms assume you want the hull of a set of Cartesian points. Latitude-longitude points are not Cartesian, because longitude "wraps around" at the…
20
votes
3 answers

How to find convex hull in a 3 dimensional space

Given a set of points S (x, y, z). How to find the convex hull of those points ? I tried understanding the algorithm from here, but could not get much. It says: First project all of the points onto the xy-plane, and find an edge that is definitely…
Ninja420
  • 2,630
  • 3
  • 16
  • 29
17
votes
2 answers

In scipy's ConvexHull, what does "area" measure?

The value of the "area" attribute in scipy ConvexHull (see http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html) object does not seem to be (what I understand to be) the area of the convex hull. On the other hand, the…
mjandrews
  • 2,113
  • 3
  • 17
  • 35
16
votes
4 answers

The minimum perimeter convex hull of a subset of a point set

Given n points on the plane. No 3 are collinear. Given the number k. Find the subset of k points, such that the convex hull of the k points has minimum perimeter out of any convex hull of a subset of k points. I can think of a naive method runs in…
Chao Xu
  • 2,028
  • 2
  • 20
  • 29
15
votes
2 answers

Intersection of nD line with convex hull in Python

I have created a convex hull using scipy.spatial.ConvexHull. I need to compute the intersection point between the convex hull and a ray, starting at 0 and in the direction of some other defined point. The convex hull is known to contain 0 so the…
user2133814
  • 1,869
  • 1
  • 20
  • 28
15
votes
4 answers

Finding largest subset of points forming a convex polygon

I'm looking for an algorithm for finding largest subset of points (by largest i mean in number) that form a convex polygon from the given set of point. I think this might be solvable using DP but i'm not sure. Is it possible to do this in O(n^3)…
zeulb
  • 569
  • 1
  • 6
  • 21
15
votes
1 answer

qhull Library - C++ Interface

The qhull library ( qhull.org) has several examples to start in his website, but all the information regarding to the C++ is not very useful to me. I am trying to make a simple convex Hull of 3D points that I read from a file, I can´t use the…
12
votes
6 answers

Triangulate a set of points with a concave domain

Setup Given some set of nodes within a convex hull, assume the domain contains one or more concave areas: where blue dots are points, and the black line illustrates the domain. Assume the points are held as a 2D array points of length n, where n is…
Daniel R. Livingston
  • 1,116
  • 12
  • 30
12
votes
2 answers

Volume of convex hull with QHull from SciPy

I'm trying to get the volume of the convex hull of a set of points using the SciPy wrapper for QHull. According to the documentation of QHull, I should be passing the "FA" option to get the total surface area and volume. Here is what I get.. What…
Diana
  • 1,151
  • 7
  • 21
12
votes
8 answers

Convex hull of 4 points

I would like an algorithm to calculate the convex hull of 4 2D points. I have looked at the algorithms for the generalized problem, but I wonder if there is a simple solution for 4 points.
12
votes
1 answer

intersecting svg closed paths

What is a good way (both code-wise and performance-wise) to test if two shapes drawn by svg path is intersecting? I am doing this in d3 and is using the "cardinal-closed" line interpolation More specifically, I am creating convex hulls (more complex…
swenedo
  • 2,824
  • 5
  • 28
  • 46
11
votes
2 answers

Convexity defects C++ OpenCv

I would be grateful to you if you could help me with this issue :) Relating to this question cvConvexityDefects in OpenCV 2.X / C++?, I have the same problem. The OpenCV C++ wrapper has not the function cvConvexityDefects that appears in the C…
cabreracanal
  • 884
  • 1
  • 13
  • 33
1
2 3
31 32