Added c2p and p2c abbreviations to Axes

This commit is contained in:
Grant Sanderson 2019-05-27 19:47:57 -07:00
parent 98696a29f8
commit 828c3dcd7a

View file

@ -171,12 +171,18 @@ class Axes(VGroup, CoordinateSystem):
result += (axis.number_to_point(coord) - origin)
return result
def c2p(self, *coords):
return self.coords_to_point(*coords)
def point_to_coords(self, point):
return tuple([
axis.point_to_number(point)
for axis in self.get_axes()
])
def p2c(self, point):
return self.point_to_coords(point)
def get_axes(self):
return self.axes