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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Qhull package, including
qhull,qconvex, andrboxshould 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):The above computes the 3-d convex hull of 100 random points, writes a summary to the console, and writes the points and facets to ‘result’.
Here’s a sample test case for finding the 3-d convex hull of 40 points. The points are:
The convex hull is composed of the following points:
Here’s a 2D test case. Points:
Hull: