# comp.graphics.algorithms

## Subject: How to fill unknown middle value in surface array

I have a quite simple problem to which a Bicubic/NURBS programmer will
probably be able to suggest a solution to straight away.

I have a 5x5 or larger 2d array of double values with a missing central
value. The array represents a smooth surface (analogous to a 3d
landscape - for example). How do I go about determining this missing
middle value, making sure I use as many of the surrounding values as
possible. Here is a quick diagram of the 5x5 (bearing in mind I
actually have all values further out to typically a 100x100 array but
it is the centre I am concerned with).

[ 0.1 ] [ 0.1 ] [ 0.2 ] [ 0.1 ] [ 0.0 ]
[ 0.1 ] [ 0.1 ] [ 0.2 ] [ 0.1 ] [ 0.0 ]
[ 0.1 ] [ 0.2 ] [ X ] [ 0.1 ] [ 0.1 ]
[ 0.1 ] [ 0.1 ] [ 0.2 ] [ 0.2 ] [ 0.1 ]
[ 0.1 ] [ 0.1 ] [ 0.2 ] [ 0.3 ] [ 0.2 ]

So I need to find X, but I'd like to use all 8 of the surrounding
values as well as values 2 positions away from the centre. At the
moment I am using a 4x4 bicubic patch to determine the missing value
but this obviously misses out some values (I think I'm even using every
other value to fit the 4x4 over the top so that the X is in the middle

Thanks,

James Carr, University of Wales - Aberystwyth