Advertisement
Guest User

Untitled

a guest
May 5th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. import java.math.*;
  2. import java.util.Vector;
  3. public class ConvexHull
  4. {
  5. // public static DoublyLinkedList <Point> simpleConvex(Point[] P)
  6. // {
  7. // DoublyLinkedList <Point> S = new DoublyLinkedList <Point>();
  8. // Point small = getSmallest(P);
  9. // Point [] arr = deleteSmallest(P);
  10. // arr = sortiere(arr);
  11. // if (P.length<2)
  12. // {
  13. // System.out.println("Die konvexe Hülle ist leer");
  14. // }
  15. // S = null;
  16. // Vector vec = new Vector();
  17. // vec.add(small);
  18. // vec.add(arr[0]);
  19. // vec.add(arr[1]);
  20. // for (int i=0;i<P.length;i++)
  21. // {
  22. //
  23. // }
  24. // return S;
  25. // }
  26. //
  27. // public static Point getSmallest (Point [] P)
  28. // {
  29. // double [] x = new double [2];
  30. // x[0] = P[0].get(0);
  31. // x[1] = P[0].get(1);
  32. // Point punkt = new Point (2, x);
  33. // Point temp = new Point (2, x);
  34. // for (int i = 0; i<P.length;i++)
  35. // {
  36. // if (P[i].get(0)>x[0])
  37. // {
  38. // temp = P[i];
  39. // }
  40. // }
  41. // return temp;
  42. // }
  43. //
  44. // public static Point [] deleteSmallest (Point [] P)
  45. // {
  46. // Point small = getSmallest(P);
  47. // Point [] neu = new Point[P.length-1];
  48. // int help;
  49. // for (int i = 0; i<P.length; i++)
  50. // {
  51. // if (P[i] != small)
  52. // {
  53. // neu[i]=P[i];
  54. // help = i;
  55. // }
  56. // else
  57. // {
  58. // help = i;
  59. // i+=P.length;
  60. // }
  61. // }
  62. // if (help<P.length)
  63. // {
  64. //
  65. // }
  66. // else
  67. // {
  68. // while (help<P.length)
  69. // {
  70. // neu[help]=P[help];
  71. // }
  72. // }
  73. // return neu;
  74. // }
  75. // public static Point[] sortiere (Point[] P)
  76. // {
  77. // Point[]unten = new Point[P.length];
  78. // Point[]oben = new Point[P.length];
  79. // Point[]neu = new Point[P.length];
  80. // Point start = getSmallest(P);
  81. // for (int i = 0; i<P.length;i++)
  82. // {
  83. // if(P[i].get(1)<=start.get(1))
  84. // {
  85. // unten[i]=P[i];
  86. // }
  87. // else
  88. // {
  89. // oben[i]=P[i];
  90. // }
  91. // }
  92. //
  93. //
  94. // }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement