DecimalMatrix¶
限定名称: manim.mobject.matrix.DecimalMatrix
- class DecimalMatrix(matrix, element_to_mobject=<class 'manim.mobject.text.numbers.DecimalNumber'>, element_to_mobject_config={'num_decimal_places': 1}, **kwargs)[来源]¶
基础:
Matrix一个在屏幕上显示带有十进制条目的矩阵的mobject。
示例
示例:DecimalMatrixExample ¶
from manim import * class DecimalMatrixExample(Scene): def construct(self): m0 = DecimalMatrix( [[3.456, 2.122], [33.2244, 12]], element_to_mobject_config={"num_decimal_places": 2}, left_bracket="\{", right_bracket="\}") self.add(m0)
class DecimalMatrixExample(Scene): def construct(self): m0 = DecimalMatrix( [[3.456, 2.122], [33.2244, 12]], element_to_mobject_config={"num_decimal_places": 2}, left_bracket="\{", right_bracket="\}") self.add(m0)将根据提供的配置对小数位进行四舍五入/截断。
- Parameters:
方法
属性
animate用于动画化
self的任何方法的应用。animation_overridescolordepthmobject的深度。
fill_color如果有多种颜色(用于渐变),则返回第一个颜色
heightmobject的高度。
n_points_per_curvesheen_factorstroke_colorwidthmobject的宽度。
- _original__init__(matrix, element_to_mobject=<class 'manim.mobject.text.numbers.DecimalNumber'>, element_to_mobject_config={'num_decimal_places': 1}, **kwargs)¶
将根据提供的配置对小数位进行四舍五入/截断。