# Cubic \(q\)-Bezier Triangular Patch for Scattered Data Interpolation and Its Algorithm
## 5 Results and Discussion  
In this study, we implemented the proposed scheme using MATLAB 2023a to conduct the experiment. The MATLAB coding was developed based on Algorithm 1, and the processor used was 1.6 GHz Dual-Core Intel Core i5 (Intel, Santa Clara, CA, USA). The error norms were computed using a \(33\times 33\) uniform rectangular grid of evaluation points in the unit square. The error measurements used were the (a) coefficient of determination, \(R^{2}\); (b) root mean square error (RMSE); and (c) central processing unit (CPU) time. ```
1:Input: Scattered data points \(\{(x_{i},y_{i},z_{i})\}_{i=1}^{n}\)
2:Output: Interpolated surface, \(R^{2}\), RMSE, and CPU time
3:
4:Step 1: Estimate Partial Derivatives
5:
6: Compute the partial derivatives \(\frac{\partial f}{\partial x_{1}}\), \(\frac{\partial f}{\partial x_{2}}\) and \(\frac{\partial f}{\partial x_{3}}\) at each data point using Equation (8). 7:MATLAB functions: diff, gradient
8:
9:
10:Step 2: Perform Delaunay Triangulation
11:
12:
13: Use a Delaunay triangulation algorithm to create a mesh from the scattered data points. 14:MATLAB functions: delaunay, triplot
15:
16:
17:
18:
19:
20:Step 3: Calculate Boundary Control Points
21:
22:
23: Determine the boundary control points for each triangle in the triangulated mesh. 24:MATLAB functions: convhull, boundary
25:
26:
27:
28:Step 4: Calculate Inner Control Points
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
99:
99:
99:
100:
97:
111:
12:
13:
14:
15:
16:
17:
18:
19:
19:
19:
10:
11:
12:
14:
15:
16:
17:
18:
19:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
29:
20:
21:
22:
29:
21:



The error bound for the proposed scattered data interpolation scheme was adopted from [35]. Let the proposed scheme be denoted as \(p\) and \(\Phi\) be the convex hull of points \(\{(x_{i},y_{i})\},i=1,2,\ldots,N\). Let \(\Delta\) be a triangulation of \(\Phi\). **Theorem 2**. : _For every \(fcC^{4}(\Phi)\). Its \(C^{1}\)\(q\)-Bezier interpolant \(p\) satisfies_

\[\|f-p\|\leq K|\Delta|^{4}|f|_{4}\]

_where the constant \(K\) depends on the smallest angle in \(\Delta\). Furthermore, \(|\Delta|\) is the size of the triangulation, i.e., the \(\Delta\) largest length of edges of \(\Delta\)._

The proposed scheme was tested using three well-known test functions \(F_{1}(x,y)\), \(F_{2}(x,y)\), and \(F_{3}(x,y)\) for surface interpolation ([PERSON] et al. [36]):

1. Sphere function: \[F_{1}(x,y) =0.75e^{\left(-\frac{(9x-2)^{2}+(9y-2)^{2}}{4}\right)}+0.75e^{ \left(-\frac{(9x+1)^{2}}{49}-\frac{(9y+1)^{2}}{10}\right)}+\] \[0.5e^{\left(-\frac{(9x-7)^{2}+(9y-3)^{2}}{4}\right)}-0.2e^{\left( -(9x-4)^{2}-(9y-7)^{2}\right)}\]
2. Cliff function: \[F_{2}(x,y) =\frac{(1.25+\cos(5.4y))}{6+6(3x-1)^{2}}\]
3. Gentle function: \[F_{3}(x,y) =\frac{1}{3}e^{-\frac{81}{16}((x-0.5)^{2}-(y-0.5)^{2})}\]

Figure 6 shows the Delaunay triangulation of 36, 65, and 100 data points on the rectangular domain of \([0,1]\times[0,1]\) with uniform distribution. The Delaunay triangulation presented in Figure 6 is constrained, ensuring that specific segments are included as edges. This approach is particularly useful for maintaining specific boundary conditions and incorporating predefined features into the mesh structure [37]. Figures 7-14 display the surface interpolation and corresponding contour plots with various \(q\) parameters and data points derived from the \(F_{1}(x,y)\) function. The visual inspection reveals that surface interpolation and its contour plots exhibit noticeable smoothness with 100 data points compared to 36 and 65 data points. Despite the change in the \(q\) parameter, differentiating the resulting surfaces proves visually challenging. Similarly, Figures 15-22 illustrate surface interpolation and contour plots based on the \(F_{2}(x,y)\) function under a varying \(q\) parameter and data points.