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): 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([