mirror of
https://github.com/3b1b/manim.git
synced 2025-08-21 05:44:04 +00:00
Updating type hints for paths.py
This commit is contained in:
parent
f53fad1a96
commit
7ac78f3dbb
1 changed files with 5 additions and 4 deletions
|
@ -13,6 +13,7 @@ from typing import TYPE_CHECKING
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
from manimlib.typing import Vect3, Vect3Array
|
||||||
|
|
||||||
|
|
||||||
STRAIGHT_PATH_THRESHOLD = 0.01
|
STRAIGHT_PATH_THRESHOLD = 0.01
|
||||||
|
@ -34,8 +35,8 @@ def straight_path(
|
||||||
|
|
||||||
def path_along_arc(
|
def path_along_arc(
|
||||||
arc_angle: float,
|
arc_angle: float,
|
||||||
axis: np.ndarray = OUT
|
axis: Vect3 = OUT
|
||||||
) -> Callable[[np.ndarray, np.ndarray, float], np.ndarray]:
|
) -> Callable[[Vect3Array, Vect3Array, float], Vect3Array]:
|
||||||
"""
|
"""
|
||||||
If vect is vector from start to end, [vect[:,1], -vect[:,0]] is
|
If vect is vector from start to end, [vect[:,1], -vect[:,0]] is
|
||||||
perpendicular to vect in the left direction.
|
perpendicular to vect in the left direction.
|
||||||
|
@ -57,9 +58,9 @@ def path_along_arc(
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
def clockwise_path() -> Callable[[np.ndarray, np.ndarray, float], np.ndarray]:
|
def clockwise_path() -> Callable[[Vect3Array, Vect3Array, float], Vect3Array]:
|
||||||
return path_along_arc(-np.pi)
|
return path_along_arc(-np.pi)
|
||||||
|
|
||||||
|
|
||||||
def counterclockwise_path() -> Callable[[np.ndarray, np.ndarray, float], np.ndarray]:
|
def counterclockwise_path() -> Callable[[Vect3Array, Vect3Array, float], Vect3Array]:
|
||||||
return path_along_arc(np.pi)
|
return path_along_arc(np.pi)
|
||||||
|
|
Loading…
Add table
Reference in a new issue