Illustrates bilinear interpolation on the unit square. The four corners have fixed values as indicated in the figure, and the values in between are interpolated, and the interpolated values are represented by the colour.
Done in Matlab, source code:
# Grid of known points:
>> [X, Y] = meshgrid(0:1)
# Grid for interpolated values:
>> [XI,YI] = meshgrid(0:0.001:1);
# Known values to interpolate from:
>> Z = [0 1; 1 0.5]
# Do bilinear interpolation
>> ZI = interp2(X,Y,Z,XI,YI);
# Visualize result:
>> surf(XI,YI,ZI, 'EdgeColor','none'); alpha(0.9)
>> view([0 90])
>> print -dpng Bilininterp.png
أنا، مالِك حقوق تأليف ونشر هذا العمل، أجعله في النِّطاق العامِّ، يسري هذا في أرجاء العالم كلِّه. في بعض البلدان، قد يكون هذا التَّرخيص غيرَ مُمكنٍ قانونيَّاً، في هذه الحالة: أمنح الجميع حق استخدام هذا العمل لأي غرض دون أي شرط ما لم يفرض القانون شروطًا إضافية.
Own work. Illustrates bilinear interpolation on the unit square. The four corners have fixed values as indicated in the figure, and the values in between are interpolated, and the interpolated values are represented by the colour.