; File: triangulate.pro
; Author: Erik Brisson


N = 40
d = fltarr(3,N)

openr, 1, 'dat/ex_tri.dat'
readf, 1, d
close, 1

x = d(0,*)
y = d(1,*)
z = d(2,*)

triangulate, x, y, tri
window,1,retain=2, title='Triangulation of data',xsize=500,ysize=500
plot, x, y, psym=1, title="'Triangulation of regular data'

for i=0, n_elements(tri)/3-1 do begin
    t = [tri(*,i), tri(0,i)]
    plots, x(t), y(t)
endfor
window, 2, retain=2, title='Surface plot of regular data', xsize=500, ysize=500
surface, trigrid(x,y,z,tri)

end

