3b1b / 3b1b/manim

apply_matrix not working

Aperta
#1,440 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
93.8k
Fork
7.7k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Hi, i'm trying to apply a simple matrix to 2d vector. The code below draws a vector, but when it comes to
applying matrix i get the following error:

File "c:\users\professional\appdata\local\programs\python\python39\lib\site-packages\manimlib\utils\bezier.py", line 141, in get_smooth_quadratic_bezier_handle_points
last_str = smooth_to_left[0]
IndexError: index 0 is out of bounds for axis 0 with size 0

**Code**:

```
from manimlib.scene.vector_space_scene import *
from manimlib.mobject import *

import numpy as np

class LinearTransformation(LinearTransformationScene):
CONFIG = {
"show_basis_vectors": True,
"foreground_plane_kwargs": {
"x_max": 10,
"x_min": -10,
"y_max": 10,
"y_min": -10,
"faded_line_ratio": 0
},

}
def construct(self):
self.setup()
self.wait()

myVec = Vector([6,1])
myVec.set_color(ORANGE)
self.add_vector(myVec)
self.add_moving_mobject(myVec)


matrix = [[0, 1], [-1, 0]]

self.apply_matrix(matrix)

self.wait()
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.