Sideway
output.to from Sideway
Draft for Information Only

Content

Matrix
 Class Matrix
  Example
   Code
   Output
 Class DecimalMatrix(Matrix)
  Example
   Code
   Output
 Class IntegerMatrix(Matrix)
  Example
   Code
   Output
 Class MobjectMatrix(Matrix)
  Example
   Code
   Output

Matrix

The defined matrix VMobject in matrix.py
  • Class Matrix(VMobject)
  • Class DecimalMatrix(Matrix)
  • Class IntegerMatrix(Matrix)
  • Class MobjectMatrix(Matrix)

Class Matrix

Matrix(VMobject) is used to generate a matrix form of specified matrix for given parameters.

Example

Code

# folder/file: tut/manim_mobject_matrix_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.matrix import Matrix

class manim_mobject_matrix_001a(Scene): 
    def construct(self):
        num=Matrix(["1234555","1.0","0"])
        self.add(num.move_to([0,1,0]))
        self.wait(2)
        self.add(Matrix([(0,1,5),(3,4.5,5)]).move_to([3.5,3,0]))
        self.wait(2)
        self.add(Matrix([+1234555.2222222222,num],include_background_rectangle=True).move_to([0,0.8,0]))
        self.wait(2)
        self.add(Matrix(0).move_to([-5,1,0]))
        self.wait(2)

Output

image

Class DecimalMatrix(Matrix)

DecimalMatrix is used to generate a decimal matrix form of specified matrix for given parameters.

Example

Code

# folder/file: tut/manim_mobject_decimalmatrix_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.matrix import DecimalMatrix

class manim_mobject_decimalmatrix_001a(Scene): 
    def construct(self):
        num=DecimalMatrix([1234555,1.0,0])
        self.add(num.move_to([0,1,0]))
        self.wait(2)
        self.add(DecimalMatrix([(0,1,5),(3,4.5,5)]).move_to([3.5,3,0]))
        self.wait(2)
        self.add(DecimalMatrix([(+1234555.2222222222,0),(0,1)],element_to_mobject_config={"group_with_commas": False,
        "digit_to_digit_buff": 0.05},include_background_rectangle=True).move_to([0,-2,0]))
        self.wait(2)
        self.add(DecimalMatrix([(0,1),(1000,0)],element_to_mobject_config={"group_with_commas": True,
        "digit_to_digit_buff": 0.1}).move_to([-5,-2,0]))
        self.wait(2)

Output

image

Class IntegerMatrix(Matrix)

IntegerMatrix is used to generate a integer matrix form of specified matrix for given parameters.

Example

Code

# folder/file: tut/manim_mobject_integermatrix_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.matrix import IntegerMatrix

class manim_mobject_integermatrix_001a(Scene): 
    def construct(self):
        num=IntegerMatrix([1234555,1.0,0])
        self.add(num.move_to([0,1,0]))
        self.wait(2)
        self.add(IntegerMatrix([(0,1,5),(3,4.5,5)]).move_to([3.5,3,0]))
        self.wait(2)
        self.add(IntegerMatrix([(+1234555.2222222222,0),(0,1)],element_to_mobject_config={"group_with_commas": False,
        "digit_to_digit_buff": 0.05},include_background_rectangle=True).move_to([0,-2,0]))
        self.wait(2)
        self.add(IntegerMatrix([(0,1),(1000,0)],element_to_mobject_config={"group_with_commas": True,
        "digit_to_digit_buff": 0.1}).move_to([-5,-2,0]))
        self.wait(2)

Output

image

Class MobjectMatrix(Matrix)

MobjectMatrix is used to generate a mobject matrix form of specified matrix for given parameters.

Example

Code

# folder/file: tut/manim_mobject_mobjectmatrix_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.matrix import MobjectMatrix
from manimlib.mobject.matrix import Matrix

class manim_mobject_mobjectmatrix_001a(Scene): 
    def construct(self):
        matrix=Matrix([(0,1,5),(3,4.5,5),("a",4,6)])
        self.add(matrix.move_to([-5,2.5,0]))
        self.wait(2)
        matrix1=matrix.copy()
        self.add(matrix1.move_to([5,2.5,0]))
        self.wait(2)
        numa=MobjectMatrix([(matrix.mob_matrix[:,1]),(matrix.mob_matrix[:,0])])
        self.add(numa)
        self.wait(2)
        self.add(Matrix([(matrix.mob_matrix[:,1]),(matrix.mob_matrix[:,0])],h_buff=3).move_to([0,-3,0]))
        self.wait(2)

Output

image

©sideway

ID: 200500802 Last Updated: 5/8/2020 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Travel 4

Reference 79

Computer

Hardware 251

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 431

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019