from manim import *
import numpy as np
from numpy import array
run_time = 1
data = [[1, 2], [3, 4]]
def dot(pos, **kwargs):
    return Dot(pos, **kwargs)
class CameraSample2(ZoomedScene):
    def __init__(self, **kwargs):
        ZoomedScene.__init__(
            self,
            zoom_factor=3,
            zoomed_display_height=1,
            zoomed_display_width=2,
            image_frame_stroke_width=5,
            zoomed_camera_config={
                "default_frame_stroke_width": 3,
            },
            **kwargs
        )
    def construct(self):
        s = Square(color=RED, fill_opacity=0.5, side_length=1.5)
        t = Triangle(color=GREEN, fill_opacity=0.5).scale(0.5)
        vg = VGroup(s, t)
        vg.arrange(RIGHT, buff=SMALL_BUFF)
        self.play(*[FadeIn(_o) for _o in [vg]], run_time=1.0)
        self.activate_zooming(animate=False)
        self.play(s.animate.shift(LEFT), t.animate.shift(RIGHT))
        self.play(s.animate.rotate(2 * PI / 3), t.animate.rotate(PI / 2))
        self.play(s.animate.shift(RIGHT), t.animate.shift(LEFT))
        self.wait()
        self.wait(0.60)