mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Update mobject.py
This commit is contained in:
parent
5c0a1e4b76
commit
e9470b6bde
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ import itertools as it
|
||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
import moderngl
|
import moderngl
|
||||||
|
import math
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -843,7 +844,7 @@ class Mobject(object):
|
||||||
angle_of_vector(target_vect) - angle_of_vector(curr_vect),
|
angle_of_vector(target_vect) - angle_of_vector(curr_vect),
|
||||||
)
|
)
|
||||||
self.rotate(
|
self.rotate(
|
||||||
math.atan2(target_vect[2], np.sqrt(target_vect[0]**2 + target_vect[1]**2)) - math.atan2(curr_vect[2], np.sqrt(curr_vect[0]**2 + curr_vect[1]**2)),
|
math.atan2(target_vect[2], get_norm(target_vect[:2])) - math.atan2(curr_vect[2], get_norm(curr_vect[:2])),
|
||||||
axis = np.array([-target_vect[1], target_vect[0], 0]),
|
axis = np.array([-target_vect[1], target_vect[0], 0]),
|
||||||
)
|
)
|
||||||
self.shift(start - self.get_start())
|
self.shift(start - self.get_start())
|
||||||
|
|
Loading…
Add table
Reference in a new issue