Beginning related rates example in eoc5

This commit is contained in:
Grant Sanderson
2017-03-09 15:50:40 -08:00
parent 5b08973b37
commit 311a22048b
4 changed files with 403 additions and 33 deletions

View File

@ -171,7 +171,7 @@ class Brace(TexMobject):
mob.rotate(angle)
def put_at_tip(self, mob, **kwargs):
mob.next_to(self, self.direction, **kwargs)
mob.next_to(self.get_tip(), self.get_direction(), **kwargs)
return self
def get_text(self, *text, **kwargs):
@ -179,6 +179,17 @@ class Brace(TexMobject):
self.put_at_tip(text_mob, **kwargs)
return text_mob
def get_tip(self):
# Very specific to the LaTeX representation
# of a brace, but it's the only way I can think
# of to get the tip regardless of orientation.
return self.submobjects[2].get_anchors()[7]
def get_direction(self):
vect = self.get_tip() - self.get_center()
return vect/np.linalg.norm(vect)
def tex_hash(expression, template_tex_file):