Diffraction
11-28-2005, 12:29 AM
NEVER MIND:D
I am trying to code bicubic interpolation in an application's psuedo-C scripting language (OSLO CCL). I am thinking the wt[16][16] matrix is not correct (NR 2nd edition, page 126). My test case is a tilted plane. I am getting garbage results.
Assumed plane is z(t,u)=A+Bt+Cu where t and u are the normalized (0 to 1) horizontal and vertical coordinates in the cell. My x[16] vector looks correct. I believe that a linear expansion about the lower left corner of cell requires that the matrix c[1..4][1..4] should have elements c[1][1]=A, c[1][2]=C, c[2][1]=B and all others should be zero. This is not happening.
I have considered issues of 0-based vs 1-based indexing. I have considered row-major vs column-major storage. This has not helped.
To get the 3 non-zero elements, I believe that the 2nd row of the wt[][] matrix should be all zeros except for a one in the 3rd column and that the 5th row should be all zeros except for a one in the 2nd column. If not, I don't see how my planar test case can be matched in the neighborhood of the lower left (t=u=0) corner.
I am trying to code bicubic interpolation in an application's psuedo-C scripting language (OSLO CCL). I am thinking the wt[16][16] matrix is not correct (NR 2nd edition, page 126). My test case is a tilted plane. I am getting garbage results.
Assumed plane is z(t,u)=A+Bt+Cu where t and u are the normalized (0 to 1) horizontal and vertical coordinates in the cell. My x[16] vector looks correct. I believe that a linear expansion about the lower left corner of cell requires that the matrix c[1..4][1..4] should have elements c[1][1]=A, c[1][2]=C, c[2][1]=B and all others should be zero. This is not happening.
I have considered issues of 0-based vs 1-based indexing. I have considered row-major vs column-major storage. This has not helped.
To get the 3 non-zero elements, I believe that the 2nd row of the wt[][] matrix should be all zeros except for a one in the 3rd column and that the 5th row should be all zeros except for a one in the 2nd column. If not, I don't see how my planar test case can be matched in the neighborhood of the lower left (t=u=0) corner.