I'm fairly new to manim
I want to be able to draw a line graph and after the line has drawn, rotate it around its intercept. But right now, the transform is not happening: my code just shows the same unchanging line of graph0 and does not do the ReplacementTransform.
I have also tried pivot, which works, but pivots the line around its centre and even if I could get it to pivot around its intercept, I am not sure how to get it to the exact equation I want for each pivot.
Is there a way to make this line pivot to the different equations I have specified with graph0, graph1, and graph2?
Here's my code
class LinePivot(GraphScene):
CONFIG = {
"y_max": 40,
"y_min": 0,
"x_max": 14,
"x_min": 0,
"y_tick_frequency": 5,
"x_tick_frequency": 1,
"axes_color": BLACK,
"y_label_direction": LEFT,
"x_label_direction": DOWN,
"label_nums_color": BLACK,
"camera_config": {
"background_color": WHITE,
},
}
def construct(self):
self.setup_axes()
graph0 = self.get_graph(lambda x: 5 + 2 * x, color=BLACK)
graph1 = self.get_graph(lambda x: 5 + 3 * x, color=BLACK)
graph2 = self.get_graph(lambda x: 5 + 4 * x, color=BLACK)
self.play(ShowCreation(graph0))
self.wait()
ReplacementTransform(graph0, graph1, run_time=1)
self.wait()
ReplacementTransform(graph1, graph2, run_time=1)
self.wait()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…