Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added p2n and n2p abreviations for ComplexPlane

Grant Sandersona535c6917e3f
diff --git a/manimlib/mobject/coordinate_systems.py b/manimlib/mobject/coordinate_systems.py
index 177d63459..390e8f5ae 100644
--- a/manimlib/mobject/coordinate_systems.py
+++ b/manimlib/mobject/coordinate_systems.py
@@ -388,10 +388,16 @@ class ComplexPlane(NumberPlane):
number = complex(number)
return self.coords_to_point(number.real, number.imag)
+ def n2p(self, number):
+ return self.number_to_point(number)
+
def point_to_number(self, point):
x, y = self.point_to_coords(point)
return complex(x, y)
+ def p2n(self, point):
+ return self.point_to_number(point)
+
def get_default_coordinate_values(self):
x_numbers = self.get_x_axis().default_numbers_to_display()
y_numbers = self.get_y_axis().default_numbers_to_display()