ComplexPlane#
Qualified name: manim.mobject.graphing.coordinate\_systems.ComplexPlane
- class ComplexPlane(**kwargs)[source]#
Bases:
NumberPlaneA
NumberPlanespecialized for use with complex numbers.Examples
Example: ComplexPlaneExample ¶
from manim import * class ComplexPlaneExample(Scene): def construct(self): plane = ComplexPlane().add_coordinates() self.add(plane) d1 = Dot(plane.n2p(2 + 1j), color=YELLOW) d2 = Dot(plane.n2p(-3 - 2j), color=YELLOW) label1 = MathTex("2+i").next_to(d1, UR, 0.1) label2 = MathTex("-3-2i").next_to(d2, UR, 0.1) self.add( d1, label1, d2, label2, )
Methods
Adds the labels produced from
get_coordinate_labels()to the plane.Generates the
DecimalNumbermobjects for the coordinates of the plane.Abbreviation for
number_to_point().Accepts a float/complex number and returns the equivalent point on the plane.
Abbreviation for
point_to_number().Accepts a point and returns a complex number equivalent to that point on the plane.
Attributes
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.
- add_coordinates(*numbers, **kwargs)[source]#
Adds the labels produced from
get_coordinate_labels()to the plane.- Parameters
numbers (Iterable[float | complex]) – An iterable of floats/complex numbers. Floats are positioned along the x-axis, complex numbers along the y-axis.
kwargs – Additional arguments to be passed to
get_number_mobject(), i.e.DecimalNumber.
- get_coordinate_labels(*numbers, **kwargs)[source]#
Generates the
DecimalNumbermobjects for the coordinates of the plane.- Parameters
numbers (Iterable[float | complex]) – An iterable of floats/complex numbers. Floats are positioned along the x-axis, complex numbers along the y-axis.
kwargs – Additional arguments to be passed to
get_number_mobject(), i.e.DecimalNumber.
- Returns
A
VGroupcontaining the positioned label mobjects.- Return type
- n2p(number)[source]#
Abbreviation for
number_to_point().- Parameters
number (float | complex) –
- Return type
np.ndarray
- number_to_point(number)[source]#
Accepts a float/complex number and returns the equivalent point on the plane.
- Parameters
number (float | complex) – The number. Can be a float or a complex number.
- Returns
The point on the plane.
- Return type
np.ndarray
- p2n(point)[source]#
Abbreviation for
point_to_number().- Parameters
point (Sequence[float]) –
- Return type
complex