-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtravel_along_mobius.nb
75 lines (58 loc) · 2.47 KB
/
travel_along_mobius.nb
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
x[u_, v_] := (1 + (v/2) Cos[u/2]) Cos[u]
y[u_, v_] := (1 + (v/2) Cos[u/2]) Sin[u]
z[u_, v_] := (v/2) Sin[u/2]
r[u_, v_] := {x[u, v], y[u, v], z[u, v]}
normalVecTube[f_, {u_, u0_}, {v_, v0_}] :=
Block[{f0, g0}, f0 = f /. {u -> u0, v -> v0};
g0 = Transpose[D[f, {{u, v}}] /. {u -> u0, v -> v0}];
Arrow[Tube[{f0, f0 + Normalize[Cross @@ g0]}, .02]]]
normVertVec[f_, {u_, u0_}, {v_, v0_}] :=
Block[{f0, g0}, f0 = f /. {u -> u0, v -> v0};
g0 = Transpose[D[f, {{u, v}}] /. {u -> u0, v -> v0}];
.3 Normalize[Cross @@ g0]];
normVec[f_, {u_, u0_}, {v_, v0_}] :=
Block[{f0, g0}, f0 = f /. {u -> u0, v -> v0};
g0 = Transpose[D[f, {{u, v}}] /. {u -> u0, v -> v0}];
f0 + .3 Normalize[Cross @@ g0]];
tanVec[u_,
v_] := (r[U, V] + .2 (D[r[U, 0], U])/Norm[(D[r[U, 0], U])] /. {U ->
u, V -> v} );
tanArrowArg[u_, v_,
scale_: .2] := {r[U, V],
r[U, V] + scale (D[r[U, 0], U])/Norm[(D[r[U, 0], U])]} /. {U ->
u, V -> v} // N ;
perpVecTube[u_] := Arrow[Tube[{ r[u, 0] , r[u, .5] }]]
Clear[surfacePlot];
surfacePlot[r_, color_: Green, opacity_: .9,
pltRange_: 1.8*{{-1, 1.2}, {-1.2, 1}, {-1, 1}},
boundaryStyle_: {Transparent}] :=
ParametricPlot3D[r @@ {u, v}, {u, 0, 2 Pi}, {v, -1, 1},
Boxed -> False, Axes -> False,
PlotStyle -> {color, Opacity[opacity]}, PlotPoints -> 50,
Background -> Black, PlotRange -> pltRange, AspectRatio -> 1,
SphericalRegion -> True, ImageSize -> 4 {150, 100}
, BoundaryStyle -> boundaryStyle, Mesh -> None]
Clear[plo]
plo = Table[Show[
surfacePlot[r],
Graphics3D[{Transparent, Opacity[0],
normalVecTube[r[u, v], {u, t }, {v, 0}] }],
Graphics3D[{Arrowheads[.02], Opacity[1], Green, Thickness[.01],
perpVecTube[t]}],
Graphics3D[{Thickness[.01], Arrowheads[.03], Green,
Arrow[Tube[tanArrowArg[t, 0, .3]]]}] ,
Graphics3D[{Red, PointSize[.1], Point[r[0, 1.1]]}],
Graphics3D[{Lighter[Blue, .5], PointSize[.1],
Point[r[0, -1.1]]}],
ViewVector -> {normVec[r[u, v], {u, t}, {v, 0}] , tanVec[t, 0]},
ViewVertical -> normalVecViewing[r[u, v], {u, t}, {v, 0}],
ViewAngle -> \[Pi]/1.5,
Epilog -> {Text[
Framed[Style[
"\[Theta] = 2\[Pi] \[Cross] " <>
ToString[NumberForm[N[t/(2 \[Pi])], {3, 2}]], 14, White,
FontFamily -> "Georgia"],
Background -> Opacity[.5, Gray]], {-.1, .95}] ,
Text[Style["@InertialObservr", 12, White,
FontFamily -> "Georgia" ], {1.1, .05}] }
], {t, 0, 4 \[Pi], 4 \[Pi]}];