-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetc.c
More file actions
executable file
·30 lines (26 loc) · 873 Bytes
/
netc.c
File metadata and controls
executable file
·30 lines (26 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
void netcoons(net,rows,columns)
/* Uses bilinear Coons blending to complete a control
net of which only the four boundary polygons are given.
Works for one coordinate only.
Input: net: control net - only boundaries are considered as input.
rows, columns: dimensions of net.
Output: net: the completed net, with the old boundaries.
*/
float net[20][20];
int rows, columns; /*If either of these is >20, adjust dimensions*/
/*in previous statement! */
{
int i,j;
float u,v,u1,v1;
for(i=0; i<=rows; i++)
for(j=0; j<=columns; j++)
{
u=((float)i)/rows; u1=1.0-u;
v=((float)j)/columns; v1=1.0-v;
net[i][j]=u1*net[0][j] + u*net[rows][j]
+v1*net[i][0] + v*net[i][columns]
-u1*v1*net[0][0] - u1*v*net[0][columns]
-u *v1*net[rows][0] - u *v*net[rows][columns];
}
}