博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[转载]三线性插值
阅读量:5136 次
发布时间:2019-06-13

本文共 1948 字,大约阅读时间需要 6 分钟。

原文地址:
作者:

Trilinear Interpolation

This section describes the trilinear interpolation algorithm using pseudo-Fortran code.

First, number the eight vertices of a hexahedron.

 
 
 
 
 
 
 
 

Defined as below, notice that xa = x1 when a = &S722;1 and that xa = x2 when a = 1 and similar observations for the rest of the equations.

 
 
 
 
 
 
 

Take three steps of substitutions.

 
 
 
 
 
 
 
 
 
 
 
 

Regrouping

 
 
 
 
 
 
 
 

Define

 
 
 
 
 
 
 
 

Then define

 
 

Exactly similar relations can be derived for y and z.

 
 
 
 
 

where the g's and h's are defined exactly similarly to the f's. Note that in the three equations above everything is known except for a, b and g. From the expression for x, and the similar equations for y and z, it is seen that

 
 
 

So the three equations can be solved for the unknowns a, b and g. A solution can be obtained from Newton's method by letting

 
 
 

where

 
 
 
 
 

Regrouping

 
 
 
 

Similarly

 
 
 
 
 
 
 
 
 

Using an initial guess of a = b = g = 0 the three equations can be solved for da, db and dg. Then one has

 
 
 

If the matrix of the coefficients are zero it is because the hexahedron is degenerate. The new a, b and g can be used to compute new coefficients and solve for new deltas and iteration should continue util the deltas are negligible. The interpolating program has a hard-wired limit of 20 iterations. If after 20 iterations or if the absolute values of any of the three parameters exceed 5.0, then the method fails and the starting stencil is returned as the "best" one.

After a, b and g have been computed the interplated value of any variable known at the vertices can be computed by

 
 
 
 

This equation was copied from the equation for X and can easily be verified by letting a, b and g take on their extreme values of ±1. If (x,y,z) is inside the hexahedron, then the parameters a, b and g will be between ±1. If one of them is outside those limits then the given point is outside the hexahedron and the above formula becomes an extrapolation, not an interpolation. 

转载于:https://www.cnblogs.com/mr-totoro/archive/2012/10/16/5785723.html

你可能感兴趣的文章
ROS lesson 1
查看>>
js笔记
查看>>
c风格字符串函数
查看>>
python基础学习第二天
查看>>
java可重入锁reentrantlock
查看>>
浅谈卷积神经网络及matlab实现
查看>>
struts2学习(9)struts标签2(界面标签、其他标签)
查看>>
Android 导入jar包 so模块--导入放置的目录
查看>>
解决ajax请求cors跨域问题
查看>>
Android Studio
查看>>
zz 圣诞丨太阁所有的免费算法视频资料整理
查看>>
【大数模板】C++大数类 大数模板
查看>>
【123】
查看>>
《收获,不止Oracle》pdf
查看>>
用户权限设置
查看>>
java 之equals与"=="的区别
查看>>
LinkedList<E>源码分析
查看>>
学习微软 Excel 2002 VBA 编程和XML,ASP技术
查看>>
游戏开发常用算法
查看>>
Real-Time Rendering 笔记
查看>>