Mobjects representing matrices.
Examples
class MatrixExamples(Scene):
def construct(self):
m0 = Matrix([[2, 0], [-1, 1]])
m1 = Matrix([[1, 0], [0, 1]],
left_bracket="\\big(",
right_bracket="\\big)")
m2 = DecimalMatrix(
[[3.456, 2.122], [33.2244, 12.33]],
element_to_mobject_config={"num_decimal_places": 2},
left_bracket="\\{",
right_bracket="\\}")
self.add(m0.shift(LEFT - (3, 0, 0)))
self.add(m1)
self.add(m2.shift(RIGHT + (3, 0, 0)))
Classes
A mobject that displays a matrix with decimal entries on the screen. |
|
A mobject that displays a matrix with integer entries on the screen. |
|
A mobject that displays a matrix on the screen. |
|
A mobject that displays a matrix of mobject entries on the screen. |
Functions
get_det_text
(matrix, determinant=None, background_rect=False, initial_scale_factor=2)[source]¶Helper function to create determinant
matrix (Matrix
) – The matrix whose determinant is to be created
determinant (int|str
) – The value of the determinant of the matrix
background_rect (bool
) – The background rectangle
initial_scale_factor (float
) – The scale of the text det w.r.t the matrix
A VGroup containing the determinant
Examples
class DeterminantOfAMatrix(Scene):
def construct(self):
matrix = Matrix([
[2, 0],
[-1, 1]
])
# scaling down the `det` string
det = get_det_text(matrix,
determinant=3,
initial_scale_factor=1)
# must add the matrix
self.add(matrix)
self.add(det)