Skip to main content
. 2024 Jun 8;24(12):3735. doi: 10.3390/s24123735
Algorithm 6 Generate Bézier Curve Points
  •   1:

    function GenerateBezierCurve(control_points, num_points)

  •   2:

        t Create a list of num_points evenly spaced values between 0 and 1

  •   3:

        Initialize curve as a num_points×2 zero matrix

  •   4:

        n Number of control points minus 1

  •   5:

        for i0 to num_points1 do

  •   6:

              for j0 to n do

  •   7:

               Calculate Bernstein polynomial bernstein_poly

  •   8:

               curve[i]curve[i]+bernstein_poly×control_points[j]

  •   9:

             end for

  • 10:

        end for

  • 11:

        return curve

  • 12:

    end function