 mt = 1 - t, mt2 = mt * mt, t2 = t * t;
            const x = mt2 * mt * p0.x + 3 * mt2 * t * p1.x + 3 * mt * t2 * p2.x + t2 * t * p3.x;
            const y = mt2 * mt * p0.y + 3 * mt2 * t * p1.y + 3 * mt * t2 * p2.y + t2 * t * p3.y;
            return createPoint(x, y);
        }
        function getPointOnSurface(patch, u, v) { 
            const tempPoints = [];
            for (let i = 0; i < 4; i++) {
                tempPoints.push(evaluateCubicBezierCurve(patch.points[i][0], patch.points[i][1], patch