Skip to content

Instantly share code, notes, and snippets.

@jaddoescad
Created March 10, 2019 23:12
Show Gist options
  • Save jaddoescad/56f4f6906dd633ce7caadb9aba1731f5 to your computer and use it in GitHub Desktop.
Save jaddoescad/56f4f6906dd633ce7caadb9aba1731f5 to your computer and use it in GitHub Desktop.
move word
class Move_word_from_one_sentence_to_the_other(Scene):
def construct(self):
kwargs = {
"tex_to_color_map": {
"circumference": RED,
}
}
question = TextMobject(
"""
\\small
Question \\#1: What is the circumference of\\\\
one of these rings (in terms of $R$ and $\\theta$)?\\\\
""",
**kwargs
)
prompt = TextMobject(
"""
Multiply this circumference by $R\\,d\\theta$ to \\\\
get an approximation of the ring's area.
""",
**kwargs
)
for words in question, prompt:
words.set_width(FRAME_WIDTH - 1)
self.play(FadeInFromDown(question))
self.wait(2)
for word in question, prompt:
word.circum = word.get_part_by_tex("circumference")
word.remove(word.circum)
self.play(
FadeOutAndShift(question, UP),
FadeInFromDown(prompt),
question.circum.replace, prompt.circum,
run_time=1.5
)
self.wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment