-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sundial.html
214 lines (212 loc) · 6.73 KB
/
Sundial.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
<!DOCTYPE html>
<html>
<head>
<title>The Programming Language of Euler</title>
<style type="text/css">
body {
width : 700px;
font-family: arial, sans-serif;
font-size: 10pt;
margin: 20px;
margin-left: 100px;
}
pre {
font-family : "Courier New", monospace;
background: #EEE;
padding: 10px;
margin-left: 15%;
}
pre.output {
background:none;
margin-left: 5%;
}
pre.udf {
margin-left: 0;
}
pre.prompt {
margin-left: 0;
}
pre.comment {
background: none;
margin-left: 7%;
}
p.comment {
margin-left: 5%;
margin-right: 5%;
}
p.indentedcomment {
margin-left: 10%;
}
h1.title {
font-family : arial, sans-serif;
text-align : right;
font-size : 24pt;
padding-bottom: 5pt;
}
h1.comment, h1.comment a {
font-family : arial, sans-serif;
text-align : right;
font-size : 16pt;
}
h2.comment, h2.comment a {
font-family : arial, sans-serif;
text-align : right;
font-size : 12pt;
}
h1.title, h1.comment, h2.comment {
border-bottom: 2px solid;
}
ul.comment {
font-family : arial, sans-serif;
font-size : 10pt;
margin-left: 10%;
margin-right: 10%;
padding-left:0;
}
img.euler { }
p.image {
text-align:center; margin-left:50px;
}
a:link {
font-weight:bolder;
text-decoration:none;
}
a:visited {
font-weight:bolder;
text-decoration:none;
}
</style>
</head>
<body>
<h1 class="title">Sundial</h1>
<pre class="prompt">>{theta,psi,r}:=polar(1,-2,-1); [r, deg(theta), deg(psi)]
</pre>
<pre class="output">[2.44949, -63.4349, -24.0948]
</pre>
<pre class="prompt">>{x,y,z}:=rect(theta,psi,r); [x, y, z]
</pre>
<pre class="output">[1, -2, -1]
</pre>
<h1 class="comment"><a name="Berechnungsgrundlagen_Bütschen">Berechnungsgrundlagen Bütschen</a></h1>
<pre class="prompt">>e:=23.44°; Dek7:=asin(sin(e)*sin([-90:30:90]°)); deg(Dek7)
</pre>
<pre class="output">[-23.44, -20.151, -11.4723, 0, 11.4723, 20.151, 23.44]
</pre>
<pre class="prompt">>lat:= 47.41265°; lon:= -7.6958595°; wa:= 18.9°;
</pre>
<pre class="comment">Erhebungs-, Substilarwinkel sowie Stundenwinkel-Differenz
</pre>
<pre class="prompt">>g:=asin(cos(lat)*cos(wa)); f:=atan2(tan(lat),-sin(wa)); ...
tsub:=atan2(sin(lat),tan(wa));
>[deg(g), deg(f), deg(tsub)/15]
</pre>
<pre class="output">[39.8089, -16.5796, 1.66266]
</pre>
<pre class="prompt">>tau:=[-120:15:150]°; PL:=80; PH=PL*sin(g); PH*[sin(f),cos(f)]/tan(g)
</pre>
<pre class="output">[-17.5359, 58.8997]
</pre>
<pre class="udf">>function HorAeq(A,h,f=lat)
A=rad(A); h=rad(h);
d=asin(-cos(h)*cos(A)*cos(f)+sin(h)*sin(f)); ...
t=atan2(cos(h)*cos(A)*sin(f)+sin(h)*cos(f),cos(h)*sin(A));
return {deg(t),deg(d)};
endfunction
</pre>
<pre class="udf">>function AeqHor(t,d,f=lat)
t=rad(t); d=rad(d);
h=asin(sin(f)*sin(d)+cos(f)*cos(d)*cos(t));
A=atan2(sin(f)*cos(t)-cos(f)*tan(d),sin(t));
return {deg(A),deg(h)};
endfunction
</pre>
<pre class="prompt">>load "D:\Euler x64\util\astro.e";
>now=day(2016,4,21,5,50)
</pre>
<pre class="output">5954.74
</pre>
<pre class="udf">>function Dekli(t=now) ....
h=sun(t);
return h[2];
endfunction
</pre>
<pre class="prompt">>{t,d}=HorAeq(-71.1,20,); [t/15, d]
</pre>
<pre class="output">[-4.19125, 2.62685]
</pre>
<pre class="prompt">>t=secant("Dekli(x)-d",day(2017,3,24)); printday(t)
</pre>
<pre class="output">2017-03-27 02:37:19
</pre>
<pre class="prompt">>t=secant("Dekli(x)-d",day(2017,9,20)); printday(t)
</pre>
<pre class="output">2017-09-16 01:30:21
</pre>
<pre class="udf">>function ZifferblattMatrix(f=lat,a=wa,i=0°)
Z=zeros(3,3);
Z[1,1]=sin(f)*sin(a); Z[1,2]=-cos(a); Z[1,3]=-cos(f)*sin(a);
Z[2,1]=cos(f)*cos(i)-sin(f)*cos(a)*sin(i); Z[2,2]=-sin(a)*sin(i); Z[2,3]=cos(f)*cos(a)*sin(i)+sin(f)*cos(i);
$Z[3,1]=cos(f)*sin(i)+sin(f)*cos(a)*cos(i); Z[3,2]=sin(a)*cos(i); Z[3,3]=-cos(f)*cos(a)*cos(i)+sin(f)*sin(i);
$return Z
endfunction
</pre>
<pre class="prompt">>D:=ZifferblattMatrix()
</pre>
<pre class="output"> 0.238483 -0.946085 -0.219199
0.676713 0 0.736247
0.696552 0.323917 -0.640229
</pre>
<pre class="prompt">>{theta,psi,r}:=polar(D[1,3],D[2,3],D[3,3]); [r, deg(theta), deg(psi)]
</pre>
<pre class="output">[1, 106.58, -39.8089]
</pre>
<pre class="comment">Umwandlung in kartesische Koordinaten
</pre>
<pre class="udf">>function KartKoo(tau,delta)
## wandelt Horizontal- und Vertikalwinkel in kart. Koordinaten in der Einheitskugel um
return cos(delta)*cos(tau)_cos(delta)*sin(tau)_sin(delta);
endfunction
</pre>
<pre class="comment">Drehung in Koord.system (Z=X,Y,Z) und
Projektion auf Zifferblat (z=x,y)
</pre>
<pre class="prompt">>open("Vertikaluhr.csv","w");
>for i=1:size(Dek7)[2]; Z:=(D.KartKoo(tau,Dek7[i]))'; z:=-PH*Z[,1:2]/Z[,3]; writematrix([-8:10]'|Z|z,separator=";"); end;
>close();
>writetable((deg(tau)/15)'|Z|z,labc=["t[h]","X","Y","Z","x","y"])
</pre>
<pre class="output"> t[h] X Y Z x y
-8 0.56 -0.02 -0.83 34.19 -1.08
-7 0.69 0.13 -0.71 50.31 9.57
-6 0.78 0.29 -0.55 72.47 27.18
-5 0.81 0.45 -0.38 109.95 61.73
-4 0.77 0.6 -0.19 205.91 160.51
-3 0.68 0.73 -0.01 2699.33 2899.77
-2 0.54 0.83 0.15 -182.9 -283.25
-1 0.35 0.89 0.29 -62.53 -160.02
0 0.13 0.91 0.38 -17.54 -121.75
1 -0.1 0.89 0.44 11.71 -104.01
2 -0.33 0.83 0.45 37.98 -95.09
3 -0.55 0.73 0.41 68.68 -92.02
4 -0.73 0.6 0.32 115.96 -95.89
5 -0.87 0.45 0.2 225.03 -117.45
6 -0.96 0.29 0.04 1150.85 -352.86
7 -0.98 0.13 -0.13 -378.21 50.89
8 -0.95 -0.02 -0.32 -153.3 -2.84
9 -0.86 -0.15 -0.5 -88.29 -15.08
10 -0.71 -0.24 -0.66 -55.19 -19.01
</pre>
<pre class="comment">Horizontmarkierungen
</pre>
<pre class="prompt">>open("Horizont.csv","w"); Z:=(Dhor.KartKoo([-60:15:105]°,0))'; z:=-PH*Z[,1:2]/Z[,3];
>writematrix([-60:15:105]'|Z|z,"Horizont.csv",separator=";");
</pre>
<pre class="comment">Topografischer Horizont
</pre>
<pre class="prompt">>Sky:=readmatrix("Buetschen_Skyplot.rpt"); Sky:=Sky[55:146]; Sky[,1]:=Sky[,1]-180;
>Dhor:= ZifferblattMatrix(90°,,); Z:=(Dhor.KartKoo(Sky[,1]°',Sky[,2]°'))'; z:=-PH*Z[,1:2]/Z[,3];
>writematrix(Sky[,1]|Z|z,"Horizont.csv",separator=";");
>close();
</pre>
</body>
</html>