Skip to content

Commit 4f0846f

Browse files
committed
added cn page
1 parent b46fa88 commit 4f0846f

11 files changed

+220
-6
lines changed

assets/uniformcircular1.gif

77.7 KB
Loading

assets/uniformcircular2.gif

233 KB
Loading

assets/uniformcircular3.gif

441 KB
Loading

assets/uniformcircular4.gif

178 KB
Loading

css/min.css

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/style.css

+34
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ body {
3333
}
3434

3535

36+
/* switch language */
37+
38+
.switch-lang {
39+
display: block;
40+
position: absolute;
41+
text-decoration: none;
42+
left: 85%;
43+
}
44+
3645

3746
/* data input area */
3847

@@ -79,6 +88,10 @@ body {
7988
line-height: 100%;
8089
margin: auto;
8190
padding: 1em 40% 1em 40%;
91+
user-select: none;
92+
-moz-user-select: none;
93+
-webkit-user-select: none;
94+
-ms-user-select:none;
8295
}
8396

8497
.info-container > .obj-titles .switch-obj:hover {
@@ -325,4 +338,25 @@ hr {
325338

326339
footer {
327340
margin: 1em 0 1.5em 0;
341+
}
342+
343+
/* show samples */
344+
345+
.samples-display {
346+
width: 40%;
347+
margin-bottom: 1em;
348+
}
349+
350+
.samples-display h5 {
351+
cursor: pointer;
352+
}
353+
354+
.samples-display img {
355+
width: 100%;
356+
}
357+
358+
@media only screen and (max-width:850px) {
359+
.samples-display {
360+
width: 90%;
361+
}
328362
}

index.html

+25-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55

66
<title>Circular and elliptic motion interactive</title>
77
<meta name="description" content="circular motion demo">
8+
<meta name="keywords" content="circular elliptic motion physics demo" />
89
<meta charset="utf-8">
910
<meta name="viewport" content="width=device-width, initial-scale=1.0">
10-
<link rel="stylesheet" href="./css/style.css" type="text/css" />
11+
<meta name="apple-mobile-web-app-status-bar-style" content="black">
12+
<meta name="theme-color" content="#3d3d3d">
13+
<meta name="renderer" content="webkit">
14+
<!--full css files
15+
<link rel="stylesheet" href="./css/style.css" type="text/css" />-->
16+
<link rel="stylesheet" href="./css/min.css" type="text/css" />
1117
<link rel="icon" href="./ahp.png" sizes="32x32">
1218
</head>
1319

@@ -19,6 +25,7 @@
1925
<header>
2026
<h1><del>Uniform</del> circular motion demo</h1>
2127
</header>
28+
<a href="./index_cn.html" class="switch-lang"></a>
2229
<article class="grand-container">
2330
<div class="shared-info-container">
2431
<span>container width </span><input type="text" class="container-width" autocomplete="off" readonly />
@@ -82,7 +89,7 @@ <h3>Block one</h3>
8289
'size' box. The period is the time taken for the ball
8390
to complete one complete circle and it should be in seconds. The semi-X-axis and semi-Y-axis is up to
8491
the size of your
85-
window. Note when semi-X equals to semi-Y, it will do a circular motion.<span class="bold">However,
92+
window. Note when semi-X equals to semi-Y, it will do a circular motion. <span class="bold">However,
8693
</span>don't worry yet, these values are
8794
automatically filled with default ones so you can just press the 'Go' button to see its motion! It will
8895
be
@@ -91,7 +98,7 @@ <h3>Block one</h3>
9198
<br /><span class="bold">Hint2: </span>you can actually drag the ball to set its initial position!
9299
</p>
93100
<p>
94-
You can vary the period or semi-X/Y linearly by setting the delta value. For example, by setting Rx
101+
You can vary the period, semi-X/Y or rotation linearly by setting the delta value. For example, by setting Rx
95102
delta
96103
with 10, the ball's rotating semi-X-axis will increase
97104
every second with an amount of 10px, until it hits the boundary. Visually it will be more and more flat.
@@ -108,14 +115,23 @@ <h3>Block one</h3>
108115
semi-Y-axis and Rx(t) = Rx₀+t⋅ΔRx, Ry(t) = Ry₀+t⋅ΔRy, T is
109116
the period with T(t) = T₀+t⋅ΔT, and 𝜑 is the offset.
110117
</p>
118+
<p>
119+
By applying a rotation matrix onto this vector can cause the ball's trajectory to rotate:
120+
<span class="equation">rotated[x, y](t) = [x(t)⋅cosα-y(t)⋅sinα, x(t)⋅sinα+y(t)⋅cosα]</span>
121+
and α(t) = α₀+Δα is the rotation angle.
122+
</p>
123+
You can spawn multiple objects to make beautiful effects.
124+
</div>
125+
<div class="samples-display">
126+
<h5>Click see/hide examples</h5>
111127
</div>
112128
<hr />
113129
<div class="shared-info-container-bo">
114130
<span>frames per second: </span><span>25</span>
115131
<input type="button" class="fps-decrease" value="decrease" />
116132
<input type="button" class="fps-increase" value="increase" />
117133
<br /><br />
118-
<input type="button" class="cancel-bg-change" value="pause background" />
134+
If slow you can <input type="button" class="cancel-bg-change" value="pause background" />
119135
</div>
120136
</article>
121137
<footer>
@@ -125,6 +141,10 @@ <h3>Block one</h3>
125141
</footer>
126142
</body>
127143

144+
<!-- full js files
128145
<script type="text/javascript" src="./js/bg.js"></script>
129146
<script type="text/javascript" src="./js/movingbox.js"></script>
130-
<script type="text/javascript" src="./js/movingboxmany.js"></script>
147+
<script type="text/javascript" src="./js/movingboxmany.js"></script>
148+
<script type="text/javascript" src="./js/req.js"></script>
149+
-->
150+
<script type="text/javascript" src="./js/min.js"></script>

index_cn.html

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<!DOCTYPE html>
2+
3+
<head>
4+
<!--uniform circular motion demo! ()cleoold-->
5+
6+
<title>匀速圆周运动demo by cos</title>
7+
<meta name="description" content="匀速圆周运动demo">
8+
<meta name="keywords" content="匀速圆周运动 椭圆运动 demo 物理" />
9+
<meta charset="utf-8">
10+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
11+
<meta name="apple-mobile-web-app-status-bar-style" content="black">
12+
<meta name="theme-color" content="#3d3d3d">
13+
<meta name="renderer" content="webkit">
14+
<meta content="telephone=no" name="format-detection">
15+
<link rel="stylesheet" href="./css/min.css" type="text/css" />
16+
<link rel="icon" href="./ahp.png" sizes="32x32">
17+
</head>
18+
19+
<script type="text/javascript">
20+
if (/*@cc_on!@*/false || !!document.documentMode) document.write('Internet Explorer 可能不兼容此程序. 建议您更换浏览器来浏览.');
21+
</script>
22+
23+
<body>
24+
<header>
25+
<h1>圆周运动 by cos</h1>
26+
</header>
27+
<a href="./index.html" class="switch-lang">English</a>
28+
<article class="grand-container">
29+
<div class="shared-info-container">
30+
<span>容器尺寸 </span><input type="text" class="container-width" autocomplete="off" readonly />
31+
</div>
32+
<div id="info-container-1" class="info-container">
33+
<div class="obj-titles">
34+
<div class="switch-obj-prev switch-obj"> &lt;&lt;&lt; </div>
35+
<h3>物块一</h3>
36+
<div class="switch-obj-next switch-obj"> &gt;&gt;&gt; </div>
37+
</div>
38+
<div class="box-label"><span>X轴坐标</span></div>
39+
<input type="text" class="box-x" autocomplete="off" placeholder="leave this be :-)" readonly />
40+
<div class="box-label"><span>Y轴坐标</span></div>
41+
<input type="text" class="box-y" autocomplete="off" placeholder="leave this be :-)" readonly />
42+
<div class="box-label"><span>物块颜色</span></div>
43+
<input type="text" class="set-color" autocomplete="off" />
44+
<div class="box-label"><span>物块直径(px)</span></div>
45+
<input type="text" class="set-size" autocomplete="off" />
46+
<div class="box-label"><span>轨道X半轴(px)</span></div>
47+
<input type="text" class="set-semi-X-axis" autocomplete="off" />
48+
<div class="box-label"><span>Rx Δ(px/sec)</span></div>
49+
<input type="text" class="set-semi-X-axis-change" autocomplete="off" />
50+
<div class="box-label"><span>轨道Y半轴(px)</span></div>
51+
<input type="text" class="set-semi-Y-axis" autocomplete="off" />
52+
<div class="box-label"><span>Ry Δ(px/s)</span></div>
53+
<input type="text" class="set-semi-Y-axis-change" autocomplete="off" />
54+
<div class="box-label"><span>轨道周期(s)</span></div>
55+
<input type="text" class="set-period" autocomplete="off" />
56+
<div class="box-label"><span>T Δ(s/s)</span></div>
57+
<input type="text" class="set-period-change" autocomplete="off" />
58+
<div class="box-label"><span>轨道偏移角(deg)</span></div>
59+
<input type="text" class="set-angle" autocomplete="off" />
60+
<div class="box-label"><span>α Δ(deg/s)</span></div>
61+
<input type="text" class="set-angle-change" autocomplete="off" />
62+
63+
<div class="buttons">
64+
<input type="button" class="set-attr-go" value="Go!" />
65+
<input type="button" class="set-attr-reset" value="重置" />
66+
</div>
67+
</div>
68+
<div id="container">
69+
<div id="moving-obj-trajectory-1" class="moving-obj-trajectory"></div>
70+
<div id="origin"></div>
71+
<div id="moving-obj-1" class="moving-obj"></div>
72+
</div>
73+
<div class="projections">
74+
<div id="moving-obj-prj-1" class="moving-obj-prj"></div>
75+
</div>
76+
<div class="obj-manage">
77+
<input type="button" class="objs-oneclick-go" value="确定所有" />
78+
<input type="button" class="objs-oneclick-reset" value="重置所有" />
79+
<br />
80+
<input type="button" class="append-objs" value="增加" />
81+
<input type="button" class="delete-objs" value="移除" />
82+
</div>
83+
<div class="description">
84+
<p>
85+
<span class="bold">提示:</span>这个 app 展示了一个围绕着原点旋转的球. 首先您要设置球的颜色:可以是 yellow,
86+
blue, violet 甚至是 rgba(255,255,255,0.5). 然后再在“物块直径”里设置它的尺寸(5 到 30). 周期描述一个球旋转一周所需要的时间,单位是秒.
87+
X半轴和Y半轴对应着长短半轴,这个设定的最大值由您的窗口大小决定. 注意当两个值相同的时候,物块会做匀速圆周运动. <span class="bold">不过不要担心
88+
</span>,这些值都已经自动填好了,所以您可以直接点击“确定”.
89+
<br /><span class="bold">提示2:</span>负的周期值可以产生一个逆时针旋转.
90+
<br /><span class="bold">提示3:</span>您可以通过拖动小球来改变它的初始位置!
91+
</p>
92+
<p>
93+
您可以通过差值来在每秒钟线性地改变周期/半轴长/旋转角. 比如设置X半轴差为 10 可以让小球的X半轴每秒增加 10px(直到它撞到边界)可以让小球看起来越来越扁. 您可以尝试其他区域来看看会发生什么.
94+
当然,此时小球就不再做匀速运动了.
95+
</p>
96+
<p>
97+
<span class="bold">小球的轨迹</span>用一个以 t(时间)为参数的参数方程来描述:
98+
<span class="equation">x(t) = Rx(t)⋅cos(𝜔(t)⋅t-𝜑) = Rx(t)⋅cos(2π/T(t)⋅t-𝜑)</span>
99+
<span class="equation">y(t) = Ry(t)⋅sin(𝜔(t)⋅t-𝜑) = Ry(t)⋅sin(2π/T(t)⋅t-𝜑)</span>
100+
加上小球所在容器的修正. 其中 Rx 或 Ry 为X半轴或Y半轴且 Rx(t) = Rx₀+t⋅ΔRx, Ry(t) = Ry₀+t⋅ΔRy, T 为周期且 T(t) = T₀+t⋅ΔT, 𝜑 是初相.
101+
</p>
102+
<p>
103+
使用旋转矩阵作用到它可以旋转小球的轨迹,其中 α(t) = α₀+Δα 为偏移角:
104+
<span class="equation">rotated[x, y](t) = [x(t)⋅cosα-y(t)⋅sinα, x(t)⋅sinα+y(t)⋅cosα]</span>
105+
</p>
106+
您可以生成多个这样的小球来实现炫目的效果.
107+
</div>
108+
<div class="samples-display">
109+
<h5>点击查看/隐藏样例</h5>
110+
</div>
111+
<hr />
112+
<div class="shared-info-container-bo">
113+
<span>刷新率:</span><span>25</span>
114+
<input type="button" class="fps-decrease" value="-减少" />
115+
<input type="button" class="fps-increase" value="+增加" />
116+
<br /><br />
117+
如果显示卡顿您可以 <input type="button" class="cancel-bg-change" value="暂停背景变化" />
118+
</div>
119+
</article>
120+
<footer>
121+
<br />
122+
(c) 2019 cleooldsaty. <a href="https://github.com/cleoold/uniform_circular_motion" target="_blank">Github</a>
123+
</footer>
124+
</body>
125+
126+
<script type="text/javascript" src="./js/min.js"></script>

js/bg.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ var bgChangeFlag = -1;
2222

2323
document.querySelector('.shared-info-container-bo .cancel-bg-change').addEventListener('click', (e) => {
2424
bgChangeFlag = null;
25-
});
25+
});

0 commit comments

Comments
 (0)