I'm looking to do a linear interpolation of a irregularly sampled function z(x,y)
based on a Delaunay triangulation. Say I have a hill for which I have obtained a Delaunay triangulation:
I know the altitude z
at each of the triangle vertices (samples). I want the altitude z
at an arbitrary point (x,y)
.
How do I tell which triangle contains point
(x,y)
? Once I know this, I guess it's fairly straightforward to interpolate between the triangle's three vertices.Do you know of a ready-made implementation of this? Perhaps with the interpolation bit included as well? I'm sure there must be an open source implementation of this somewhere out there. I'm especially interested in Java (source or JAR), but any flavour of VB or some other language could be useful as well.