简体   繁体   中英

3D Scattered Interpolation in C#

I have been looking for a C# (C or C++ equivalents are fine too) equivalent of Mathlabs TriScatteredInterp or scatteredInterpolant methods.

What I have is a matrix of x, y, z points that is my base data. I want then to use those to create an interpolant where I can send new x,y values and get a z-value back. For example, lets assume I have the following data:

0 2,27869819312637 853,922374575371

1,98605233685976 2,06708520671126 837,753747324253

3,90229069472608 1,88752766631698 823,029331096166

5,75551273267257 1,73306236324839 809,260707800665

7,54873798463369 1,59817317688994 796,049456606332

9,28197384246315 1,47842437187912 783,061777856689

10,9534957278425 1,37052388894339 770,064642137392

12,5656687239417 1,27364051243946 757,204621862504

14,1251442365748 1,18794371439132 744,781009547588

15,642287566849 1,11385507647315 733,134144366184

I want to send x = 1.7, y = 2.2 and get az for that position.

I am currently using Math.Net, but I don't see how it can help me with points in 3-dimensions. Any ideas?

Note that this data set doesn't provide a good grid, because points form chain-like structure rather than net.

If you'll have 3d points, whose projections to XY plane are scattered enough, you can build triangulation (of some kind, eg Delaunay one). Then for given x,y coordinates find proper triangle and find interpolated Z-value.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM