Allow CoordinateSystem.coords_to_point to work on arrays of coords

This commit is contained in:
Grant Sanderson
2022-03-16 12:24:22 -07:00
parent c3e13fff05
commit bd6c731e67

View File

@ -323,10 +323,10 @@ class Axes(VGroup, CoordinateSystem):
def coords_to_point(self, *coords):
origin = self.x_axis.number_to_point(0)
result = origin.copy()
for axis, coord in zip(self.get_axes(), coords):
result += (axis.number_to_point(coord) - origin)
return result
return origin + sum(
axis.number_to_point(coord) - origin
for axis, coord in zip(self.get_axes(), coords)
)
def point_to_coords(self, point):
return tuple([