mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 18:47:46 +00:00
Added abbreviated names for number_to_point and point_to_number
This commit is contained in:
parent
41e305e561
commit
644ac5c94a
2 changed files with 16 additions and 0 deletions
|
|
@ -34,6 +34,14 @@ class CoordinateSystem():
|
|||
def point_to_coords(self, point):
|
||||
raise Exception("Not implemented")
|
||||
|
||||
def c2p(self, *coords):
|
||||
"""Abbreviation for coords_to_point"""
|
||||
return self.coords_to_point(*coords)
|
||||
|
||||
def p2c(self, point):
|
||||
"""Abbreviation for point_to_coords"""
|
||||
return self.point_to_coords(point)
|
||||
|
||||
def get_axes(self):
|
||||
raise Exception("Not implemented")
|
||||
|
||||
|
|
|
|||
|
|
@ -122,6 +122,14 @@ class NumberLine(Line):
|
|||
)
|
||||
return interpolate(self.x_min, self.x_max, proportion)
|
||||
|
||||
def n2p(self, number):
|
||||
"""Abbreviation for number_to_point"""
|
||||
return self.number_to_point(number)
|
||||
|
||||
def p2n(self, point):
|
||||
"""Abbreviation for point_to_number"""
|
||||
return self.point_to_number(point)
|
||||
|
||||
def get_unit_size(self):
|
||||
return (self.x_max - self.x_min) / self.get_length()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue