我需要插值方法的帮助 [英] I need help with interpolation methods

查看:50
本文介绍了我需要插值方法的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要您的帮助,请告诉我一些插值方法.您可以使用C ++或C#.谢谢

解决方案

hhxxvc写道:

您可以使用c ++或c#



伪代码怎么样?...

拿两个点和一个百分比.计算两点之间的距离.计算距离,该距离是该完整距离的给定百分比.现在已经有了该部分距离,请计算两点之间的直线上的点,即与第一个点之间的部分距离.您可能需要利用单位矢量来计算插值点的位置.



插值法预测域(数据空间)内的数据.外推法预测的是域外的点.

让我们说一个具有两个点pt1(10,10)和pt2(20,20)的向量,p1的温度值为30,而pt2的温度值为40.因此,此处两个点之间的距离(使用毕达哥拉斯定理求出距离)也为10单位之间,点之间的差异也就10个单位.因此,如果点10,10的温度为30,那么点13,13的温度应该为33.因此,现在您如何计算它.

点13​​与10,10的距离为3单位距离,与20,20的距离为7单位距离.假定该值与最接近的点(即10,10的值30)更相似.因此,我们使用反比关系对距离进行加权

tempValue1 = value1 * 7个单位距离的百分比,即30 *(7/10)=21.注意,我正在使用距离的交叉乘法

tempValue2 = value2 * 3单位距离的百分比,即40 *(3/10)= 12

预测值= tempvalue1 + tempvalue2 = 21 + 12 = 33

这是向量插值的一种简单形式.现在,您可以在Google上搜索高级算法.

祝你好运


希望插值方法 [ ^ ]将为您提供想法.


I need your help, tell me some interpolation methods. You can use C++ or C#. Thanks

解决方案

hhxxvc wrote:

you can use c++ or c#



How about pseudo code?...

Take two points and a percentage. Calculate the distance between the two points. Calculate the distance that is the given percentage of that full distance. Now that you have that partial distance, calculate the point on the line between the two points that is the partial distance from the first point. You''ll probably want to make use of a unit vector to calculate the position of the interpolated point.


Hi
Interpolation is predicting data within the domain (data space). Extrapolation is predicting a point outside the domain.

Let us say a vector with two points pt1 (10,10) and pt2(20,20) p1 has temperature value 30 and pt2 has temperature value 40. So here the distance (use Pythagoras theorem to find distance) between the points also 10 units, the different between the points also 10 units. So if temperature at point 10,10 is 30 then at point 13,13 supposed to be 33. So now how you calculate this.

the point 13 has 3 unit distance from 10,10 and 7 unit distance from 20,20. The value supposed be more similar to the nearest point i.e 10,10 which value 30. So we weight the distance with a inverse relationship

tempValue1= value1* percentage of 7 unit distance i.e 30*(7/10)= 21. Note I am using the cross multiplication of the distance

tempValue2= value2* percentage of 3 unit distance i.e 40*(3/10)= 12

predicted value= tempvalue1+tempvalue2= 21+12= 33

This is a simple form of vector interpolation. Now you may search google for advanced algorithms.

good luck


Hope Interpolation Methods[^] will give you an idea.


这篇关于我需要插值方法的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆