**5. Numerical Results and Discussion for Positivity-Preserving Scattered Data Interpolation**

After we derive the sufficient condition for the positivity of quartic triangular patch, the final *C*<sup>1</sup> scattered data scheme for positivity preservation can be written as follows:

$$P(u,v,w) = \sum\_{\substack{i+j+k=3\\i,j,k\neq 1}} b\_{ijk} B\_{i,j,k}^3(u,v,w) + 6uvw \{a\_1 b\_{111}^1 + a\_2 b\_{111}^2 + a\_3 b\_{111}^3\} \tag{29}$$

with

$$a\_1 = \frac{vw}{vw + uw + uv'}, \\ a\_2 = \frac{uw}{vw + uw + uv'}, \\ a\_3 = \frac{uv}{vw + uw + uv} \tag{30}$$

We test the proposed scheme by using four well-known test functions given below:

$$F\_{1}(x,y) = \begin{cases} 1.0 \text{if}(y-x) \ge 0.5\\ 2(y-x) \text{if}(0.5 \ge (y-x) \ge 0.0\\ \frac{\cos(4\pi \sqrt{(x-1.5)^2 + (y-0.5)^2}) + 1}{2} \text{if}(x-1.5)^2 + (y-0.5)^2 \le \frac{1}{16} \\ 0 \text{elsewhere} \text{even}[0,2] \ge [0,1] \end{cases}$$

$$F\_{2}(x,y) = 1.025 - 0.75e^{-(6x-1)^2 - (6y-1)^2} - 0.75e^{-(9x+1)^2 / 49 - (9y+1)^2 / 10}$$

$$-0.5e^{-(9x-7)^2 - (9y-3)^2} - 0.5e^{-(10x-4)^2 - (10y-7)^2}$$

$$F\_{3}(x,y) = x^4 + y^4$$

$$F\_{4}(x,y) = e^{-(5-10x)^2/2} + 0.75e^{-(5-10y)^2/2} + 0.75e^{-(5-10x)^2/2}e^{-(5-10x)^2/2}$$

The positive test functions *F*1, *F*2, *F*3, and *F*<sup>4</sup> were evaluated on 36, 33, 26, and 100 node points respectively (Tables 6–9) where all function values were greater than or equal to zero. The nodes of 36 and 33 points were defined on a rectangular domain (Figure 13a,b), while the 26- and 100-point nodes were defined on a sparse non-rectangular domain (Figure 13c,d). Tables 8 and 9 show examples of irregular scattered data sets.


**Table 6.** Value of F1 on 36 node points.

**Table 7.** Value of F2 on 33 node points.



**Table 8.** Value of F3 on 26 node points.

**Table 9.** Value of F4 on 100 node points.


For test function *F*<sup>1</sup> as the data in Table 6, the interpolated surface did not preserve the positivity of the original surface for the *C*<sup>1</sup> Zhu and Han quartic (from Theorem 1), as shown in Figure 14a with calculated *min F*1(*x*, *y*) (*x*,*y*)∈*D* = −0.039975. Observe that these surfaces cross the *xy*-plane at a number of

places. After applying positivity-preserving methods from Theorem 3, the result is shown in Figure 14b, where the interpolated surfaces lie above or on the *xy*-plane *min F*1(*x*, *y*) = 0.

$$(x,y)\stackrel{\cdot \cdot \cdot}{\in}D\_{\cdot}^{\cdot \cdot \cdot}$$

**Figure 13.** Triangulation domain using Delaunay triangulation: (**a**) 36 node points; (**b**) 63 node points; (**c**) 26 node points; (**d**) 100 node points.

**Figure 14.** *C*<sup>1</sup> quartic Zhu and Han interpolated surface (data in Table 6): (**a**) without positivity preserved; (**b**) with positivity preserved from Theorem 3.

For test function *F*<sup>2</sup> as the data in Table 7, the interpolated surface did not preserve the positivity of the original surface for the *C*<sup>1</sup> Zhu and Han quartic as shown in Figure 15a, with calculated *min F*2(*x*, *y*) (*x*,*y*)∈*D* = −0.039975. These surfaces cross the *xy*-plane at a number of places. Using the proposed

positivity-preserving methods, the interpolated surface lies above or on the *xy*-plane, as shown in Figure 15b, with calculated *min F*2(*x*, *y*) (*x*,*y*)∈*D* = 0.0072657.

**Figure 15.** *C*<sup>1</sup> quartic Zhu and Han interpolated surface (data Table 7): (**a**) without positivity preserved; (**b**) with positivity preserved from Theorem 3.

For the third test function defined on a sparse non-rectangular domain (data in Table 8), the interpolated surface did not preserve the positivity, as shown in Figure 16a where the surface crosses below the *xy*-plane with *min F*3(*x*, *y*) (*x*,*y*)∈*D* = −0.0053288 and the positivity-preserving interpolated

surface using the proposed scheme is shown in Figure 16b where the surface lies above or on the *xy*-plane, with calculated.

**Figure 16.** *C*<sup>1</sup> quartic Zhu and Han interpolated surface (data Table 8): (**a**) without positivity preserved; (**b**) with positivity preserved from Theorem 3.

The interpolated surface of the Zhu and Han C1 quartic without positivity preservation is given in Figure 17a, with calculated *min F*4(*x*, *y*) (*x*,*y*)∈*D* = −0.67634, while the positivity-preserved surface lying above the *xy*-plane is illustrated in Figure 17b with calculated *min F*4(*x*, *y*) = 0.000074928.

(*x*,*y*)∈*D*

**Figure 17.** *C*<sup>1</sup> quartic Zhu and Han interpolated surface (data Table 9): (**a**) without positivity preserved; (**b**) with positivity preserved from Theorem 3.

We also calculated the CPU time (in seconds), maximum error, and coefficient of determination (R2) for the positivity-preserving scattered data interpolation as shown in Tables 10 and 11. Once again, the proposed scheme was superior to the quartic Bézier triangular patch. For positivity preservation in scattered data interpolation with dense data sets (i.e., 100 data points with 1697 points of evaluation), the proposed scheme only required 0.5168 s, compared with the quartic Bézier which required 18.5996 s. This is about 36 times faster than the times obtained by the schemes of Saaban et al. [35] and Piah et al. [36]. Roughly, the proposed scheme only required about 2.78% of the CPU times of schemes [35,36]. This is very significant when we want to visualize thousands of scattered data points.


**Table 10.** CPU time (in seconds).



Our final example is devoted to the coronavirus disease 2019 (COVID-19) cases at Selangor State and Klang Valley in Malaysia until 15 April 2020. There were 5072 positive cases in Malaysia on 15 April 2020. Selangor and Klang Valley alone had about 2296 positive cases. This represents 45.27% of all COVID-19 cases in Malaysia. Table 12 shows the number of positive COVID-19 cases in 14 districts of Selangor and Klang Valley, including Putrajaya [45].


**Table 12.** Coronavirus disease 2019 (COVID-19) cases at Selangor and Klang Valley in Malaysia until 15 April 2020.

Figures 18 and 19 show the example of surface interpolation for COVID-19 scattered data listed in Table 12. Figure 18 shows the interpolated surface without positivity preservation. Figure 19 shows the interpolated surface after we applied the positivity-preserving scheme. Clearly, Figure 19 is suitable for the relevant agency to visualize the number of COVID-19 cases. Then, they can prepare any contingency plan for the spread of COVID-19. They could also try to minimize the spread of COVID-19. This is very crucial, since at the time of writing there are no available vaccines to cure the patients.

**Figure 18.** Interpolated surface without positivity preservation.

**Figure 19.** Interpolated surface with positivity preservation.

#### **6. Conclusions**

Zhu and Han [44] proposed new cubic Bernstein–Bézier basis functions defined on a triangular domain. We implemented quartic triangular bases (with ten control points) for scattered data interpolation. This new quartic basis makes it possible to avoid the optimization problem that appears when the quartic Bézier triangular is used for scattered data interpolation. From the results, we can see that the proposed scheme in this study outperformed the quartic Bézier triangular, having the smallest maximum error, higher R2, and requiring only 12.5% of the CPU time needed by the quartic Bézier triangular scheme. This is very significant, especially when the goal is to reconstruct surfaces from large scattered data sets. Furthermore, based on a comparison against the Shepard triangular for scattered data, the proposed scheme was also superior to the schemes of Cavoretto et al. [6], Dell'Accio et al. [12,13] and Dell'Accio and Di Tommaso [11]. Finally, we constructed a positive interpolant based on the proposed quartic triangular spline to preserve the positivity of scattered data. Numerical results suggest that the proposed scheme is better than existing schemes, especially in terms of CPU time—our proposed scheme requires less computation time than positivity schemes proposed by Piah et al. [36] and Saaban et al. [35]. Finally, we implemented our proposed positivity-preserving interpolation to visualize COVID-19 cases in Selangor State and Klang Valley, Malaysia. The resulting surfaces were smooth and positive everywhere. Future works will focus on the construction of a quintic Zhu and Han spline for scattered data interpolation with quintic precision as well as shape-preserving interpolation (e.g., positivity-preserving and range-restricted interpolation). This can be achieved by extending the main idea from Karim et al. [46]. Another potential study could be a comparison between the use of a CPU and a graphical processing unit (GPU) for large scattered data sets. Finally, the proposed scheme can also be applied to visualize large sets of scattered data, such as from geophysical data, medical imaging, and total COVID-19 cases around the world.

**Author Contributions:** Conceptualization, V.T.N.; Data curation, S.A.A.K., A.S. and V.T.N.; Formal analysis, S.A.A.K., A.S. and V.T.N.; Funding acquisition, S.A.A.K.; Investigation, S.A.A.K.; Methodology, S.A.A.K. and A.S.; Resources, S.A.A.K. and V.T.N.; Software, S.A.A.K. and A.S.; Validation, S.A.A.K., A.S. and V.T.N.; Visualization, S.A.A.K., A.S. and V.T.N.; Writing—original draft, S.A.A.K.; Writing—review and editing, S.A.A.K., A.S. and V.T.N. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research is fully supported by Universiti Teknologi PETRONAS (UTP) and Ministry of Education (MOE), Malaysia for the financial support received in the form of a research grant: FRGS/1/2018/STG06/UTP/ 03/1/015MA0-020 (New Rational Quartic Spline For Image Refinement) and YUTP: 0153AA-H24 (Spline Triangulation for Spatial Interpolation of Geophysical Data).

**Conflicts of Interest:** The authors declare no conflict of interest.
