-
Notifications
You must be signed in to change notification settings - Fork 2
/
surface.html
988 lines (795 loc) · 39.7 KB
/
surface.html
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="assets/ico/favicon.ico">
<title>Torus Knot Fibration Visualization</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/font-awesome.min.css" rel="stylesheet">
<script src="assets/js/jquery.min.js"></script>
<!-- <script src="assets/js/modernizr.js"></script>-->
<!-- mathbox -->
<script src="./lib/mathbox/build/mathbox-bundle.js"></script>
<link rel="stylesheet" href="./lib/mathbox/build/mathbox.css">
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<!--math-->
<script src="./lib/math.min.js"></script>
<!--jquery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!--bootstrap-->
<link rel="stylesheet" src="./lib/bootstrap-3.3.7-dist/css/bootstrap.min.css">
<link rel="stylesheet" src="./lib/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css">
<script src="./lib/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<!--
bootstrap toggle
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
-->
<link href="./lib/switch/css/bootstrap3/bootstrap-switch.min.css" rel="stylesheet">
<script src="./lib/switch/js/bootstrap-switch.min.js"></script>
<!--bootstrap slider-->
<link href="./lib/slider/bootstrap-slider.min.css" rel="stylesheet">
<script src="./lib/slider/bootstrap-slider.min.js"></script>
<!-- my css -->
<link href="./lib/css/mystyle.css" rel="stylesheet">
<!-- mathjax-->
<script type="text/javascript" async src="assets/MathJax-2.6/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
</head>
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Torus Knot Fibration Visualization</a>
</div>
<div class="navbar-collapse collapse navbar-right">
<ul class="nav navbar-nav">
<li><a href="index.html">HOME</a></li>
<li><a href="torusknot.html">TORUS & KNOT</a></li>
<li><a href="boundary.html">BOUNDARY</a></li>
<li class="active"><a href="surface.html">SURFACE</a></li>
<li><a href="stereo.html">STEREOGRAPHIC</a></li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
<!-- *****************************************************************************************************************
BLUE WRAP
***************************************************************************************************************** -->
<div id="blue">
<div class="container">
<div class="row">
<h3>Fibration Surface</h3>
</div>
<!-- /row -->
</div>
<!-- /container -->
</div>
<!-- /blue -->
<!-- *****************************************************************************************************************
AGENCY ABOUT
***************************************************************************************************************** -->
<div class="container-fluid mtb">
<div class="row">
<div id="torusvis" class="torusvis col-lg-7">
<script type="text/javascript" language="javascript">
console.log($('.torusvis'));
$('.torusvis').css('height', 0.8 * $(window).height() + 'px');
</script>
<script>
var mathbox = mathBox({
plugins: ['core', 'controls', 'cursor'],
controls: {
// Orbit controls, i.e. Euler angles, with gimbal lock
klass: THREE.OrbitControls,
parameters: {
noZoom: true
},
// Trackball controls, i.e. Free quaternion rotation
//klass: THREE.TrackballControls,
},
element: document.getElementById("torusvis"),
mathbox: {
warmup: 1
}
});
if (mathbox.fallback) throw "WebGL not supported"
var three = mathbox.three;
three.renderer.setClearColor(new THREE.Color('#f8f8f8'), 1.0);
var time = three.Time.clock;
// Place camera
var camera =
mathbox
.camera({
proxy: true,
position: [0, 0, 3],
lookAt: [0, 0, 0]
});
// 2D cartesian
var view =
mathbox
.cartesian({
id:'cartesian',
position: [0, 0, 0.33],
range: [
[-math.pi, math.pi],
[-math.pi, math.pi],
[-math.pi, math.pi]
],
scale: [1, 1, 1],
});
var alpha = 2;
//Quality of Life
var pi = math.pi;
var sin = math.sin;
var cos = math.cos;
function torus(x, y) {
R = 2;
r = pi / 4;
var a = Number($('#slidera').val())
var b = Number($('#sliderb').val())
// return [(R-r*cos(x*b))*((1-a)*y+sin(a*y)),(R-r*cos(b*x))*-cos(a*y),(1-b)*x + r*sin(b*x)]
return [
(R - r * ((1 - a) + a * cos(x * b))) * ((1 - a) * y + sin(a * y)), (1 - b) * x + r * sin(b * x), (R - r * cos(b * x)) * -cos(a * y)
]
}
view.area({
id: 'densearea',
width: 100,
height: 100,
// axes: [1, 3],
expr: function(emit, x, y, i, j, time) {
emit(...torus(x, y));
},
items: 1,
channels: 3,
});
view.surface({
shaded: false,
color: '#0FBFCF',
opacity: 0.0,
});
view.area({
id: 'sparsearea',
width: 64,
height: 10,
// axes: [1, 3],
expr: function(emit, x, y, i, j, time) {
emit(...torus(x, y));
emit(...torus(y, x));
},
items: 2,
channels: 3,
});
view.resample({
id: 'sparsesample',
source: mathbox.select('#sparsearea')[0],
width: 64,
height: 10
})
view.line({
id: 'torusmesh',
points: mathbox.select('#sparsesample')[0],
color: '#6a9fb5',
zBias: 1,
opacity: 0.4,
visible: true,
})
// //Edges of Torus
// view.interval({
// id: 'redline',
// width: 64,
// expr: function(emit, x, i, time) {
// emit(...torus(x, -pi));
// emit(...torus(x, pi));
// },
// items: 2,
// channels: 3,
// })
//
// view.line({
// points: mathbox.select('#redline')[1],
// color: '#FF4136',
// zBias: 12
// })
//
//
// view.interval({
// id: 'yellowline',
// width: 64,
// expr: function(emit, y, i, time) {
// emit(...torus(-pi, y));
// emit(...torus(pi, y));
// },
// items: 2,
// channels: 3,
// })
//
// view.line({
// points: mathbox.select('#yellowline')[1],
// color: '#FFDC00',
// zBias: 13
// })
// Torus Knot Parameters
var p = 3;
var q = 2;
var m = p / q;
var m2 = q / p;
var eps = 0.01;
//Global Animation Time
var tau_last = 0;
function mod2pi(x) {
return (x % (2 * pi) + 2 * pi) % (2 * pi)
}
// Knot Curve
function knot(x) {
return (m2 * x) % (2 * pi);
}
view.interval({
range: [0, 2 * p * pi],
expr: function(emit, x, i, t) {
//-(pi,pi,0) needed for new bounds
emit(...torus(x % (2 * pi) - pi, knot(x) - pi));
},
width: 200,
channels: 3,
});
view.line({
id: 'knotcurve',
color: '#2ECC40',
visible: true,
proximity: 1,
blending: 'no',
zBias: 14
})
// // Knot Traveller
//
// function sphere(r, th, ph, x, y, z) {
// return [r * cos(th) * sin(ph) + x, r * sin(th) * sin(ph) + y, r * cos(ph) + z]
// }
// view.area({
// id: 'spherearea',
// width: 100,
// height: 100,
// // axes: [1, 3],
// expr: function(emit, x, y, i, j, time) {
// var t = time
// var [X, Y, Z] = torus(t % (2 * pi) - pi, knot(t) - pi);
// emit(...sphere(0.1, x, y, X, Y, Z));
//
// },
// items: 1,
// channels: 3,
//
// });
//
// view.surface({
// id: 'knottraveller',
// shaded: false,
// color: 'green'
//
// });
//Piecewise Stuff
// //First Piecewise Curve
// function piecewise(x, n) {
// //Triangle Wave Function to match knot + rungs!
// x = x % (2 * pi);
// var period = (pi) / q;
// var amplitude = pi / (2 * p);
// var wave = ((2 * amplitude) / pi) * math.asin(sin(x * pi / period)) + 2 * pi * n / p
//
// return mod2pi(wave)
// }
//
function modpi(x) {
//Function for Modular Arithmetic on [-pi,pi]
return ((x + 2 * pi) % (2 * pi) - pi)
}
function linecut(x) {
var X = x
var thresh = 0.02;
if (Math.abs(pi) - X < thresh) {
X = NaN
}
return X
}
function fakemodpi(x) {
var tpi = 2 * pi;
var X = x;
//To stop edge errors:
while (Math.abs(X) > pi) {
if (X <= -pi) {
X = X + 2 * pi
} else if (X >= -pi + tpi) {
X = X - tpi
}
}
return linecut(X)
}
function truemodpi(x) {
return (x + pi) % (2 * pi) - pi
}
console.log(fakemodpi(0))
console.log(fakemodpi(pi + 0.1))
//((2*amplitude)/pi)*math.asin(sin((x+t/q)*pi/period))+2*pi*n/p-(1/p)*t
//First Piecewise Curve
function piecewise(x, n) {
//Triangle Wave Function to match knot + rungs!
x = x % (2 * pi);
var t = Number($('#slidertime').val());
var period = (pi) / q;
var amplitude = pi / (2 * p);
var wave = ((2 * amplitude) / pi) * math.asin(sin((x + t / q) * pi / period)) + 2 * pi * n / p - (t / p)
return fakemodpi(wave - pi / p)
}
view.interval({
range: [0, 4 * pi],
expr: function(emit, x, i, t) {
//(0,-pi,0) shift to match new domains
emit(...torus(fakemodpi(x) + eps, linecut(piecewise(x, 0))));
emit(...torus(fakemodpi(x) + eps, linecut(piecewise(x, 1))));
emit(...torus(fakemodpi(x) + eps, linecut(piecewise(x, 2))));
},
width: 1000,
channels: 3,
items: 3
});
view.line({
id: 'blueboundary',
color: '#49a7e9',
visible: false,
zBias: 15,
proximity: 0.5
});
//Second Piecewise Curve
function piecewise2(x, n) {
x = x % (2 * pi);
var t = Number($('#slidertime').val());
var period = (pi) / p;
var amplitude = pi / (2 * q);
var wave = ((2 * amplitude) / pi) * math.asin(sin((x - t / p) * pi / period)) - 2 * pi * n / q
// var wave = ((2 * amplitude) / pi) * math.asin(sin((x+ t / q) * pi / period)) + 2 * pi * n / p - (t / p)
return fakemodpi(-(wave - pi / q + (1 / q) * t))
}
view.interval({
expr: function(emit, x, i, t) {
emit(...torus(linecut(piecewise2(x, 0) - eps), -fakemodpi(x)));
emit(...torus(linecut(piecewise2(x, 1) - eps), -fakemodpi(x)));
},
width: 600,
channels: 3,
items: 2
});
view.line({
id: 'redboundary',
color: '#fab125',
proximity: 1,
visible: false,
zBias: 15
});
function SurfaceCut(x) {
var thresh = 0.15;
if (x <= -pi - thresh) {
x = -NaN;
} else if (x >= pi + thresh) {
x = NaN;
}
return x
}
function threetorus(x, y, z) {
R = 2;
r = pi / 4;
var a = Number($('#slidera').val())
var b = Number($('#sliderb').val())
// // return [
// (R - r * ((1 - a) + a * cos(x * b))) * ((1 - a) * y + sin(a * y)),
//(1 - b) * x + r * sin(b * x), (R - r * cos(b * x)) * -cos(a * y) + 1
// ]
return [
(R - (r - a * z) * ((1 - a) + a * cos(x * b))) * ((1 - a) * y + sin(a * y)), (1 - b) * x + (r - z) * sin(b * x), (R - (r - z) * cos(b * x)) * -cos(a * y)
]
}
//First Piecewise Surface
function piecewise(x, y, t, n) {
x = x % (2 * pi);
var period = (pi) / q;
var amplitude = pi / (2 * p);
var wave = Math.pow(math.abs(4 / pi * (pi / 4 - y)), 4) * ((2 * amplitude) / pi) * math.asin(sin((x + t / q) * pi / period)) + 2 * pi * n / p - (1 / p) * t
return SurfaceCut(wave - pi / p)
}
var edgethresh = 0.5;
view.area({
expr: function(emit, x, y, i, j, t) {
if ($('#timetoggle').prop('checked') == true) {
var tau = t % (2 * pi);
tau_last = tau
} else {
// var tau = Number($('#slidertime').val());
var tau = tau_last;
}
var xdom = SurfaceCut(x);
emit(...threetorus(xdom, piecewise(x, y, tau, -1), y));
emit(...threetorus(xdom, piecewise(x, y, tau, 0), y));
emit(...threetorus(xdom, piecewise(x, y, tau, 1), y));
emit(...threetorus(xdom, piecewise(x, y, tau, 2), y));
emit(...threetorus(xdom, piecewise(x, y, tau, 3), y));
// emit(xdom, piecewise(x, tau, 0), -y);
// emit(xdom, piecewise(x, tau, 1), -y);
// emit(xdom, piecewise(x, tau, 2), -y);
},
rangeX: [-pi - edgethresh, pi + edgethresh],
rangeY: [0, pi / 4],
width: 80,
height: 20,
channels: 3,
items: 5,
centeredX: false,
centeredY: false
});
view.surface({
id: 'bluesurface',
color: '#49a7e9',
proximity: 0.001,
shaded: false,
crossed: false,
zBias: 9,
visible: true,
});
view.line({
id: 'bluemesh',
color: '#001f3f',
zBias: 10,
opacity: 0.2,
visible: true,
})
// var wave = ((2 * amplitude) / pi) * math.asin(sin((x - t / p) * pi / period)) - 2 * pi * n / q
// // var wave = ((2 * amplitude) / pi) * math.asin(sin((x+ t / q) * pi / period)) + 2 * pi * n / p - (t / p)
//
// return fakemodpi(-(wave - pi / q + (1 / q) * t))
//Second Piecewise Surface
function piecewise2(x, y, t, n) {
x = x % (2 * pi);
var period = (pi) / p;
var amplitude = pi / (2 * q);
var wave = Math.pow(math.abs(4 / pi * (pi / 4 - y)), 4) * ((2 * amplitude) / pi) * math.asin(sin((x + t / p - pi / p) * pi / period)) - 2 * pi * n / q
return SurfaceCut(-(wave - pi / q + (1 / q) * t))
}
var edgethresh = 0.5;
view.area({
expr: function(emit, x, y, i, j, t) {
if ($('#timetoggle').prop('checked') == true) {
var tau = t % (2 * pi);
} else {
// var tau = Number($('#slidertime').val());
var tau = tau_last;
}
var xdom = SurfaceCut(x);
// emit(...threetorus(xdom, piecewise2(x, y, tau, -1), y));
emit(...threetorus(piecewise2(x, y, tau, -1), xdom, -y));
emit(...threetorus(piecewise2(x, y, tau, 0), xdom, -y));
emit(...threetorus(piecewise2(x, y, tau, 1), xdom, -y));
// emit(...threetorus(piecewise2(x, y, tau, ),xdom, -y));
// emit(...threetorus(xdom, piecewise2(x, y, tau, 1), y));
// emit(...threetorus(xdom, piecewise2(x, y, tau, 2), y));
// emit(...threetorus(xdom, piecewise2(x, y, tau, 3), y));
// // emit(xdom, piecewise(x, tau, 0), -y);
// emit(xdom, piecewise(x, tau, 1), -y);
// emit(xdom, piecewise(x, tau, 2), -y);
},
rangeX: [-pi - edgethresh, pi + edgethresh],
rangeY: [0, pi / 4 + 0.4],
width: 80,
height: 20,
channels: 3,
items: 3,
centeredX: false,
centeredY: false
});
view.surface({
id: 'redsurface',
color: '#fab125',
proximity: 0.001,
shaded: false,
crossed: false,
zBias: 10,
visible: true,
});
view.line({
id: 'redmesh',
color: '#FF4136',
zBias: 10,
opacity: 0.4,
visible: true,
})
mathbox.set('focus', 2);
</script>
</div>
<div class="col-lg-4">
<table class="panel" style="margin-left: auto;
margin-right: auto; width:80%">
<tr>
<th class="labels">
<label class="sliderlabel">Torus Mesh</label>
</th>
<th>
<input id="meshtoggle" type="checkbox" checked data-toggle="toggle" value="1.0" onchange="meshtogfun(this);" data-onstyle="primary">
</th>
</tr>
<tr>
<th class="labels">
<label class="sliderlabel">
Glue Latitudinal Edge
</label>
</th>
<th>
<input id="slidera" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="1" data-slider-step="0.01" data-slider-value="1.0" data-slider-tooltip='hide' />
</th>
</tr>
<tr>
<th class="labels">
<label class="sliderlabel">
Glue Longitudinal Edge
</label>
</th>
<th>
<input id="sliderb" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="1" data-slider-step="0.01" data-slider-value="0.0" data-slider-tooltip='hide' />
</th>
</tr>
<!--Knot Curve Toggle-->
<tr>
<th class="labels" style="color:#0fbfcf">
<label class="sliderlabel">
<mark style="color:#2ECC40">Knot Curve</mark>
</label>
</th>
<th>
<input id="knottoggle" type="checkbox" checked data-toggle="toggle" value="1.0" onchange="togfun(this);" data-onstyle="primary">
</th>
</tr>
<!--Blue Piecewise Toggle-->
<tr>
<th class="labels" style="color:#0fbfcf">
<label class="sliderlabel">
<mark style="color:#49a7e9">Inside Surface</mark>
</label>
</th>
<th>
<input id="bluetoggle" type="checkbox" checked data-toggle="toggle" value="1.0" onchange="bluetogfun(this);" data-onstyle="primary">
</th>
</tr>
<!--Red Piecewise Toggle-->
<tr>
<th class="labels" style="color:#0fbfcf">
<label class="sliderlabel">
<mark style="color:#fab125">Outside Surface</mark>
</label>
</th>
<th>
<input id="redtoggle" type="checkbox" checked data-toggle="toggle" value="1.0" onchange="redtogfun(this);" data-onstyle="primary">
</th>
</tr>
<!--Time Animate Toggle-->
<tr>
<th class="labels">
<label class="sliderlabel">
Animate \(\theta\)
</label>
</th>
<th>
<input id="timetoggle" type="checkbox" checked data-toggle="toggle" value="1.0" onchange="timetogfun(this);" data-onstyle="primary">
</th>
</tr>
<!--
Time Slider
<th class="labels">
<label class="sliderlabel">
\(\theta\)
</label>
</th>
<th>
<input id="slidertime" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="6.28" data-slider-step="0.01" data-slider-value="3.14" data-slider-tooltip='hide' />
</th>
-->
</table>
<script>
//Slider Script
$('#slidera').slider({
formatter: function(value) {
return 'Current value: ' + value;
}
});
$('#sliderb').slider({
formatter: function(value) {
return 'Current value: ' + value;
}
});
$('#slidertime').slider({
formatter: function(value) {
return 'Current value: ' + value;
}
});
$('#slidera').on('slide', positionchanger)
function positionchanger() {
var Z = Number($('#slidera').val());
// console.log(Z)
mathbox.select('#cartesian')[0].set('position', [0, 0, 0.33 -0.33 * Z])
// console.log(mathbox.select('#cartesian')[0].get('position'))
}
// function slidefunction() {
//
// var sliderval = Number($('#slider').val());
//
// mathbox.select('surface').set('opacity', sliderval);
// console.log(typeof sliderval)
// }
//Button SCript
//MeshToggle
$('#meshtoggle').bootstrapSwitch({
size: 'small',
offColor: 'custom', onColor:'custom'
});
function meshtogfun(button) {
var butprop = $('#meshtoggle').prop('checked');
var butval = $('#meshtoggle').val();
if (butprop == true) {
$('#meshtoggle').val(1.0);
mathbox.select('#torusmesh')[0].set('visible', true)
} else {
$('#meshtoggle').val();
mathbox.select('#torusmesh')[0].set('visible', false)
}
}
//BlueToggle
$('#bluetoggle').bootstrapSwitch({
size: 'small',
offColor: 'custom', onColor:'custom'
});
function bluetogfun(button) {
var butprop = $('#bluetoggle').prop('checked');
var butval = $('#bluetoggle').val();
if (butprop == true) {
$('#bluetoggle').val(1.0);
mathbox.select('#bluesurface')[0].set('visible', true)
mathbox.select('#bluemesh')[0].set('visible', true)
} else {
$('#bluetoggle').val();
mathbox.select('#bluesurface')[0].set('visible', false)
mathbox.select('#bluemesh')[0].set('visible', false)
}
}
//RedToggle
$('#redtoggle').bootstrapSwitch({
size: 'small',
offColor: 'custom', onColor:'custom'
});
function redtogfun(button) {
var butprop = $('#redtoggle').prop('checked');
var butval = $('#redtoggle').val();
if (butprop == true) {
$('#redtoggle').val(1.0);
mathbox.select('#redsurface')[0].set('visible', true)
mathbox.select('#redmesh')[0].set('visible', true)
} else {
$('#redtoggle').val();
mathbox.select('#redsurface')[0].set('visible', false)
mathbox.select('#redmesh')[0].set('visible', false)
}
}
//timeToggle
$('#timetoggle').bootstrapSwitch({
size: 'small',
offColor: 'custom', onColor:'custom'
});
function timetogfun(button) {
var butprop = $('#timetoggle').prop('checked');
var butval = $('#timetoggle').val();
if (butprop == true) {
$('#timetoggle').val(1.0);
$('#slidertime').slider("disable")
} else {
$('#timetoggle').val();
$('#slidertime').slider("enable")
}
}
//KnotToggle
$('#knottoggle').bootstrapSwitch({
size: 'small',
offColor: 'custom', onColor:'custom'
});
function togfun(button) {
var butprop = $('#knottoggle').prop('checked');
var butval = $('#knottoggle').val();
if (butprop == true) {
$('#knottoggle').val(1.0);
mathbox.select('#knotcurve')[0].set('visible', true)
} else {
$('#knottoggle').val();
mathbox.select('#knotcurve')[0].set('visible', false)
}
}
</script>
<h3>Constructing the Fibration Surface</h3>
<p class="blurb">
Now we see our <mark style="color:#0074D9">inside</mark> and <mark style="color:#FF851B">outside</mark> surfaces whose boundaries on the torus are exactly the boundary curves found previously. </p>
<p class="blurb"> When the torus is unwrapped as a square these surfaces look like curtains <mark style="color:#0074D9">below</mark> and <mark style="color:#FF851B">above</mark> the plane. By transforming the square to torus with the gluing operation as before, we see begin to see our fibration subsurfaces.
</p>
<p class="blurb"> Note that the <torus>rungs</torus> from the previous visualization correspond exactly to where <mark style="color:#0074D9">inside</mark> and <mark style="color:#FF851B">outside</mark> subsurfaces meet, and thus is not a boundary of their union.
</p>
<p class="blurb">
This visualization gives good intuition for how the complete fibration surface is constructed from the subsurfaces. However, it is flawed because there appears to be a circular boundary on the <mark style="color:#FF851B">outside</mark> subsurfaces as they 'tear apart'. These circular boundaries must also be glued closed so that the only boundary for our complete fibration surface is the <knot>trefoil knot</knot>.
</p>
<!-- <p>As naming suggests, the boundary curves we previously defined are actually boundaries to surfaces above and below our plane.</p>-->
<!--
<p>We can wrap these surfaces <mark style="color:#0074D9">inside</mark> and <mark style="color:#FF851B">outside</mark> the torus by our gluing transformations as before.</p>
<p>Notice that our rungs occur where the two surfaces join, and therefore are not actual boundaries to our fibration surface, which must be exactly the trefoil.</p>
<p>However, there appears to be a circular boundary on the outside surface away from the torus. To remove this as a boundary we identify these points, which we can visualize with stereographic projection.</p>
-->
<nav aria-label="...">
<ul class="pager">
<li><a href="boundary.html">Previous</a></li>
<li><a href="stereo.html">Next</a></li>
</ul>
</nav>
</div>
</div>
<! --/row -->
</div>
<! --/container -->
<!-- *****************************************************************************************************************
FOOTER
***************************************************************************************************************** -->
<div id="footerwrap">
<div class="container">
<div class="row">
<div class="col-lg-4">
<h4>About Project</h4>
<div class="hline-w"></div>
<p>This is my final deliverable for the summer research component of a Master's in Mathematics at the University of Toronto supervised by Dr. Dror Bar-Natan. </p>
</div>
<div class="col-lg-4">
<h4>Project Repository</h4>
<div class="hline-w"></div>
<p style="text-align:center;">
<a href="http://www.github.com/jessebett/TorusKnotFibration"><i class="fa fa-github" style="font-size: 80px;"></i></a>
</p>
</div>
<div class="col-lg-4">
<h4>About Me</h4>
<div class="hline-w"></div>
<p>
My name is Jesse Bettencourt and I've recently acquired an M.Sc. in Mathematics from U of T. I'm interested in vizualizations from the intersection of math and computer science.
</p>
</div>
</div>
<! --/row -->
</div>
<! --/container -->
</div>
<! --/footerwrap -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- <script src="assets/js/bootstrap.min.js"></script>-->
<script src="assets/js/retina-1.1.0.js"></script>
<script src="assets/js/jquery.hoverdir.js"></script>
<script src="assets/js/jquery.hoverex.min.js"></script>
<script src="assets/js/jquery.prettyPhoto.js"></script>
<script src="assets/js/jquery.isotope.min.js"></script>
<script src="assets/js/custom.js"></script>
</body>
</html>