复平面¶
限定名称: manim.mobject.graphing.coordinate\_systems.ComplexPlane
- class ComplexPlane(**kwargs)[来源]¶
基础:
NumberPlane一个专门用于复数的
NumberPlane。示例
示例: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, )
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, )方法
将
get_coordinate_labels()生成的标签添加到平面上。生成用于平面坐标的
DecimalNumber对象。接受一个浮点数/复数并返回平面上的等效点。
接受一个点并返回平面上与该点等效的复数。
属性
animate用于动画化
self的任何方法的应用。animation_overridescolordepthmobject的深度。
fill_color如果有多种颜色(用于渐变),则返回第一个颜色
heightmobject的高度。
n_points_per_curvesheen_factorstroke_colorwidthmobject的宽度。
- 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:
- number_to_point(number)[来源]¶
接受一个浮点数/复数并返回平面上的等效点。
- Parameters:
number (float | complex) – 数字。可以是浮点数或复数。
- Returns:
平面上的点。
- Return type:
np.ndarray