-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodviz.html
More file actions
171 lines (157 loc) · 5.2 KB
/
Copy pathmodviz.html
File metadata and controls
171 lines (157 loc) · 5.2 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Modular Visualizer - cubicinfinity.github.io</title>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="modviz_style.css" type="text/css" charset="utf-8"/>
<script src="modulus.js" type="text/javascript"></script>
</head>
<body>
<noscript> <b>Enable JavaScript to use this page.</b> </noscript>
<a href="index.html" class="margins"> <h2 class="back"> Return </h2> </a>
<p class="center">
This app calulates floating point division in any base and displays the
modulus pattern of remainders.<br/>
"R>" indicates the start of a repeating sequence of digits. <br/>
Choose higher contrast colors for large denominators. <br/>
You may send me created images to put in a gallery.
</p>
<a class="center" href="https://www.youtube.com/watch?v=nAX1Fr9RX9w">
Video Explanation
</a>
<div class="fields">
<div class="section" id="valueSettings">
<h4> Values </h4>
<div class="entry">
<label> Numerator <input type="number" id="numerator" /></label>
</div>
<div class="entry">
<label> Denominator <input type="number" id="denominator" /></label>
</div>
<div class="entry">
<label> Base of expression <input type="number" id="base" value=10 /></label>
</div>
<div class="entry">
<label>
<input type="checkbox" id="limitPrecision"
onclick="checkField('limitPrecision', 'precision');" checked />
Max precision
<input type="number" id="precision" value=50 />
</label>
</div>
<div class="entry">
<label><input type="checkbox" id="modBase10" checked /> Show remainders in base 10 </label>
</div>
<div class="entry">
<label><input type="checkbox" id="displayValues"
onclick="checkField('displayValues', 'alignValues');" checked /> Display values </label>
</div>
<div class="entry">
<label><input type="checkbox" id="alignValues" /> Align values </label>
</div>
<div class="entry">
<label>
<input type="checkbox" id="includePlot"
onclick="showHideElement('includePlot', 'plotSettings', true, showType = 'flex');
hidePlot('includePlot');" checked />
Generate graph
</label>
</div>
<button class="button" onclick="compute();"> Compute </button>
</div>
<div class="section" id="plotSettings">
<h4> Appearance </h4>
<div class="entry">
<label>
<input type="checkbox" id="showDigits"
onclick="checkField('showDigits', 'digitsColor');" checked />
Digit color
<input type="text" id="digitsColor" value="white" />
</label>
</div>
<div class="entry">
<label>
<input type="checkbox" id="enableBackground"
onclick="checkField('enableBackground', 'backgroundColor');" checked />
Background color
<input type="text" id="backgroundColor" value="#111" />
</label>
</div>
<div class="entry">
<label>
<input type="checkbox" id="enablePoints"
onclick="checkField('enablePoints', 'pointColor');" checked />
Point color
<input type="text" id="pointColor" value="#399" />
</label>
</div>
<div class="entry">
<label>
<input
type="checkbox"
id="enableLine1"
onclick="checkField('enableLine1', 'lineColor1');
checkField('enableLine1', 'enableGradient1');
checkField(['enableLine1', 'enableGradient1'], 'gradientColor1');"
checked />
Initial line color from
<input type="text" id="lineColor1" value="#1ee2" />
</label>
</div>
<div class="entry">
<label>
<input type="checkbox" id="enableGradient1"
onclick="checkField('enableGradient1', 'gradientColor1');" />
Initial line color to
<input type="text" id="gradientColor1" value="#90ca" disabled />
</label>
</div>
<div class="entry">
<label>
<input type="checkbox" id="enableLine2" checked disabled />
Repeating line color from
<input type="text" id="lineColor2" value="#60f" />
</label>
</div>
<div class="entry">
<label>
<input type="checkbox" id="enableGradient2"
onclick="checkField('enableGradient2', 'gradientColor2');" />
Repeating line color to
<input type="text" id="gradientColor2" value="#f06" disabled />
</label>
</div>
<div class="entry">
<label> Relative line thickness <input type="number" id="lineThickness" value=1.5 step="any"/></label>
</div>
<div class="entry">
<label> Resolution <input type="number" id="resolution" value=400 /></label>
</div>
<button class="button" onclick="draw();"> Update </button>
</div>
</div>
<p id="computeMessage" class="center"></p>
<div id="resultBars" style="display:block">
<div>
<h4> Quotient </h4>
<p id="quotientBar" class="bar"> Not computed </p>
</div>
<div>
<h4> Remainders </h4>
<p id="modulationBar" class="bar"> Not computed </p>
</div>
</div>
<div id="resultAligned" style="display:none">
</div>
<div>
<h5 id="debug"> </h5>
<p id="debugOutput"> </p>
</div>
<div class="center">
<canvas class="plot" id="plot" width="600" height="600"></canvas>
</div>
<footer>
<a href="index.html"> <h2 class="backcenter"> Return </h2> </a>
</footer>
</body>
</html>