复平面

限定名称: manim.mobject.graphing.coordinate\_systems.ComplexPlane

class ComplexPlane(**kwargs)[来源]

基础:NumberPlane

一个专门用于复数的NumberPlane

示例

示例:ComplexPlaneExample

../_images/ComplexPlaneExample-1.png
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,
        )
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,
        )

参考文献: Dot MathTex

方法

add_coordinates

get_coordinate_labels()生成的标签添加到平面上。

get_coordinate_labels

生成用于平面坐标的DecimalNumber对象。

n2p

number_to_point()的缩写。

number_to_point

接受一个浮点数/复数并返回平面上的等效点。

p2n

point_to_number()的缩写。

point_to_number

接受一个点并返回平面上与该点等效的复数。

属性

animate

用于动画化self的任何方法的应用。

animation_overrides

color

depth

mobject的深度。

fill_color

如果有多种颜色(用于渐变),则返回第一个颜色

height

mobject的高度。

n_points_per_curve

sheen_factor

stroke_color

width

mobject的宽度。

Parameters:

kwargs (任意)

_get_default_coordinate_values()[来源]

生成一个包含飞机标签数值的列表。

Returns:

表示x轴的浮点数列表和表示y轴的复数列表。

Return type:

列表[浮点数 | 复数]

_original__init__(**kwargs)

初始化自身。有关准确的签名,请参阅 help(type(self))。

Parameters:

kwargs (任意)

Return type:

add_coordinates(*numbers, **kwargs)[来源]

get_coordinate_labels()生成的标签添加到平面上。

Parameters:
  • 数字 (可迭代[浮点数 | 复数]) – 一个包含浮点数/复数的可迭代对象。浮点数沿x轴定位,复数沿y轴定位。

  • kwargs (Any) – 传递给 get_number_mobject() 的额外参数,例如 DecimalNumber

Return type:

自我

get_coordinate_labels(*numbers, **kwargs)[来源]

生成用于平面坐标的DecimalNumber对象。

Parameters:
  • 数字 (可迭代[浮点数 | 复数]) – 一个浮点数/复数的可迭代对象。浮点数沿x轴定位,复数沿y轴定位。

  • kwargs (Any) – 传递给 get_number_mobject() 的额外参数,例如 DecimalNumber

Returns:

一个包含定位标签对象的VGroup

Return type:

VGroup

n2p(number)[source]

number_to_point()的缩写。

Parameters:

数字 (浮点数 | 复数)

Return type:

ndarray

number_to_point(number)[来源]

接受一个浮点数/复数并返回平面上的等效点。

Parameters:

number (float | complex) – 数字。可以是浮点数或复数。

Returns:

平面上的点。

Return type:

np.ndarray

p2n(point)[source]

point_to_number()的缩写。

Parameters:

(Point3D)

Return type:

复杂的

point_to_number(point)[来源]

接受一个点并返回平面上与该点等效的复数。

Parameters:

point (Point3D) – manim坐标系中的点

Returns:

由实部和虚部组成的复数。

Return type:

复杂的