mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Merge branch 'master' of github.com:3b1b/manim
This commit is contained in:
commit
1a5a59f40e
2 changed files with 6 additions and 1 deletions
|
@ -636,6 +636,10 @@ class Arrow(Line):
|
|||
super().scale(length / self.get_length())
|
||||
|
||||
self.rotate(angle_of_vector(vect) - self.get_angle())
|
||||
self.rotate(
|
||||
PI / 2 - np.arccos(normalize(vect)[2]),
|
||||
axis=rotate_vector(self.get_unit_vector(), -PI / 2),
|
||||
)
|
||||
self.shift(start - self.get_start())
|
||||
self.refresh_triangulation()
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ class NumberLine(Line):
|
|||
super().__init__(self.x_min * RIGHT, self.x_max * RIGHT, **kwargs)
|
||||
if self.width:
|
||||
self.set_width(self.width)
|
||||
self.unit_size = self.get_unit_size()
|
||||
else:
|
||||
self.scale(self.unit_size)
|
||||
self.center()
|
||||
|
@ -123,7 +124,7 @@ class NumberLine(Line):
|
|||
return self.point_to_number(point)
|
||||
|
||||
def get_unit_size(self):
|
||||
return (self.x_max - self.x_min) / self.get_length()
|
||||
return self.get_length() / (self.x_max - self.x_min)
|
||||
|
||||
def get_number_mobject(self, x,
|
||||
number_config=None,
|
||||
|
|
Loading…
Add table
Reference in a new issue