mirror of
https://github.com/3b1b/manim.git
synced 2025-08-21 05:44:04 +00:00
Tweak to type hints
This commit is contained in:
parent
8e2cf04b71
commit
3820e098c0
1 changed files with 3 additions and 3 deletions
|
@ -22,14 +22,14 @@ CLOSED_THRESHOLD = 0.001
|
||||||
|
|
||||||
|
|
||||||
def bezier(
|
def bezier(
|
||||||
points: Sequence[Scalable] | VectNArray
|
points: Sequence[float | FloatArray] | VectNArray
|
||||||
) -> Callable[[float], Scalable]:
|
) -> Callable[[float], float | FloatArray]:
|
||||||
if len(points) == 0:
|
if len(points) == 0:
|
||||||
raise Exception("bezier cannot be calld on an empty list")
|
raise Exception("bezier cannot be calld on an empty list")
|
||||||
|
|
||||||
n = len(points) - 1
|
n = len(points) - 1
|
||||||
|
|
||||||
def result(t: float) -> Scalable:
|
def result(t: float) -> float | FloatArray:
|
||||||
return sum(
|
return sum(
|
||||||
((1 - t)**(n - k)) * (t**k) * choose(n, k) * point
|
((1 - t)**(n - k)) * (t**k) * choose(n, k) * point
|
||||||
for k, point in enumerate(points)
|
for k, point in enumerate(points)
|
||||||
|
|
Loading…
Add table
Reference in a new issue