Paths

manimlib/utils/paths.py 这个文件中主要实现了和路径有关的函数


manimlib.utils.paths.straight_path(start_points: numpy.ndarray, end_points: numpy.ndarray, alpha: float) → numpy.ndarray

Same function as interpolate, but renamed to reflect intent of being used to determine how a set of points move to another set. For instance, it should be a specific case of path_along_arc

直线路径,和线性插值相同


manimlib.utils.paths.path_along_arc(arc_angle: float, axis: np.ndarray = array([0., 0., 1.])) → Callable[[np.ndarray, np.ndarray, float], np.ndarray]

If vect is vector from start to end, [vect[:,1], -vect[:,0]] is perpendicular to vect in the left direction.

axis 为轴, arc_angle 为圆心角的圆弧路径
返回含有三个参数 (start_points, end_points, alpha) 的函数

manimlib.utils.paths.clockwise_path() → Callable[[np.ndarray, np.ndarray, float], np.ndarray]
顺时针圆路径
返回含有三个参数 (start_points, end_points, alpha) 的函数

manimlib.utils.paths.counterclockwise_path() → Callable[[np.ndarray, np.ndarray, float], np.ndarray]
逆时针圆路径
返回含有三个参数 (start_points, end_points, alpha) 的函数