Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Merzlikin-Matvey committed Aug 14, 2023
1 parent 2affdea commit cf436f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ManimExtra/animation/fancy_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ def Fancy_label(text: Tex, mode='normal'):
else:
symbols += len(text.get_tex_string().split('$')[i]) / 1.5

time = symbols / (modes.index(mode) + 5) + 0.15
time = symbols / (modes.index(mode) + 6) + 0.15

return AnimationGroup(Write(text.to_edge(UP).set_z_index(999)), run_time=time)
6 changes: 5 additions & 1 deletion ManimExtra/mobject/geometry/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def construct(self):
perpendicular_bisector,
rotate_vector,
)
from .line import Line



if TYPE_CHECKING:
from ManimExtra.mobject.mobject import Mobject
Expand Down Expand Up @@ -675,6 +676,9 @@ def __init__(
)





class AnnotationDot(Dot):
"""A dot with bigger radius and bold stroke to annotate scenes."""

Expand Down
9 changes: 6 additions & 3 deletions ManimExtra/mobject/geometry/intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@ def intersection_circles(circle_1: Circle, circle_2: Circle):
r1 = circle_1.radius
r2 = circle_2.radius
l = Line(o1,o2).get_length()
print(l,r1,r2)
if l > r1+r2:

if l > r1+r2+0.02:
raise Exception('Circles do not intersect')

x1 = Dot(Line(o1,o2).set_length_about_point(o1,r1).get_end())
x2 = x1.copy()

if abs(1 - (r2**2 - r1**2 - l**2)/(-2*r1*l)) < 0.001:
return [x1.get_center(), x2.get_center()]

alpha = np.arccos((r2**2 - r1**2 - l**2)/(-2*r1*l))
x1.rotate(about_point=o1, angle=alpha)
x2.rotate(about_point=o1, angle=-alpha)
print([x1.get_center(), x2.get_center()])

return [x1.get_center(), x2.get_center()]


Expand Down

0 comments on commit cf436f8

Please sign in to comment.