From bd6c731e67d9f615b80599d899a20639dc2fb21c Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Wed, 16 Mar 2022 12:24:22 -0700 Subject: [PATCH] Allow CoordinateSystem.coords_to_point to work on arrays of coords --- manimlib/mobject/coordinate_systems.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manimlib/mobject/coordinate_systems.py b/manimlib/mobject/coordinate_systems.py index 3ad01086..86d405f5 100644 --- a/manimlib/mobject/coordinate_systems.py +++ b/manimlib/mobject/coordinate_systems.py @@ -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([