from manim import *
class VectorAddDemo(VectorScene):
    def construct(self):
        title = Text("VectorScene：向量加法", font="STLiti", font_size=30).to_edge(UP)
        self.add(title)
        self.add_plane(animate=True, x_range=[-6, 6], y_range=[-6, 6], x_length=5, y_length=5)
        self.add_axes(animate=True)
        v1 = self.add_vector([-2, 1], color=BLUE, animate=True)
        v2 = self.add_vector([3, 2], color=YELLOW, animate=True)
        vr = self.add_vector([1, 3], color=GREEN, animate=True)
        self.label_vector(v1, "v1")
        self.label_vector(v2, "v2")
        self.label_vector(vr, "v1+v2")
        self.wait(1.6)
