Map uses the Interpolator infrastructure. In the libdx directory, grep -l for "PrimitiveInterpolate"; that'll identify the files that contain interpolator code. For some, a file name xxxxABnD.c indicates that it contains the code for interpolating primitive type xxxx with regular connections (A=R) or irregular connections (A=I), with regular positions (B=R) or irregular connections (B=I), in n-dimensions; for example, linesRI1D.c contains the code that interpolates lines with regular connections and irregular positions in 1D. For other types (for example, tetras) there is no advantage to descriminate so all tetra interplation is done in tetras.c. If you look at linesRI2D.c, around line 779, a procedure, linear_coords, is called to determine whether the sample (*pPtr) is in the interval [p0, p1]. If not, it tells which way to step along the sequence of intervals to find the sample. When a containing interval is found, the procedure also returns the weights for the data values corresponding to p0 and p1 that are used to interpolate at *pPtr. There is analogous code in each interpolator file for elements with irregular connections. Interpolators for irregular elements other than lines generally use the "neighbors" component to speed the search for the containing element, and use similar "barycentric" linear interpolation. For regular data, simple n-linear interpolation is used. I think the Regrid interpolation is in .../dxmods/regrid.c, or maybe _connectgrids.c. Other interpolation - streamlines, MapToPlane... are done in dxmods files with semi-appropriate names, for example, maptoplane.c or _maptoplane.c. Greg
