convex-hull

Convex Hull in O(n) time if each coordinate of each point is a rational number

霸气de小男生 提交于 2019-12-13 12:33:09
问题 Show that the convex hull of n points in the plane can be computed in O(n) time if each coordinate of each point is a rational number of the form p/q , with bounded values for p and q. Note: This is a homework problem. I can just think of using Jarvis March by somehow avoiding the scan of all points. Maybe this can be done by throwing rays in fixed directions (using the rational condition) to check where the next point exists . 回答1: Don't use Jarvis March since it has time complexity of O(nh)

D3 drawing a hull around group of circles

安稳与你 提交于 2019-12-12 08:42:40
问题 I want to draw a hull around a grouped force directed graph build with d3. I have build the graph with the circles. But I now want to join the intersections of the circles with a path(hull). If not joining the intersections, Drawing a hull surrounding the group of circles is enough. I tried the Force-Directed Layout with Convex Hull example. But I have the text and circles covering the text and links connecting the texts. var vertices = new Array(); var width = 960, height = 500; var color =

How to make a convex hull covering differently sized nodes in D3

南笙酒味 提交于 2019-12-11 20:28:19
问题 I've run across another limitation of the convex hull implementation of D3: it does not adjust to the size of the nodes. Well, I didn't expect that it would do so automatically, but this seems like a fairly standard aspect of the data visualizations people are using D3.js, so I expected to find a fix for it. I have not found such a fix. One obvious and unsatisfactory solution is to find the size of the largest node of the group and set that as the stroke-width of the hull. Unfortunately that

Draw a convex hull using the given points in java/android

与世无争的帅哥 提交于 2019-12-11 08:41:22
问题 I have some 2D points given and i want to draw a polygon using those points. This polygon must pass through all the given points means there is no such point which is inside or outside the polygon. For example: if i have points like: (0,0), (1,1), (-1,-1),(-1,1) and (1,-1) and if i want to draw a polygon using those then my points array should be sorted in following manner: (1,1) -> (1,-1) -> (-1,-1) -> (-1,1) -> (0,0) -> (1,1) OR (1,1) -> (0,0) -> (-1,1) -> (-1,-1) -> (1,-1) -> (1,1) but it

Convex hull around D3 Force network graphic

你。 提交于 2019-12-11 07:32:41
问题 I'm trying to add a hull around the D3 network graph that I've build. My network is based on this JSFiddle (can't share mine because of sensitive data) and basically the end product should be a network with a shade around. I read a lot online and found that a convex hull might be a solution. After trying to implement my data in tutorials like this one http://bl.ocks.org/donaldh/2920551, I must come to the conclusion that my basic D3 knowledge won't be enough to solve this. Thank you all in

Qhull Convex hull wants me to input at least 3 points

北慕城南 提交于 2019-12-11 06:09:19
问题 Update: I've decided to try to use a linear programming package in order to determine if the vertices of the two polytopes are linearly separable. (The vertices are really my data, not the polytopes.) I think this will work better, so I no longer need an answer to this question. I'm writing some code that involves checking if certain polytopes are disjoint. These polytopes are defined by the convex hulls of their vertices, and I'm creating the convex hulls using Qhull . In particular, I'm

Distance to convexHull

你。 提交于 2019-12-11 03:26:38
问题 I have been searching for a method to compute a distance to a convexHull/polygon such that the distance is positive if the point is within the hull and negative if outside. For example, given a hull and a set of points, can the positive/negative distance be computed? from scipy.spatial import ConvexHull import matplotlib.pyplot as plt import numpy as np # Original points, hull and test points points = np.random.rand(30, 2) # 30 random points in 2-D hull = ConvexHull(points) newpoints = np

Test case data for convex-hull

时光总嘲笑我的痴心妄想 提交于 2019-12-09 12:58:03
问题 I need to make a 2D convex hull function for a class assignment and I want a more robust test cases than the assignment provides. Does anyone known of a largish test cases (25 < n < 100) with the solution? 回答1: The Qhull package, including qhull , qconvex , and rbox should do the trick (I've used them for this exact purpose myself). For example, the qconvex examples page gives the following (tweaked for a larger test case): rbox 100 D3 | qconvex s o TO result The above computes the 3-d convex

convex hull algorithm for 3d surface z = f(x, y)

好久不见. 提交于 2019-12-09 06:59:38
问题 I have a 3D surface given as a set of triples (x_i, y_i, z_i), where x_i and y_i are roughly on a grid, and each (x_i, y_i) has a single associated z_i value. The typical grid is 20x20 I need to find which points belong to the convex hull of the surface, within a given tolerance. I'm looking for an efficient algorithm to perform the computation (my customer has provided an O(n³) version, which takes ~10s on a 400 point dataset...) 回答1: There's quite a lot out there, didn't you search? Here

Convex hull in higher dimensions, finding the vertices of a polytope

非 Y 不嫁゛ 提交于 2019-12-09 05:39:23
问题 Suppose I have a point cloud given in 6-dimensional space, which I can make as dense as needed. These points turn out to lie on the surface of a lower-dimensional polytope (i.e. the point vectors (x1, x2, ... x6) appear to be coplanar). I would like to find the vertices of this unknown polytope and my current attempt makes use of the qhull algorithm, via the scipy interface in Python. In the beginning I would only get error messages, apparently caused by the lower dimensional input and/or the