简体   繁体   English

C#中的3D散射插值

[英]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. 我一直在寻找与Mathlabs TriScatteredInterp或splittedInterpolant方法等效的C#(也可以与C或C ++等效)。

What I have is a matrix of x, y, z points that is my base data. 我所拥有的是x,y,z点的矩阵,这是我的基本数据。 I want then to use those to create an interpolant where I can send new x,y values and get a z-value back. 然后,我想使用它们创建一个插值,在其中可以发送新的x,y值并获取z值。 For example, lets assume I have the following data: 例如,假设我有以下数据:

0 2,27869819312637 853,922374575371 0 2,27869819312637 853,922374575371

1,98605233685976 2,06708520671126 837,753747324253 1,98605233685976 2,06708520671126 837,753747324253

3,90229069472608 1,88752766631698 823,029331096166 3,90229069472608 1,88752766631698 823,029331096166

5,75551273267257 1,73306236324839 809,260707800665 5,75551273267257 1,73306236324839 809,260707800665

7,54873798463369 1,59817317688994 796,049456606332 7,54873798463369 1,59817317688994 796,049456606332

9,28197384246315 1,47842437187912 783,061777856689 9,28197384246315 1,47842437187912 783,061777856689

10,9534957278425 1,37052388894339 770,064642137392 10,9534957278425 1,37052388894339 770,064642137392

12,5656687239417 1,27364051243946 757,204621862504 12,5656687239417 1,27364051243946 757,204621862504

14,1251442365748 1,18794371439132 744,781009547588 14,1251442365748 1,18794371439132 744,781009547588

15,642287566849 1,11385507647315 733,134144366184 15,642287566849 1,11385507647315 733,134144366184

I want to send x = 1.7, y = 2.2 and get az for that position. 我想发送x = 1.7,y = 2.2并获得该位置的az。

I am currently using Math.Net, but I don't see how it can help me with points in 3-dimensions. 我目前正在使用Math.Net,但是我看不到它如何对3维点提供帮助。 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). 如果您有3d点,它们在XY平面上的投影足够分散,则可以建立三角剖分(某种形式,例如Delaunay三角剖分)。 Then for given x,y coordinates find proper triangle and find interpolated Z-value. 然后,对于给定的x,y坐标,找到合适的三角形并找到插值的Z值。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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