from manim import *
class VectorStyle(Scene):
    """3.3 Vector 的起点恒为坐标系原点，只需要给 direction（终点方向）。
    coordinate_label() 按方向自动生成列向量形式的坐标标签（Matrix）。
    """
    def construct(self):
        # Vector 继承 Arrow，但不需要 start；direction 就是终点
        vec_1 = Vector([1, 3], color=WHITE)
        vec_2 = Vector([-2, -2], color=WHITE)
        # color 直接决定坐标标签（Matrix）的颜色
        label_1 = vec_1.coordinate_label(color=BLUE)
        label_2 = vec_2.coordinate_label(color=YELLOW)
        label_1.next_to(vec_1.get_end(), RIGHT, buff=0.15)
        label_2.next_to(vec_2.get_end(), LEFT, buff=0.15)
        self.play(GrowArrow(vec_1), GrowArrow(vec_2), run_time=1.2)
        self.play(FadeIn(label_1), FadeIn(label_2), run_time=0.8)
        # 留住画面，方便与教程里的静态图对照
        self.wait(3.4)
