mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 17:47:44 +00:00
Added c2p and p2c abbreviations to Axes
This commit is contained in:
parent
98696a29f8
commit
828c3dcd7a
1 changed files with 6 additions and 0 deletions
|
|
@ -171,12 +171,18 @@ class Axes(VGroup, CoordinateSystem):
|
||||||
result += (axis.number_to_point(coord) - origin)
|
result += (axis.number_to_point(coord) - origin)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def c2p(self, *coords):
|
||||||
|
return self.coords_to_point(*coords)
|
||||||
|
|
||||||
def point_to_coords(self, point):
|
def point_to_coords(self, point):
|
||||||
return tuple([
|
return tuple([
|
||||||
axis.point_to_number(point)
|
axis.point_to_number(point)
|
||||||
for axis in self.get_axes()
|
for axis in self.get_axes()
|
||||||
])
|
])
|
||||||
|
|
||||||
|
def p2c(self, point):
|
||||||
|
return self.point_to_coords(point)
|
||||||
|
|
||||||
def get_axes(self):
|
def get_axes(self):
|
||||||
return self.axes
|
return self.axes
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue