BVB Source Codes

Algorithm-Implementations Show convex_hull_test.py Source code

Return Download Algorithm-Implementations: download convex_hull_test.py Source code - Download Algorithm-Implementations Source code - Type:.py
  1. __author__ = "Mahaveer Verma"
  2. __email__ = "mahaveer.verma1@gmail.com"
  3.  
  4. import matplotlib.pyplot as plt
  5. import convex_hull
  6.  
  7. pts=[[0.3215348546593775, 0.03629583077160248], [-0.4404289572876217, -0.2894855991839297],
  8. [0.02402358131857918, -0.2356728797179394], [0.04590851212470659, -0.4156409924995536],
  9. [0.3218384001607433, 0.1379850698988746], [0.11506479756447, -0.1059521474930943],
  10. [0.2622539999543261, -0.29702873322836], [-0.161920957418085, -0.4055339716426413],
  11. [0.1905378631228002, 0.3698601009043493], [0.2387090918968516, -0.01629827079949742],
  12. [0.07495888748668034, -0.1659825110491202], [0.3319341836794598, -0.1821814101954749],
  13. [0.07703635755650362, -0.2499430638271785], [0.2069242999022122, -0.2232970760420869],
  14. [0.04604079532068295, -0.1923573186549892], [0.05054295812784038, 0.4754929463150845],
  15. [-0.3900589168910486, 0.2797829520700341], [0.3120693385713448, -0.0506329867529059],
  16. [0.01138812723698857, 0.4002504701728471], [0.009645149586391732, 0.1060251100976254],
  17. [-0.03597933197019559, 0.2953639456959105], [0.1818290866742182, 0.001454397571696298],
  18. [0.444056063372694, 0.2502497166863175], [-0.05301752458607545, -0.06553921621808712],
  19. [0.4823896228171788, -0.4776170002088109], [-0.3089226845734964, -0.06356112199235814],
  20. [-0.271780741188471, 0.1810810595574612], [0.4293626522918815, 0.2980897964891882],
  21. [-0.004796652127799228, 0.382663812844701], [0.430695573269106, -0.2995073500084759],
  22. [0.1799668387323309, -0.2973467472915973], [0.4932166845474547, 0.4928094162538735],
  23. [-0.3521487911717489, 0.4352656197131292], [-0.4907368011686362, 0.1865826865533206],
  24. [-0.1047924716070224, -0.247073392148198], [0.4374961861758457, -0.001606279519951237],
  25. [0.003256207800708899, -0.2729194320486108], [0.04310378203457577, 0.4452604050238248],
  26. [0.4916198379282093, -0.345391701297268], [0.001675087028811806, 0.1531837672490476]] # Test input of 40 points
  27.  
  28. convex_hull=convex_hull.ConvexHull(pts) # Function call
  29. ip_x=[]
  30. ip_y=[]
  31. op_x=[]
  32. op_y=[]
  33. for ip_index in range(len(pts)):
  34.         ip_x.append(pts[ip_index][0])
  35.         ip_y.append(pts[ip_index][1])
  36. for op_index in range(len(convex_hull)):
  37.         op_x.append(convex_hull[op_index][0])
  38.         op_y.append(convex_hull[op_index][1])
  39. print "Convex Hull: "+str(convex_hull) # Print output
  40. plt.plot(ip_x,ip_y,'bo',op_x,op_y,'ro') # Plot input and output for visual
  41. plt.title('BLUE - Input Points | RED - Convex Hull')
  42. plt.show()
downloadconvex_hull_test.py Source code - Download Algorithm-Implementations Source code
Related Source Codes/Software:
raty - 2017-04-22
RDVTabBarController - Highly customizable tabBar and tabBarController fo... 2017-04-22
material-icon-lib - Library containing over 1500 material vector icons... 2017-04-21
httpdiff - Perform the same request against two HTTP servers ... 2017-04-21
jquerytools - The missing UI library for the Web ... 2017-04-21
mcrouter - Mcrouter is a memcached protocol router for scalin... 2017-04-22
dynomite - A generic dynamo implementation for different k-v ... 2017-04-22
kityminder - Baidu brain figure 2017-04-22
llvm - Mirror of official llvm git repository located at ... 2017-04-22
RBBAnimation - Block-based animations made easy, comes with easin... 2017-04-22
ied - 2017-04-29
Nimble - A Matcher Framework for Swift and Objective-C 2017-04-29
MHVideoPhotoGallery - A Photo and Video Gallery 2017-04-29
shoulda-matchers - Collection of testing matchers extracted from Shou... 2017-04-29
Android-SlideExpandableListView - A better ExpandableListView, with animated expanda... 2017-04-29
AppSales-Mobile - App Sales allows iPhone and Mac App Store develope... 2017-04-29
react-templates - Light weight templates for react ... 2017-04-28
afterglow-theme - A minimal dark Theme for Sublime Text 2 and 3 2017-04-28
jwt-go - Golang implementation of JSON Web Tokens (JWT) 2017-04-28
DeerResume - Tool MarkDown online resume, online preview, edit,... 2017-04-28

 Back to top