Anonymous user
Voronoi diagram/J/Delaunay triangulation: Difference between revisions
Voronoi diagram/J/Delaunay triangulation (view source)
Revision as of 04:19, 2 February 2012
, 12 years agoupdated a lying comment.
m (moved DelaunayVoronoiInJ to Voronoi diagram/J/Delaunay triangulation: Naming convention) |
m (updated a lying comment.) |
||
(One intermediate revision by the same user not shown) | |||
Line 112:
demo_delaunay=: [: plot_tria_mesh [: triangulate ?.random_points
NB. return
voronoi=: 3 : 0 NB. voronoi nodes NB. 2 dimensional
'E N'=. 1 triangulate y
Line 137 ⟶ 136:
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
|