mirror of
https://github.com/3b1b/manim.git
synced 2025-08-21 05:44:04 +00:00
Allow CoordinateSystem.coords_to_point to work on arrays of coords
This commit is contained in:
parent
c3e13fff05
commit
bd6c731e67
1 changed files with 4 additions and 4 deletions
|
@ -323,10 +323,10 @@ class Axes(VGroup, CoordinateSystem):
|
||||||
|
|
||||||
def coords_to_point(self, *coords):
|
def coords_to_point(self, *coords):
|
||||||
origin = self.x_axis.number_to_point(0)
|
origin = self.x_axis.number_to_point(0)
|
||||||
result = origin.copy()
|
return origin + sum(
|
||||||
for axis, coord in zip(self.get_axes(), coords):
|
axis.number_to_point(coord) - origin
|
||||||
result += (axis.number_to_point(coord) - origin)
|
for axis, coord in zip(self.get_axes(), coords)
|
||||||
return result
|
)
|
||||||
|
|
||||||
def point_to_coords(self, point):
|
def point_to_coords(self, point):
|
||||||
return tuple([
|
return tuple([
|
||||||
|
|
Loading…
Add table
Reference in a new issue