Anonymous user
Voronoi diagram/J/Delaunay triangulation: Difference between revisions
Voronoi diagram/J/Delaunay triangulation (view source)
Revision as of 04:15, 2 February 2012
, 12 years agoBug in convex_hull repaired. Occurred when more than 1 point have smallest y value.
m (moved DelaunayVoronoiInJ to Voronoi diagram/J/Delaunay triangulation: Naming convention) |
m (Bug in convex_hull repaired. Occurred when more than 1 point have smallest y value.) |
||
Line 137:
crossproduct=: 1 |. ([ * 1 |. ]) - ] * 1 |. [ NB. j forum
wind=: {:@:crossproduct&(,&0) NB. positive if CCL
smallest_by_coordinate=: 4 : '(#~ (= <./)@:(x&{"1)) y'
convex_hull=: 3 : 0 NB. Graham Scan y are the points
y=. ~. y NB. Implements Robert Sedgewick pseudo-code
N=. # y
start=.
y=. y -. start
y=. y ([ /: angle@:-"1) start
|