Advertisement
NikaGreg

Untitled

Feb 4th, 2023
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. from manim import *
  2.  
  3. class TTP(ThreeDScene):
  4.     def construct(self):
  5.         self.set_camera_orientation(
  6.             phi = 75 * DEGREES,
  7.             theta = -70 * DEGREES
  8.         )
  9.         area = Polygon(
  10.             [-3.5, -3, -2],
  11.             [3.5, -3, -2],
  12.             [3.5, 3, -2],
  13.             [-3.5, 3, -2],
  14.             [-3.5, -3, -2]
  15.         ).set_stroke('#a473e3', 2).set_fill('#a473e3', 0.04)
  16.         A = np.array([-1.5, -1.5, -2])
  17.         N = np.array([1.5, 1.5, -2])
  18.         M = np.array([1.5, 1.5, 2])
  19.  
  20.         Line.set_default(stroke_width = 2.5, stroke_color = '#f29136')
  21.         AN = Line(A, N)
  22.         AM = Line(A, M)
  23.         MN = Line(M, N)
  24.  
  25.         labels = MathTex("l", "p", color = BLACK).scale(0.8)
  26.         labels[0].next_to(AM, UP, buff=0.5)
  27.         labels[1].next_to(AN, RIGHT, buff = 0.1)
  28.         self.add_fixed_orientation_mobjects(labels)
  29.  
  30.         self.add(area, AN, AM, MN, labels)
  31.         self.wait()
  32.         self.move_camera(
  33.             phi = 75 * DEGREES,
  34.             theta = -40 * DEGREES,
  35.             run_time = 3
  36.         )
  37.         self.wait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement