-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoth.html
311 lines (249 loc) · 8.74 KB
/
coth.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--
EVERYTHING IS PHYSICAL
EVERYTHING IS FRACTAL
EVERYTHING IS RECURSIVE
NO MONEY
MO MINING
NO PROPERTY
LOOK AT THE INSECTS
LOOK AT THE FUNGI
LANGUAGE IS HOW THE MIND PARSES REALITY
-->
<title>QUANTUM NOISE CURVE</title>
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAZ4efAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEREREREREREREREREREREREAAAAAAAAREQEREREREBERAREREREQEREBEAAAARAREQEQEREBEBERARAQAQEQEREBEBABARAREQEQEREBEBERARAAAAEQEREBERERERAREQEREREREBERAAAAAAAAEREREREREREREREREREREREAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" rel="icon" type="image/x-icon">
<!--Stop Google:-->
<META NAME="robots" CONTENT="noindex,nofollow">
<!--geometron javascript library-->
<script src="https://cdn.jsdelivr.net/npm/p5@1.7.0/lib/p5.js"></script>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/addons/p5.sound.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
processEscapes: true,
processClass: "mathjax",
ignoreClass: "no-mathjax"
}
});// MathJax.Hub.Typeset();//tell Mathjax to update the math
</script>
</head>
<body>
<div id = "feedscroll">
<h1><a style = "color:blue;text-align:center;font-family:Comic Sans MS;margin:auto" href = "index.html">HOME</a></h1>
<p>
this page doesn't work on mobile. hit the letter "s" to post a square to the feed. move pointer around on square to change the paramters of the curve.
</p>
<p>
$$
\left(\frac{v+f}{2}\right)\coth{\left(\frac{v+f}{2T}\right)} + \left(\frac{v-f}{2}\right)\coth{\left(\frac{v-f}{2T}\right)}
$$
</p>
</div>
<script>
let G = 200;// gain in px per kelvin
let T = 0.2;//temperature in kelvin
let f = 0.25;// frequency in kelvin (hf/k_B)
let margin = 10;//margin in px
let vmax = 2.0;
let x_ellipse = 0;
let y_ellipse = 0;
let v_ellipse = 0;
let size_ellipse = 25;
let omega = 2*3.14*0.5;// 2 PI frequency of animation motion
let time = 0;
let framespersecond = 30;
if(innerWidth > innerHeight){
squaresize = innerHeight - 50;
document.getElementById("feedscroll").style.right = squaresize.toString()+ "px";
}
else{
squaresize = innerWidth - 50;
document.getElementById("feedscroll").style.right = "0px";
document.getElementById("feedscroll").style.top = squaresize.toString() + "px";
}
function setup() {
createCanvas(squaresize, squaresize);
strokeWeight(2);
background(159,135,103);
}
function draw(){
frameRate(30);
T = pow(10,(2*mouseX/width)-2);
f = pow(10,(2*mouseY/height)-2);
// background(220);
background(159,135,103);
translate(width/2, 0.5*(height - margin));
noFill();
// plot hyperbolic tangent functions
strokeWeight(8);
beginShape();
for (let v = -vmax; v <= vmax; v += 0.01) {
let p = -(0.5*T*(v+f)/(2*T))/Math.tanh((v+f)/(2*T)) -(0.5*T*(v-f)/(2*T))/Math.tanh((v-f)/(2*T));
vertex(v * G, 2*p * G);
}
endShape();
}
function post(){
png64 = document.getElementById("defaultCanvas0").toDataURL("image/png");
var timestamp = Math.round((new Date().getTime())/1000).toString();
var httpc = new XMLHttpRequest();
var url = "pngsave.php";
httpc.open("POST", url, true);
httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
httpc.send("data="+encodeURIComponent(png64.substring(22))+"&filename=trashmagic/square" + timestamp + "-coth.png");//send text to filesaver.php
//location.reload();
newfilename = "trashmagic/square" + timestamp + "-coth.png";
var newbox = document.createElement("DIV");
newbox.classList.add("imagebox");
var deletespan = document.createElement("SPAN");
deletespan.innerHTML = "X";
deletespan.classList.add("deletespan");
deletespan.onclick = function(){
//delete the parent div of the image
//delete the file
var filename = this.parentElement.getElementsByClassName("filelabel")[0].innerHTML;
var httpc = new XMLHttpRequest();
var url = "deletefile.php";
httpc.open("POST", url, true);
httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpc.send("filename=trashmagic/" + filename);//send text to deletefile.php
this.parentElement.parentElement.removeChild(this.parentElement);
}
newbox.appendChild(deletespan);
var newdiv = document.createElement("DIV");
newdiv.innerHTML = newfilename;
newdiv.className = "filelabel";
newbox.appendChild(newdiv);
var newimg = document.createElement("IMG");
newimg.src = png64;
newimg.classList.add("uploadimage");
newimg.classList.add("button");
newbox.appendChild(newimg);
document.getElementById("feedscroll").insertBefore(newbox,document.getElementById("feedscroll").getElementsByClassName("imagebox")[0]);
}
function keyPressed() {
if(key == 's'){
post();
}
}
upuploadImages = [];
var httpc9 = new XMLHttpRequest();
httpc9.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
upuploadImages = JSON.parse(this.responseText);
for(var index = upuploadImages.length - 1;index >= 0;index--) {
if(upuploadImages[index].includes("-coth")){
var newbox = document.createElement("DIV");
newbox.classList.add("imagebox");
var deletespan = document.createElement("SPAN");
deletespan.innerHTML = "X";
deletespan.classList.add("deletespan");
deletespan.onclick = function(){
//delete the parent div of the image
//delete the file
var filename = this.parentElement.getElementsByClassName("filelabel")[0].innerHTML;
var httpc = new XMLHttpRequest();
var url = "deletefile.php";
httpc.open("POST", url, true);
httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpc.send("filename=trashmagic/" + filename);//send text to deletefile.php
this.parentElement.parentElement.removeChild(this.parentElement);
}
newbox.appendChild(deletespan);
var newdiv = document.createElement("DIV");
newdiv.innerHTML = upuploadImages[index];
newdiv.className = "filelabel";
newbox.appendChild(newdiv);
document.getElementById("feedscroll").appendChild(newbox);
var newimg = document.createElement("IMG");
newimg.src = "trashmagic/" + upuploadImages[index];
newimg.classList.add("uploadimage");
newimg.classList.add("button");
newbox.appendChild(newimg);
}
}
}
};
httpc9.open("GET", "dir.php?filename=trashmagic", true);
httpc9.send();
</script>
<style>
body{
overflow:hidden;
background-color:#9f8767;
}
main{
position:absolute;
right:25px;
top:25px;
border-left:solid;
border-width:10px
}
#feedscroll img{
max-width:80%;
display:block;
margin:auto;
margin-top:1em;
border:solid;
}
p{
margin:1em 1em 1em 1em;
font-size:1.5em;
font-family:Comic Sans MS;
overflow:scroll;
}
h1,h2,h3{
font-family:Comic Sans MS;
text-align:center;
overflow:scroll;
}
a{
color:blue;
font-family:Comic Sans MS;
font-size:1.5em;
overflow:scroll;
}
#feedscroll{
position:absolute;
left:0px;
bottom:0px;
top:6em;
z-index:-2;
overflow:scroll;
background-color:#9f8767;
padding:1em 1em 1em 1em;
}
.deletespan{
color:red;
border:solid;
border-color:red;
border-radius:0.5em;
padding: 1em 1em 1em 1em;
cursor:pointer;
}
.deletespan:hover{
background-color:#ff000080;
}
.filelabel{
display:none;
}
.button{
cursor:pointer;
}
.button:hover{
background-color:green;
}
.button:active{
background-color:yellow;
}
.data{
display:none;
}
</style>
</body>
</html>