整数矩阵

限定名称: manim.mobject.matrix.IntegerMatrix

class IntegerMatrix(matrix, element_to_mobject=<class 'manim.mobject.text.numbers.Integer'>, **kwargs)[source]

基础:Matrix

一个在屏幕上显示带有整数条目的矩阵的mobject。

示例

示例:IntegerMatrixExample

../_images/IntegerMatrixExample-1.png
from manim import *

class IntegerMatrixExample(Scene):
    def construct(self):
        m0 = IntegerMatrix(
            [[3.7, 2], [42.2, 12]],
            left_bracket="(",
            right_bracket=")")
        self.add(m0)
class IntegerMatrixExample(Scene):
    def construct(self):
        m0 = IntegerMatrix(
            [[3.7, 2], [42.2, 12]],
            left_bracket="(",
            right_bracket=")")
        self.add(m0)

如果矩阵中有小数条目,将会进行四舍五入。

Parameters:
  • matrix (可迭代对象) – 一个numpy二维数组或列表的列表

  • element_to_mobject (Mobject) – 使用的Mobject,默认为Integer

方法

属性

animate

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

animation_overrides

color

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.Integer'>, **kwargs)

如果矩阵中有小数条目,将会进行四舍五入。

Parameters:
  • matrix (可迭代对象) – 一个numpy的二维数组或列表的列表

  • element_to_mobject (Mobject) – 使用的Mobject,默认为Integer