MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

graphics/bezier_curve.py:15–23  ·  view source on GitHub ↗

list_of_points: Control points in the xy plane on which to interpolate. These points control the behavior (shape) of the Bezier curve.

(self, list_of_points: list[tuple[float, float]])

Source from the content-addressed store, hash-verified

13 """
14
15 def __init__(self, list_of_points: list[tuple[float, float]]):
16 """
17 list_of_points: Control points in the xy plane on which to interpolate. These
18 points control the behavior (shape) of the Bezier curve.
19 """
20 self.list_of_points = list_of_points
21 # Degree determines the flexibility of the curve.
22 # Degree = 1 will produce a straight line.
23 self.degree = len(list_of_points) - 1
24
25 def basis_function(self, t: float) -> list[float]:
26 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected