summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py
blob: 31b19909bcec8d10cb8b5dcc3f7850980c78bbe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from manimlib.imports import *

class Mobius(ThreeDScene):
	def construct(self):
		axes=ThreeDAxes()



		R=2.5


		mobius = ParametricSurface(
			lambda u, v: np.array([
				(R+u*np.cos(v/2))*np.cos(v),
				(R+u*np.cos(v/2))*np.sin( v),
				u*np.sin(v/2)
			]),
			 u_min = -0.5, u_max = 0.5, v_min = 0, v_max = 2*PI, 

			resolution=(6, 32)).fade(0.5) #Resolution of the surfaces
		circle=Circle(radius=2.5, color=BLUE)



		mobius.rotate(PI/2, axis=RIGHT)
		mobius.rotate(PI/2, axis=OUT)
		# # mobius.shift(RIGHT+OUT+DOWN)





		along = ParametricSurface(
			lambda u, v: np.array([
				(R+u*np.cos(v/2))*np.cos(v),
				(R+u*np.cos(v/2))*np.sin(v),
				0
			]),
			 u_min = -0.5, u_max = 0.5, v_min = 0, v_max = 2*PI, 

			resolution=(6, 32)).fade(0.5) #Resolution of the surfaces
		circle=Circle(radius=2.5, color=BLUE)


		

		


















		self.set_camera_orientation(phi=75 * DEGREES,theta=-75*DEGREES)
		
		self.play(Write(mobius))
	
		self.wait(1)
		self.begin_ambient_camera_rotation(rate=0.65)

		self.wait(10)
		self.stop_ambient_camera_rotation() 
		self.wait(1)