http://qs321.pair.com?node_id=1161717


in reply to Contour mapping?

It's odd that you start by saying "an X,Y coordinate pair and a real number (0.0 -> 3.0)", but then most of the points in your sample have negative values in the third column. (Granted, all the negative values are very close to zero, but still...)

I realize the sample is too small to draw any conclusions, but it's worth noting that all the X values are unique, as are all the Y values. Also, if I sort on either X or Y, and look at intervals between the points on the given axis, there's very little repetition (but the little repetition I see appears near the middle of the range from shortest to longest interval). In other words, the distribution of sample points over the XY plane appears to be pretty well randomized, and is likely to be fairly dense.

It might be interesting to look at a sample of the "triangle" data, along with the corresponding rows of XYZ coordinates that it refers to. I'd be curious whether the triangles evince some relevant property, like (maybe): no XY coordinate is contained within any such triangle, or the XY plane is fully covered without overlap by the set of triangles, or the Z values satisfy some condition for each set of three points, or whatever. (There was presumably some motivation for defining the triangles, and one can hope that it would be relevant to the task at hand.)

Apart from that, if your primary goal is "to determine ... the angle, relative to the origin, of each of the ... lines between nodes that make up each contour", I'd be tempted to set "arbitrary subdivisions" of the X and Y ranges as well, to quantize and simplify (at least for a first pass) the process of interpolating endpoints for those lines whose slopes are to be reported.

Or maybe the triangle data will provide some way to simplify that process? E.g. get the XYZ centroids of the triangles (if they don't overlap), or maybe even interpolate the Z value at a uniformly quantized XY point that happens to fall within the triangle. I don't know...

Of course, just getting a visual display of (some portion of) the surface via gnuplot or whatever would be a good start, too.