# comp.graphics.algorithms

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

James,

z(x,y) =3D p0 + p1*x + p2*y

z(x,y) =3D 0.5 + 0.1*x + 0.2*y

x=3D-1, 0, +1
y=3D-1, 0, +1

Data array

y=3D-1 0.2 0.3 0.4
y=3D0 0.4 0.5 0.6
y=3D+1 0.6 0.7 0.8

The center value 0.5 is not required in the data
array, it will be calculated.

P =3D ( p0, p1, p2 )=B4

Z =3D ( 0.2, 0.3, 0.4, 0.4, 0.6, 0.6, 0.7, 0.8 )'

M =3D ( 1, x, y ) ...

M =3D ( 1, -1, -1
1, 0, -1
1, +1, -1
1, -1, 0 no row for x=3D0,y=3D0
1, +1, 0
1, -1, +1
1, 0, +1
1, +1, +1 )

8 linear equations for 3 unknowns.

M * P =3D Z

The Gauss Normal operation is the condensed
version of a least squares optimization (often
called regression). This cannot be proved here.

M' * M * P =3D M' * Z

The new matrix M' * M has the size 3x3,
therefore one has to solve 3 equations for 3
unknowns.

If this example should work, P =3D ( 0.5, 0.1,0.2)',
then the function system and the number of data
points can be extended.

The functions system consists of linearly
independent functions like
1, x, y, x^2, x*y, y^2 ...
'Linearly independent' means: each function
contributes something which cannot be replaced
by a weighted sum of the other functions.

Hope this helps a little.

Best regards --Gernot Hoffmann