DecimalMatrix¶
限定名称: manim.mobject.matrix.DecimalMatrix
- 类 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)
将根据提供的配置对小数位数进行四舍五入/截断。
- 参数:
方法
属性
animate (动画)
用于动画化
self
的任何方法的应用。animation_overrides (动画覆盖)
颜色
depth (深度)
mobject 的深度。
fill_color (填充颜色)
如果存在多种颜色(用于渐变),则返回第一种颜色
height (高度)
mobject 的高度。
n_points_per_curve (每条曲线的点数)
sheen_factor (光泽因子)
stroke_color (描边颜色)
width (宽度)
mobject 的宽度。
- _original__init__(matrix, element_to_mobject=<class 'manim.mobject.text.numbers.DecimalNumber'>, element_to_mobject_config={'num_decimal_places': 1}, **kwargs)¶
将根据提供的配置对小数位数进行四舍五入/截断。