Skip to content

Commit 66d62fc

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7f22f47 commit 66d62fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

graphics/bezier_curve.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ def derivative(self, t: float) -> tuple[float, float]:
8484
dx = 0.0
8585
dy = 0.0
8686
for i in range(n):
87-
coeff = comb(n - 1, i) * ((1 - t) ** (n - 1 - i)) * (t ** i)
87+
coeff = comb(n - 1, i) * ((1 - t) ** (n - 1 - i)) * (t**i)
8888
delta_x = self.list_of_points[i + 1][0] - self.list_of_points[i][0]
8989
delta_y = self.list_of_points[i + 1][1] - self.list_of_points[i][1]
9090
dx += coeff * delta_x * n
9191
dy += coeff * delta_y * n
9292
return (dx, dy)
93-
93+
9494
def plot_curve(self, step_size: float = 0.01):
9595
"""
9696
Plots the Bezier curve using matplotlib plotting capabilities.
@@ -131,7 +131,7 @@ def plot_curve(self, step_size: float = 0.01):
131131
BezierCurve([(1, 2), (3, 5)]).plot_curve() # degree 1
132132
BezierCurve([(0, 0), (5, 5), (5, 0)]).plot_curve() # degree 2
133133
BezierCurve([(0, 0), (5, 5), (5, 0), (2.5, -2.5)]).plot_curve() # degree 3
134-
134+
135135
# Test derivative method
136136
curve = BezierCurve([(0, 0), (5, 5), (5, 0)])
137137
print("Derivative at t=0.0:", curve.derivative(0.0))

0 commit comments

Comments
 (0)