Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions manim/mobject/graphing/coordinate_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,16 @@ def __init__(
self.num_sampled_graph_points_per_tick = 10
self.x_axis: NumberLine

def coords_to_point(self, *coords: ManimFloat) -> Point3D:
# TODO: I think the method should be able to return more than just a single point.
# E.g. see the implementation of it on line 2065.
def coords_to_point(
self, *coords: float | Sequence[float] | Sequence[Sequence[float]] | np.ndarray
) -> np.ndarray:
# Concrete subclasses (e.g. Axes, NumberPlane) return a single Point3D for
# a single coordinate and a stacked array for batched input.
raise NotImplementedError()

def point_to_coords(self, point: Point3DLike) -> list[ManimFloat]:
def point_to_coords(
self, point: Point3DLike | Sequence[Point3DLike] | np.ndarray
) -> np.ndarray:
raise NotImplementedError()

def polar_to_point(self, radius: float, azimuth: float) -> Point2D:
Expand Down Expand Up @@ -216,7 +220,9 @@ def c2p(
"""Abbreviation for :meth:`coords_to_point`"""
return self.coords_to_point(*coords)

def p2c(self, point: Point3DLike) -> list[ManimFloat]:
def p2c(
self, point: Point3DLike | Sequence[Point3DLike] | np.ndarray
) -> np.ndarray:
"""Abbreviation for :meth:`point_to_coords`"""
return self.point_to_coords(point)

Expand Down
Loading