Microsoft Small Basic

Program Listing: QMS609-0
' Orionid
' Version 0.2
' オリオン座流星群
' Copyright © 2016-2017 Nonki Takahshi. The MIT License.
' Last update 2017-10-16
' Program ID QMS609-0
'
' Reference:
' http://en.wikipedia.org/wiki/List_of_stars_in_Orion

title = "Orionid"
r = 600 ' [px]
delay = 100 ' [ms]
Init()
Cal_Init()
InitStars()
ra = radiant["ra"]
dec = radiant["dec"]
Mapping()
rot = ra
tilt = dec - 5
GraphicsWindow.Title = title + " RA=" + ra + "h Dec=" + dec + "°"
DrawRA()
DrawDec()
Shapes_Init()
scale = 1
iMin = 1
iMax = Array.GetItemCount(shape)
Shapes_Add()
DrawEcliptic()
DrawStars()
DrawCalendar()
DrawMeteorShower()
While "True"
If keyDown Then
If key = "Right" Then
rot = rot + 0.25
If 24 <= rot Then
rot = rot - 24
EndIf
ElseIf key = "Left" Then
rot = rot - 0.25
If rot < 0 Then
rot = rot + 24
EndIf
ElseIf key = "Up" Then
If tilt <= 85 Then
tilt = tilt + 5
EndIf
ElseIf key = "Down" Then
If -85 <= tilt Then
tilt = tilt - 5
EndIf
ElseIf key = "Add" Then
r = r * 1.2
ElseIf key = "Subtract" Then
r = r / 1.2
EndIf
GraphicsWindow.Title = title + " RA=" + rot + "h Dec=" + tilt + "°"
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FillRectangle(0, 0, gw, gh)
DrawRA()
DrawDec()
DrawEcliptic()
DrawStars()
keyDown = "False"
EndIf
Program.Delay(delay)
EndWhile

Sub Init
gw = 598
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
GraphicsWindow.BackgroundColor = "Black"
ox = gw / 2
oy = gh * 0.35
rot = 0 ' rotation
tilt = 0
monthX = 40
monthY = 20
calendarX = 40
calendarY = gh - 180
year = 2017
month = 10
GraphicsWindow.KeyDown = OnKeyDown
EndSub

Sub OnKeyDown
keyDown = "True"
key = GraphicsWindow.LastKey
EndSub

Sub DrawRA
GraphicsWindow.PenWidth = 1
GraphicsWindow.PenColor = "#666666"
roll = 0
For ra = 0 To 23
For dec = -90 To 90 Step 5
Mapping()
If -90 < dec Then
DrawLine()
EndIf
xLast = x
yLast = y
zLast = z
EndFor
EndFor
EndSub

Sub DrawDec
GraphicsWindow.PenWidth = 1
GraphicsWindow.PenColor = "#666666"
roll = 0
For dec = -80 To 80 Step 10
For ra = 0 To 24 Step 0.2
Mapping()
If 0 < ra Then
DrawLine()
EndIf
xLast = x
yLast = y
zLast = z
EndFor
EndFor
EndSub

Sub DrawEcliptic
GraphicsWindow.PenWidth = 1
GraphicsWindow.PenColor = "#999900"
roll = 23.26
dec = 0
For ra = 0 To 24 Step 0.2
Mapping()
If 0 < ra Then
DrawLine()
EndIf
xLast = x
yLast = y
zLast = z
EndFor
EndSub

Sub DrawLine
visible = "False"
If 0 <= z And 0 <= zLast Then
If 0 <= x And x < gw And 0 <= y And y < gh Then
visible = "True"
ElseIf 0 <= xLast And xLast < gw And 0 <= yLast And yLast < gh Then
visible = "True"
EndIf
EndIf
If visible Then
GraphicsWindow.DrawLine(xLast, yLast, x, y)
EndIf
EndSub

Sub DrawStars
GraphicsWindow.PenWidth = 0
GraphicsWindow.BrushColor = "White"
n = Array.GetItemCount(star)
index = Array.GetAllIndices(star)
roll = 0
For i = 1 To n
ra = star[index[i]]["ra"]
dec = star[index[i]]["dec"]
Mapping()
If ell[index[i]] <> "" Then
Shapes.Remove(ell[index[i]])
ell[index[i]] = ""
EndIf
If 0 <= z Then
mag = star[index[i]]["mag"]
d = 16 / (mag + 3)
ell[index[i]] = Shapes.AddEllipse(d, d)
Shapes.Move(ell[index[i]], x - d / 2, y - d / 2)
EndIf
EndFor
GraphicsWindow.PenWidth = 1
GraphicsWindow.PenColor = "LightGray"
nSign = Array.GetItemCount(edge)
iSign = Array.GetAllIndices(edge)
For j = 1 To nSign
n = Array.GetItemCount(edge[iSign[j]])
index = Array.GetAllIndices(edge[iSign[j]])
For i = 1 To n
e = edge[iSign[j]][index[i]]
m = Text.GetIndexOf(e, "-")
ra = star[Text.GetSubText(e, 1, m - 1)]["RA"]
dec = star[Text.GetSubText(e, 1, m - 1)]["Dec"]
Mapping()
x1 = x
y1 = y
z1 = z
ra = star[Text.GetSubTextToEnd(e, m + 1)]["RA"]
dec = star[Text.GetSubTextToEnd(e, m + 1)]["Dec"]
Mapping()
x2 = x
y2 = y
z2 = z
If connect[iSign[j]][index[i]] <> "" Then
Shapes.Remove(connect[iSign[j]][index[i]])
connect[iSign[j]][index[i]] = ""
EndIf
visible = "False"
If 0 <= z1 And 0 <= z2 Then
If 0 <= x1 And x1 <= gw And 0 <= y1 And y1 <= gh Then
visible = "True"
ElseIf 0 <= x2 And x2 <= gw And 0 <= y2 And y2 <= gh Then
visible = "True"
EndIf
If visible Then
connect[iSign[j]][index[i]] = Shapes.AddLine(x1, y1, x2, y2)
EndIf
EndIf
EndFor ' i
EndFor ' j
EndSub

Sub DrawMeteorShower
ra = radiant["RA"]
dec = radiant["Dec"]
Mapping()
rx = x
ry = y
GraphicsWindow.PenColor = "White"
While "True"
Program.Delay(2000)
angle = Math.GetRandomNumber(360)
_a = Math.GetRadians(angle)
r1 = Math.GetRandomNumber(100) + 50
r2 = r1 * 2.5
x1 = rx + r1 * Math.Sin(_a)
y1 = ry - r1 * Math.Cos(_a)
x2 = rx + r2 * Math.Sin(_a)
y2 = ry - r2 * Math.Cos(_a)
meteor = Shapes.AddLine(x1, y1, x2, y2)
For op = 100 To 0 Step -5
Shapes.SetOpacity(meteor, op)
Program.Delay(50)
EndFor
Shapes.Remove(meteor)
EndWhile
EndSub

Sub DrawCalendar
GraphicsWindow.BrushColor = "White"
If silverlight Then
Program.Delay(msWait)
EndIf
GraphicsWindow.FontSize = 30
txt = Shapes.AddText(months[month])
Shapes.Move(txt, monthX, monthY)
If silverlight Then
Program.Delay(msWait)
EndIf
GraphicsWindow.FontSize = 40
txt = Shapes.AddText(year)
Shapes.Move(txt, monthX, monthY + 30)
sBuf = year + "," + month
Command_GetArgs()
iYear = sArg[1]
if iYear = "" Then
Goto lEnd
Endif
If Math.Remainder(iYear, 4) = 0 And Math.Remainder(iYear, 100) > 0 Or Math.Remainder(iYear, 400) = 0 Then
iDoM[2] = iDoM[2] + 1
Endif
iNoL = Math.Floor((iYear - 1) / 4) - Math.Floor((iYear - 1) / 100) + Math.Floor((iYear - 1) / 400) ' number of leap year
iWoY = Math.Remainder((iYear + iNoL), 7) ' week of year
iMonth = sArg[2]
If iMonth = "" Then
iM0 = 1
iM1 = 12
Else
iM0 = iMonth
iM1 = iMonth
Endif
iDoY = 0 ' days of year
iNoM = 1 ' number of month
For iM = iM0 To iM1
While iNoM < iM
iDoY = iDoY + iDoM[iNoM]
iNoM = iNoM + 1
EndWhile
Cal_DrawMonth()
EndFor
lEnd:
EndSub

Sub Mapping
' param ra - right asension [h]
' param rot - rotation [h]
' param dec - declination [deg]
' param tilt - tilt [deg]
' param roll - roll [deg]
' param r - radius [px]
' return x, y - position in the graphics window [px]
' return z - visible if 0 <= z
If Text.IsSubText(ra, " ") Then
_ra = Text.GetSubText(ra, 1, 2)
_ra = _ra + Text.GetSubText(ra, 4, 2) / 60
_ra = _ra + Text.GetSubText(ra, 7, 5) / 3600
ra = _ra
EndIf
If Text.IsSubText(dec, " ") Then
_dec = Text.GetSubText(dec, 2, 2)
_dec = _dec + Text.GetSubText(dec, 5, 2) / 60
_dec = _dec + Text.GetSubText(dec, 8, 5) / 3600
_dec = _dec * Text.Append(Text.GetSubText(dec, 1, 1), "1")
dec = _dec
EndIf
φ = Math.GetRadians(ra * 15)
θ = Math.GetRadians(dec)
x = ox - r * Math.Sin(φ) * Math.Cos(θ)
y = oy - r * Math.Sin(θ)
z = r * Math.Cos(φ) * Math.Cos(θ)
If roll <> 0 Then
_x = x - ox
_y = y - oy
ψ = Math.GetRadians(roll)
x = ox + Math.Cos(ψ) * _x - Math.Sin(ψ) * _y
y = oy + Math.Sin(ψ) * _x + Math.Cos(ψ) * _y
EndIf
If rot <> 0 Then
_x = x - ox
_z = z
ρ = Math.GetRadians(-rot * 15)
x = ox + Math.Cos(ρ) * _x - Math.Sin(ρ) * _z
z = Math.Sin(ρ) * _x + Math.Cos(ρ) * _z
EndIf
If tilt <> 0 Then
_z = z
_y = y - oy
τ = Math.GetRadians(tilt)
z = Math.Cos(τ) * _z - Math.Sin(τ) * _y
y = oy + Math.Sin(τ) * _z + Math.Cos(τ) * _y
EndIf
EndSub

Sub InitStars
' Initialize stars in Orion
' index: Flamsteed designation
' RA (Right ascension), Dec (Declination), Mag (Apparent magnitude)
star["Rigel"] = "ra=05 14 32.27;dec=-08 12 05.9;mag=0.18;fd=19;"
star["Betelgeuse"] = "ra=05 55 10.29;dec=+07 24 25.3;mag=0.42;fd=58;"
star["Bellatrix"] = "ra=05 25 07.87;dec=+06 20 59.0;mag=1.64;fd=24;"
star["Alnilam"] = "ra=05 36 12.81;dec=-01 12 06.9;mag=1.69;fd=46;"
star["Alnitak A"] = "ra=05 40 45.52;dec=-01 56 33.3;mag=1.88;fd=50;"
star["Saiph"] = "ra=05 47 45.39;dec=-09 40 10.6;mag=2.07;fd=53;"
star["Mintaka AB"] = "ra=05 32 00.40;dec=-00 17 56.7;mag=2.20;fd=34;"
star["ι Ori"] = "ra=05 35 25.98;dec=-05 54 35.6;mag=2.75;fd=44;"
star["π3 Ori"] = "ra=04 49 50.14;dec=+06 57 40.5;mag=3.19;fd=1;"
star["η Ori"] = "ra=05 24 28.62;dec=-02 23 49.7;mag=3.35;fd=28;"
star["Meissa A"] = "ra=05 35 08.28;dec=+09 56 03.0;mag=3.47;fd=39;"
star["τ Ori"] = "ra=05 17 36.40;dec=-06 50 39.8;mag=3.59;fd=20;"
star["π4 Ori"] = "ra=04 51 12.37;dec=+05 36 18.4;mag=3.68;fd=3;"
star["Alnitak BC"] = "ra=05 40 45.60;dec=-01 56 34.0;mag=3.70;fd=50;"
star["π5 Ori"] = "ra=04 54 15.10;dec=+02 26 26.4;mag=3.71;fd=8;"
star["σ Ori AB"] = "ra=05 38 44.77;dec=-02 36 00.2;mag=3.77;fd=48;"
star["ο2 Ori"] = "ra=04 56 22.32;dec=+13 30 52.5;mag=4.06;fd=9;"
star["φ2 Ori"] = "ra=05 36 54.33;dec=+09 17 29.1;mag=4.09;fd=40;"
star["μ Ori"] = "ra=06 02 22.99;dec=+09 38 50.5;mag=4.12;fd=61;"
star["29 Ori"] = "ra=05 23 56.84;dec=-07 48 28.6;mag=4.13;fd=29;"
star["32 Ori"] = "ra=05 30 47.05;dec=+05 56 53.6;mag=4.20;fd=32;"
star["π2 Ori"] = "ra=04 50 36.72;dec=+08 54 00.9;mag=4.35;fd=2;"
star["φ1 Ori"] = "ra=05 34 49.24;dec=+09 29 22.5;mag=4.39;fd=37;"
star["χ1 Ori"] = "ra=05 54 23.08;dec=+20 16 35.1;mag=4.39;fd=54;"
star["ν Ori"] = "ra=06 07 34.32;dec=+14 46 06.7;mag=4.42;fd=67;"
star["ξ Ori"] = "ra=06 11 56.40;dec=+14 12 31.7;mag=4.45;fd=70;"
star["ρ Ori"] = "ra=05 13 17.48;dec=+02 51 40.5;mag=4.46;fd=17;"
star["π6 Ori"] = "ra=04 58 32.90;dec=+01 42 50.5;mag=4.47;fd=10;"
star["ω Ori"] = "ra=05 39 11.15;dec=+04 07 17.3;mag=4.50;fd=47;"
star["HD 40657"] = "ra=06 00 03.35;dec=-03 04 26.7;mag=4.53;"
star["42 Ori"] = "ra=05 35 23.16;dec=-04 50 18.0;mag=4.58;fd=42;"
star["ψ2 Ori"] = "ra=05 26 50.23;dec=+03 05 44.4;mag=4.59;fd=30;"
star["υ Ori"] = "ra=05 31 55.86;dec=-07 18 05.5;mag=4.62;fd=36;"
star["π1 Ori"] = "ra=04 54 53.70;dec=+10 09 04.1;mag=4.64;fd=7;"
star["χ2 Ori"] = "ra=06 03 55.18;dec=+20 08 18.5;mag=4.64;fd=62;"
star["11 Ori"] = "ra=05 04 34.14;dec=+15 24 15.1;mag=4.65;fd=11;"
star["ο1 Ori"] = "ra=04 52 31.96;dec=+14 15 02.8;mag=4.71;fd=4;"
star["31 Ori"] = "ra=05 29 43.98;dec=-01 05 31.8;mag=4.71;fd=31;"
star["22 Ori"] = "ra=05 21 45.75;dec=-00 22 56.9;mag=4.72;fd=22;"
star["56 Ori"] = "ra=05 52 26.44;dec=+01 51 18.6;mag=4.76;fd=56;"
star["49 Ori"] = "ra=05 38 53.09;dec=-07 12 45.8;mag=4.77;fd=49;"
star["HD 36960"] = "ra=05 35 02.68;dec=-06 00 07.3;mag=4.78;"
star["15 Ori"] = "ra=05 09 41.96;dec=+15 35 50.2;mag=4.81;"
star["ψ1 Ori"] = "ra=05 24 44.83;dec=+01 50 47.2;mag=4.89;fd=25;"
star["51 Ori"] = "ra=05 42 28.66;dec=+01 28 28.8;mag=4.90;fd=51;"
star["HD 44131"] = "ra=06 19 59.60;dec=-02 56 40.2;mag=4.91;"
star["HD 37756"] = "ra=05 40 50.72;dec=-01 07 43.6;mag=4.95;"
star["69 Ori"] = "ra=06 12 03.28;dec=+16 07 49.6;mag=4.95;fd=69;"
star["θ2 Ori A"] = "ra=05 35 22.90;dec=-05 24 57.8;mag=4.98;fd=43;"
star["23 Ori"] = "ra=05 22 50.00;dec=+03 32 40.0;mag=5.00;fd=23;"
star["74 Ori"] = "ra=06 16 26.57;dec=+12 16 18.2;mag=5.04;fd=74;"
star["27 Ori"] = "ra=05 24 28.91;dec=-00 53 30.0;mag=5.07;fd=27;"
star["θ1 Ori C"] = "ra=05 35 16.47;dec=-05 23 22.9;mag=5.13;fd=41;"
star["64 Ori"] = "ra=06 03 27.36;dec=+19 41 26.2;mag=5.14;fd=64;"
star["6 Ori"] = "ra=04 54 46.91;dec=+11 25 33.5;mag=5.18;fd=6;"
star["HD 33554"] = "ra=05 11 41.56;dec=+16 02 44.4;mag=5.18;"
star["71 Ori"] = "ra=06 14 50.94;dec=+19 09 24.8;mag=5.20;fd=71;"
star["60 Ori"] = "ra=05 58 49.58;dec=+00 33 10.7;mag=5.21;fd=60;"
star["45 Ori"] = "ra=05 35 39.49;dec=-04 51 21.9;mag=5.24;fd=45;"
star["52 Ori"] = "ra=05 48 00.23;dec=+06 27 15.2;mag=5.26;fd=52;"
star["38 Ori"] = "ra=05 34 16.79;dec=+03 46 01.0;mag=5.32;fd=38;"
star["5 Ori"] = "ra=04 53 22.76;dec=+02 30 29.8;mag=5.33;fd=5;"
star["HD 31296"] = "ra=04 54 47.79;dec=+07 46 45.0;mag=5.33;"
star["14 Ori"] = "ra=05 07 52.87;dec=+08 29 54.9;mag=5.33;fd=14;"
star["21 Ori"] = "ra=05 19 11.23;dec=+02 35 45.4;mag=5.34;fd=21;"
star["HD 36591"] = "ra=05 32 41.35;dec=-01 35 30.6;mag=5.34;"
star["72 Ori"] = "ra=06 15 25.13;dec=+16 08 35.5;mag=5.34;fd=72;"
star["HD 30210"] = "ra=04 46 01.70;dec=+11 42 20.2;mag=5.35;"
star["VV Ori"] = "ra=05 33 31.45;dec=-01 09 21.9;mag=5.36;"
star["55 Ori"] = "ra=05 51 21.98;dec=-07 31 04.8;mag=5.36;fd=55;"
star["HD 30034"] = "ra=04 44 25.77;dec=+11 08 46.2;mag=5.39;"
star["75 Ori"] = "ra=06 17 06.62;dec=+09 56 33.1;mag=5.39;fd=75;"
star["U Ori"] = "ra=05 55 49.30;dec=+20 10 30.0;mag=5.40;"
star["16 Ori"] = "ra=05 09 19.60;dec=+09 49 46.6;mag=5.43;fd=16;"
star["73 Ori"] = "ra=06 15 44.97;dec=+12 33 03.9;mag=5.44;fd=73;"
star["33 Ori"] = "ra=05 31 14.53;dec=+03 17 31.7;mag=5.46;fd=33;"
star["HD 34043"] = "ra=05 14 44.05;dec=+05 09 22.1;mag=5.50;"
star["18 Ori"] = "ra=05 16 04.14;dec=+11 20 28.9;mag=5.52;fd=18;"
star["HD 35536"] = "ra=05 25 01.74;dec=-10 19 43.8;mag=5.60;"
star["35 Ori"] = "ra=05 33 54.29;dec=+14 18 20.1;mag=5.60;fd=35;"
star["HD 36881"] = "ra=05 35 13.24;dec=+10 14 24.4;mag=5.60;"
star["HD 43318"] = "ra=06 15 34.36;dec=-00 30 42.0;mag=5.62;"
star["66 Ori"] = "ra=06 04 58.36;dec=+04 09 31.2;mag=5.63;fd=66;"
star["HD 36959"] = "ra=05 35 01.01;dec=-06 00 33.4;mag=5.67;"
star["63 Ori"] = "ra=06 04 58.19;dec=+05 25 11.9;mag=5.67;fd=63;"
star["HD 44033"] = "ra=06 20 04.23;dec=+14 39 04.2;mag=5.67;"
star["HD 35007"] = "ra=05 21 31.84;dec=-00 24 59.4;mag=5.68;"
star["HD 35299"] = "ra=05 23 42.31;dec=-00 09 35.3;mag=5.69;"
star["HD 40369"] = "ra=05 58 53.24;dec=+12 48 29.7;mag=5.70;"
star["HD 42111"] = "ra=06 08 57.90;dec=+02 29 59.0;mag=5.70;"
star["HD 43587"] = "ra=06 17 16.25;dec=+05 05 58.9;mag=5.70;"
star["HD 37209"] = "ra=05 36 35.69;dec=-06 03 53.1;mag=5.71;"
star["68 Ori"] = "ra=06 12 01.34;dec=+19 47 26.1;mag=5.76;fd=68;"
star["HD 36166"] = "ra=05 29 54.77;dec=+01 47 21.3;mag=5.77;"
star["HD 34989"] = "ra=05 21 43.56;dec=+08 25 42.8;mag=5.78;"
star["HD 38527"] = "ra=05 46 52.15;dec=+09 31 21.0;mag=5.78;"
star["HD 31373"] = "ra=04 55 50.16;dec=+15 02 25.1;mag=5.79;"
star["HD 39007"] = "ra=05 50 02.68;dec=+09 52 16.4;mag=5.79;"
star["HD 36134"] = "ra=05 29 23.70;dec=-03 26 46.9;mag=5.80;"
star["HD 43023"] = "ra=06 13 54.24;dec=-03 44 29.1;mag=5.83;"
star["HD 42954"] = "ra=06 14 28.58;dec=+17 54 23.0;mag=5.86;"
star["HD 37320"] = "ra=05 38 01.11;dec=+07 32 29.2;mag=5.87;"
star["HD 39910"] = "ra=05 55 30.16;dec=-04 36 59.4;mag=5.87;"
star["HD 33646"] = "ra=05 11 45.35;dec=+01 02 13.4;mag=5.88;"
star["HD 33608"] = "ra=05 11 19.13;dec=-02 29 26.8;mag=5.89;"
star["HD 40020"] = "ra=05 56 49.39;dec=+11 31 16.3;mag=5.89;"
star["59 Ori"] = "ra=05 58 24.44;dec=+01 50 13.7;mag=5.89;fd=59;"
star["HD 33833"] = "ra=05 12 48.12;dec=-06 03 25.6;mag=5.90;"
star["HD 32263"] = "ra=05 01 50.35;dec=+00 43 19.8;mag=5.91;"
star["HD 43112"] = "ra=06 15 08.46;dec=+13 51 03.9;mag=5.91;"
star["HD 36780"] = "ra=05 34 04.06;dec=-01 28 12.7;mag=5.92;"
star["57 Ori"] = "ra=05 54 56.69;dec=+19 44 58.6;mag=5.92;fd=57;"
star["HD 36162"] = "ra=05 30 26.17;dec=+15 21 38.0;mag=5.93;"
star["HD 37788"] = "ra=05 41 05.59;dec=+00 20 15.7;mag=5.93;"
star["HD 38529"] = "ra=05 46 34.96;dec=+01 10 06.7;mag=5.94;"
star["HD 39421"] = "ra=05 52 07.73;dec=-09 02 31.1;mag=5.95;"
star["HD 37481"] = "ra=05 38 37.97;dec=-06 34 26.2;mag=5.96;"
star["HD 39051"] = "ra=05 50 13.06;dec=+04 25 24.6;mag=5.96;"
star["HD 39286"] = "ra=05 52 23.41;dec=+19 52 04.3;mag=5.96;"
star["HD 37171"] = "ra=05 37 04.35;dec=+11 02 06.2;mag=5.97;"
star["HD 38089"] = "ra=05 42 53.91;dec=-06 47 46.7;mag=5.97;"
star["HD 38858"] = "ra=05 48 34.90;dec=-04 05 38.7;mag=5.97;"
star["HD 39118"] = "ra=05 50 30.03;dec=+02 01 29.0;mag=5.97;"
star["HD 39885"] = "ra=05 56 28.04;dec=+09 30 33.9;mag=5.97;"
star["HD 31331"] = "ra=04 54 50.71;dec=+00 28 01.8;mag=5.98;"
star["HD 35281"] = "ra=05 23 18.51;dec=-08 24 56.1;mag=5.99;"
star["HD 37594"] = "ra=05 39 31.15;dec=-03 33 53.0;mag=5.99;"
star["HD 39775"] = "ra=05 54 44.04;dec=+00 58 07.0;mag=5.99;"
star["HD 44497"] = "ra=06 22 36.42;dec=+12 34 13.1;mag=6.00;"
star["HD 37303"] = "ra=05 37 27.36;dec=-05 56 18.2;mag=6.03;"
star["HD 30545"] = "ra=04 48 44.63;dec=+03 35 18.8;mag=6.04;"
star["HD 32686"] = "ra=05 04 54.53;dec=-03 02 22.8;mag=6.04;"
star["V1031 Ori"] = "ra=05 47 26.90;dec=-10 31 58.5;mag=6.04;"
star["HD 42477"] = "ra=06 11 27.91;dec=+13 38 19.0;mag=6.04;"
star["HD 43285"] = "ra=06 15 40.18;dec=+06 03 58.3;mag=6.07;"
star["HD 33883"] = "ra=05 13 31.55;dec=+01 58 03.7;mag=6.08;"
star["HD 38309"] = "ra=05 45 01.80;dec=+04 00 29.5;mag=6.09;"
star["HD 41076"] = "ra=06 03 24.77;dec=+11 40 51.9;mag=6.09;"
star["W Ori"] = "ra=05 05 23.71;dec=+01 10 39.5;mag=6.10;"
star["HD 30870"] = "ra=04 51 43.38;dec=+09 58 30.3;mag=6.11;"
star["HD 33419"] = "ra=05 10 03.26;dec=-00 33 54.7;mag=6.11;"
star["HD 37232"] = "ra=05 37 19.31;dec=+08 57 06.8;mag=6.11;"
star["HD 43683"] = "ra=06 18 05.61;dec=+14 22 58.3;mag=6.12;"
star["HD 35317"] = "ra=05 23 51.33;dec=-00 51 59.8;mag=6.13;"
star["HD 39632"] = "ra=05 54 13.35;dec=+10 35 11.1;mag=6.13;"
star["HD 31764"] = "ra=04 58 59.41;dec=+14 32 35.7;mag=6.14;"
star["13 Ori"] = "ra=05 07 38.32;dec=+09 28 21.8;mag=6.15;fd=13;"
star["HD 34180"] = "ra=05 15 18.52;dec=-01 24 32.6;mag=6.15;"
star["HD 36558"] = "ra=05 32 37.97;dec=+00 00 43.1;mag=6.15;"
star["HD 37356"] = "ra=05 37 53.39;dec=-04 48 50.5;mag=6.16;"
star["HD 35588"] = "ra=05 25 47.02;dec=+00 31 12.9;mag=6.18;"
star["HD 35693"] = "ra=05 27 13.90;dec=+15 15 27.6;mag=6.18;"
star["CK Ori"] = "ra=05 30 19.91;dec=+04 12 17.5;mag=6.21;"
star["HD 40347"] = "ra=05 58 11.70;dec=-00 59 38.3;mag=6.21;"
star["HD 37744"] = "ra=05 40 37.29;dec=-02 49 30.9;mag=6.22;"
star["HD 40282"] = "ra=05 57 54.51;dec=+01 13 27.5;mag=6.22;"
star["HD 36430"] = "ra=05 31 20.89;dec=-06 42 30.2;mag=6.23;"
star["HD 33555"] = "ra=05 10 57.97;dec=-02 15 13.5;mag=6.24;"
star["HD 35640"] = "ra=05 26 02.36;dec=-05 31 06.6;mag=6.24;"
star["HD 36779"] = "ra=05 34 03.89;dec=-01 02 08.6;mag=6.24;"
star["HD 37016"] = "ra=05 35 22.32;dec=-04 25 27.6;mag=6.24;"
star["HD 38495"] = "ra=05 46 02.86;dec=-04 16 05.9;mag=6.24;"
star["HD 43821"] = "ra=06 18 40.35;dec=+09 02 50.2;mag=6.24;"
star["HD 31623"] = "ra=04 57 17.21;dec=-01 04 01.9;mag=6.25;"
star["HD 36840"] = "ra=05 34 29.29;dec=-00 00 44.4;mag=6.25;"
star["HD 39927"] = "ra=05 55 35.38;dec=-04 47 18.7;mag=6.28;"
star["HD 30869"] = "ra=04 51 49.92;dec=+13 39 18.7;mag=6.30;"
star["HD 39685"] = "ra=05 54 15.72;dec=+03 13 32.8;mag=6.30;"
star["BL Ori"] = "ra=06 25 28.18;dec=+14 43 19.2;mag=6.30;"
star["HD 32115"] = "ra=05 00 39.82;dec=-02 03 57.7;mag=6.31;"
star["V1197 Ori"] = "ra=05 43 09.32;dec=-01 36 47.4;mag=6.31;"
star["HD 43819"] = "ra=06 19 01.85;dec=+17 19 31.0;mag=6.32;"
star["Meissa B"] = "ra=05 35 08.50;dec=+09 56 06.0;mag=6.32;fd=39;"
star["HD 30321"] = "ra=04 46 24.15;dec=-02 57 15.8;mag=6.33;"
star["HD 33946"] = "ra=05 13 47.25;dec=+00 33 37.7;mag=6.33;"
star["HD 34648"] = "ra=05 19 35.28;dec=-01 24 42.8;mag=6.33;"
star["HD 35407"] = "ra=05 24 36.10;dec=+02 21 11.4;mag=6.33;"
star["HD 36285"] = "ra=05 30 20.75;dec=-07 26 05.3;mag=6.33;"
star["HD 31739"] = "ra=04 58 10.90;dec=-02 12 46.0;mag=6.34;"
star["V1649 Ori"] = "ra=05 23 31.08;dec=+05 19 23.0;mag=6.34;"
star["HD 35909"] = "ra=05 28 34.77;dec=+13 40 44.5;mag=6.35;"
star["HD 44867"] = "ra=06 24 52.76;dec=+16 03 26.0;mag=6.35;"
star["HD 35775"] = "ra=05 27 15.40;dec=+02 20 28.3;mag=6.36;"
star["HD 42351"] = "ra=06 11 01.77;dec=+18 07 49.7;mag=6.37;"
star["HD 43358"] = "ra=06 15 53.98;dec=+01 10 08.4;mag=6.37;"
star["HD 36058"] = "ra=05 28 56.91;dec=-03 18 26.7;mag=6.39;"
star["θ2 Ori B"] = "ra=05 35 26.40;dec=-05 25 00.7;mag=6.38;fd=43;"
star["HD 43335"] = "ra=06 16 23.79;dec=+17 10 53.9;mag=6.39;"
star["HD 34880"] = "ra=05 20 26.41;dec=-05 22 03.1;mag=6.40;"
star["V1377 Ori"] = "ra=05 35 35.90;dec=-03 15 10.2;mag=6.40;"
star["HD 35656"] = "ra=05 26 38.82;dec=+06 52 07.5;mag=6.41;"
star["HD 35912"] = "ra=05 28 01.47;dec=+01 17 53.7;mag=6.41;"
star["HD 37904"] = "ra=05 41 40.31;dec=-02 53 47.5;mag=6.41;"
star["HD 31423"] = "ra=04 56 09.02;dec=+07 54 17.3;mag=6.42;"
star["HD 34317"] = "ra=05 16 41.05;dec=+01 56 50.4;mag=6.42;"
star["HD 34878"] = "ra=05 20 43.74;dec=+02 32 41.0;mag=6.43;"
star["V1357 Ori"] = "ra=06 13 12.46;dec=+10 37 40.3;mag=6.44;"
star["HD 35575"] = "ra=05 25 36.50;dec=-01 29 28.7;mag=6.44;"
star["HD 32273"] = "ra=05 02 00.03;dec=+01 36 31.8;mag=6.45;"
star["HD 36814"] = "ra=05 34 02.48;dec=-07 01 25.1;mag=6.45;"
star["V1389 Ori"] = "ra=06 12 59.57;dec=+06 00 58.6;mag=6.45;"
star["HD 37808"] = "ra=05 40 46.19;dec=-10 24 31.2;mag=6.46;"
star["V1369 Ori"] = "ra=05 21 19.31;dec=+04 00 43.1;mag=6.49;"
star["HD 36150"] = "ra=05 29 41.59;dec=-00 48 08.7;mag=6.49;"
star["HD 37635"] = "ra=05 39 30.84;dec=-09 42 23.8;mag=6.49;"
star["HD 31411"] = "ra=04 55 58.36;dec=+05 23 56.6;mag=6.50;"
star["HD 37150"] = "ra=05 36 15.03;dec=-05 38 52.5;mag=6.51;"
star["HD 37808"] = "ra=05 40 46.19;dec=-10 24 31.1;mag=6.52;"
star["HD 37017"] = "ra=05 35 21.87;dec=-04 29 39.0;mag=6.56;"
star["σ Ori E"] = "ra=05 38 47.19;dec=-02 35 40.5;mag=6.61;fd=48;"
star["HD 43317"] = "ra=06 15 47.01;dec=+04 17 01.1;mag=6.62;"
star["σ Ori D"] = "ra=05 38 45.62;dec=-02 35 58.9;mag=6.62;fd=48;"
star["θ1 Ori D"] = "ra=05 35 17.20;dec=-05 23 15.7;mag=6.71;fd=41;"
star["θ1 Ori A"] = "ra=05 35 15.82;dec=-05 23 14.3;mag=6.73;fd=41;"
star["HD 35155"] = "ra=05 22 18.64;dec=-08 35 58.0;mag=6.77;"
star["Mintaka C"] = "ra=05 32 00.50;dec=-00 17 04.0;mag=6.83;fd=34;"
star["HD 42618"] = "ra=06 12 01.0s;dec=+06 46 59″;mag=6.84;"
star["KX Ori"] = "ra=05 35 04.79;dec=-04 43 54.6;mag=6.90;"
star["Gliese 205"] = "ra=05 31 27.50;dec=-03 40 38.0;mag=6.97;"
star["V901 Ori"] = "ra=05 40 56.37;dec=-01 30 25.9;mag=6.97;"
edge["Ori"] = "1=Betelgeuse-Alnitak A;2=Alnitak A-Saiph;3=Saiph-Rigel;"
edge["Ori"] = edge["Ori"] + "4=Rigel-Mintaka AB;5=Mintaka AB-Bellatrix;"
edge["Ori"] = edge["Ori"] + "6=Bellatrix-Betelgeuse;7=Betelgeuse-μ Ori;"
edge["Ori"] = edge["Ori"] + "8=μ Ori-ξ Ori;9=ξ Ori-ν Ori;"
edge["Ori"] = edge["Ori"] + "10=Bellatrix-ο2 Ori;11=ο2 Ori-π2 Ori;"
edge["Ori"] = edge["Ori"] + "12=π2 Ori-π3 Ori;13=π3 Ori-π4 Ori;"
edge["Ori"] = edge["Ori"] + "14=π4 Ori-π5 Ori;"
radiant = "ra=06 15 00.00;dec=+16 00 00.0;"
EndSub

Sub Cal_Init
' Calendar | Initialize days of month
WQ = Text.GetCharacter(34)
CRLF = Text.GetCharacter(13) + Text.GetCharacter(10)
iDoM = "1=31;2=28;3=31;4=30;5=31;6=30;7=31;8=31;9=30;10=31;11=30;12=31;"
months = "1=January;2=February;3=March;4=April;5=May;6=June;7=July;"
months = months + "8=August;9=September;10=October;11=November;12=December;"
symbols = "1=♑;2=♒;3=♓;4=♈;5=♉;6=♊;7=♋;8=♌;9=♍;10=♎;11=♏;12=♐;"
EndSub

Sub Cal_DrawMonth
' Calendar | Print month
' param iM - month
' param iDoY - days of year
' param iWoY - week of year
If silverlight Then
Program.Delay(msWait)
EndIf
GraphicsWindow.FontSize = 16
GraphicsWindow.FontName = "Consolas"
iW = Math.Remainder((iDoY + iWoY), 7)
line = "SUN MON TUE WED THU FRI SAT" + CRLF
iWoM = 0
While iWoM < iW
line = line + " "
iWoM = iWoM + 1
EndWhile
For iD = 1 To iDoM[iM]
If iD < 10 Then
line = line + " " + iD + " "
Else
line = line + " " + iD + " "
EndIf
If Math.Remainder(iWoM, 7) = 6 Then
line = line + CRLF
EndIf
iWoM = iWoM + 1
EndFor
If Math.Remainder(iWoM, 7) > 0 Then
line = line + CRLF
EndIf
cal = Shapes.AddText(line)
Shapes.Move(cal, calendarX, calendarY)
EndSub

Sub Command_GetArgs
' Command line | Get arguments
' param sBuf - input buffer
' return sArg[] - arguments
' return iN - number of arguments
iP = 1 ' buffer pointer
iN = 1 ' number of args
iC = Text.GetIndexOf(sBuf, ",") ' index of comma
While iC > iP
sArg[iN] = Text.GetSubText(sBuf, iP, iC - iP)
iP = iC + 1
iN = iN + 1
iC = Text.GetIndexOf(sBuf, ",")
EndWhile
iE = Text.GetLength(sBuf) + 1 ' end of buffer
sArg[iN] = Text.GetSubText(sBuf, iP, iE - iP)
EndSub

Sub Math_CartesianToPolar
' Math | convert cartesian coodinate to polar coordinate
' param x, y - cartesian coordinate
' return r, a - polar coordinate
r = Math.SquareRoot(x * x + y * y)
If x = 0 And y > 0 Then
a = 90 ' [degree]
ElseIf x = 0 And y < 0 Then
a = -90
ElseIf x = 0 Then
a = 0
Else
a = Math.ArcTan(y / x) * 180 / Math.Pi
EndIf
If x < 0 Then
a = a + 180
ElseIf x > 0 And y < 0 Then
a = a + 360
EndIf
EndSub

Sub SB_RotateWorkaround
' Small Basic | Rotate workaround for Silverlight
' param shp - current shape
' param x, y - original coordinate
' param alpha - angle [radian]
' returns x, y - workaround coordinate
If shp["func"] = "tri" Then
x1 = -Math.Floor(shp["x3"] / 2)
y1 = -Math.Floor(shp["y3"] / 2)
ElseIf shp["func"] = "line" Then
x1 = -Math.Floor(Math.Abs(shp["x1"] - shp["x2"]) / 2)
y1 = -Math.Floor(Math.Abs(shp["y1"] - shp["y2"]) / 2)
EndIf
ox = x - x1
oy = y - y1
x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox
y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy
EndSub

Sub SB_Workaround
' Small Basic | Workaround for Silverlight
' returns silverlight - "True" if in remote
color = GraphicsWindow.GetPixel(0, 0)
If Text.GetLength(color) > 7 Then
silverlight = "True"
msWait = 300
Else
silverlight = "False"
EndIf
EndSub

Sub Shapes_Add
' Shapes | add shapes as shapes data
' param iMin, iMax - shape indices to add
' param shape - array of shapes
' param scale - 1 if same scale
' return shWidth, shHeight - total size of shapes
' return shAngle - current angle of shapes
Stack.PushValue("local", i)
Stack.PushValue("local", x)
Stack.PushValue("local", y)
Shapes_CalcWidthAndHeight()
s = scale
For i = iMin To iMax
shp = shape[i]
GraphicsWindow.PenWidth = shp["pw"] * s
If shp["pw"] > 0 Then
GraphicsWindow.PenColor = shp["pc"]
EndIf
If Text.IsSubText("rect|ell|tri|text", shp["func"]) Then
GraphicsWindow.BrushColor = shp["bc"]
EndIf
If shp["func"] = "rect" Then
shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s)
ElseIf shp["func"] = "ell" Then
shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s)
ElseIf shp["func"] = "tri" Then
shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s)
ElseIf shp["func"] = "line" Then
shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s)
ElseIf shp["func"] = "text" Then
If silverlight Then
fs = Math.Floor(shp["fs"] * 0.9)
Else
fs = shp["fs"]
EndIf
GraphicsWindow.FontSize = fs * s
GraphicsWindow.FontName = shp["fn"]
shp["obj"] = Shapes.AddText(shp["text"])
EndIf
x = shp["x"]
y = shp["y"]
shp["rx"] = x
shp["ry"] = y
If silverlight And Text.IsSubText("tri|line", shp["func"]) Then
alpha = Math.GetRadians(shp["angle"])
SB_RotateWorkaround()
shp["wx"] = x
shp["wy"] = y
EndIf
Shapes.Move(shp["obj"], shX + x * s, shY + y * s)
If Text.IsSubText("rect|ell|tri|text", shp["func"]) And (shp["angle"] <> 0) And (shp["angle"] <> "") Then
Shapes.Rotate(shp["obj"], shp["angle"])
EndIf
shape[i] = shp
EndFor
shAngle = 0
y = Stack.PopValue("local")
x = Stack.PopValue("local")
i = Stack.PopValue("local")
EndSub

Sub Shapes_CalcWidthAndHeight
' Shapes | Calculate total width and height of shapes
' param iMin, iMax - shape indices to add
' return shWidth, shHeight - total size of shapes
For i = iMin To iMax
shp = shape[i]
If shp["func"] = "tri" Or shp["func"] = "line" Then
xmin = shp["x1"]
xmax = shp["x1"]
ymin = shp["y1"]
ymax = shp["y1"]
If shp["x2"] < xmin Then
xmin = shp["x2"]
EndIf
If xmax < shp["x2"] Then
xmax = shp["x2"]
EndIf
If shp["y2"] < ymin Then
ymin = shp["y2"]
EndIf
If ymax < shp["y2"] Then
ymax = shp["y2"]
EndIf
If shp["func"] = "tri" Then
If shp["x3"] < xmin Then
xmin = shp["x3"]
EndIf
If xmax < shp["x3"] Then
xmax = shp["x3"]
EndIf
If shp["y3"] < ymin Then
ymin = shp["y3"]
EndIf
If ymax < shp["y3"] Then
ymax = shp["y3"]
EndIf
EndIf
shp["width"] = xmax - xmin
shp["height"] = ymax - ymin
EndIf
If i = 1 Then
shWidth = shp["x"] + shp["width"]
shHeight = shp["y"] + shp["height"]
Else
If shWidth < shp["x"] + shp["width"] Then
shWidth = shp["x"] + shp["width"]
EndIf
If shHeight < shp["y"] + shp["height"] Then
shHeight = shp["y"] + shp["height"]
EndIf
EndIf
shape[i] = shp
EndFor
EndSub

Sub Shapes_Init
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 274 ' x offset
shY = 32 ' y offset
shape = ""
shape[1] = "func=rect;x=94;y=96;width=41;height=46;angle=336;bc=#BC7749;pw=0;"
shape[2] = "func=tri;x=125;y=98;x1=7;y1=0;x2=0;y2=18;x3=15;y3=18;angle=326;bc=#BC7749;pw=0;"
shape[3] = "func=rect;x=104;y=138;width=21;height=24;angle=351;bc=#BC7749;pw=0;"
shape[4] = "func=rect;x=49;y=141;width=29;height=22;angle=19;bc=#BC7749;pw=0;"
shape[5] = "func=ell;x=64;y=140;width=32;height=33;bc=#90321D;pw=0;"
shape[6] = "func=rect;x=155;y=142;width=29;height=22;angle=313;bc=#BC7749;pw=0;"
shape[7] = "func=ell;x=141;y=146;width=32;height=33;bc=#90321D;pw=0;"
shape[8] = "func=rect;x=36;y=83;width=15;height=67;angle=350;bc=#BC7749;pw=0;"
shape[9] = "func=tri;x=81;y=171;x1=39;y1=0;x2=0;y2=114;x3=78;y3=114;angle=178;bc=#90321D;pw=0;"
shape[10] = "func=rect;x=95;y=152;width=44;height=32;angle=7;bc=#BC7749;pw=0;"
shape[11] = "func=rect;x=58;y=140;width=14;height=26;angle=21;bc=#90321D;pw=0;"
shape[12] = "func=rect;x=159;y=142;width=14;height=26;angle=320;bc=#90321D;pw=0;"
shape[13] = "func=rect;x=85;y=144;width=17;height=41;angle=7;bc=#90321D;pw=0;"
shape[14] = "func=rect;x=133;y=153;width=14;height=35;angle=8;bc=#90321D;pw=0;"
shape[15] = "func=ell;x=40;y=137;width=16;height=21;bc=#BC7749;pw=0;"
shape[16] = "func=rect;x=108;y=99;width=17;height=8;bc=#612800;pw=0;"
shape[17] = "func=ell;x=115;y=106;width=9;height=9;bc=#000000;pw=0;"
shape[18] = "func=rect;x=139;y=237;width=61;height=29;bc=#BC7749;pw=0;"
shape[19] = "func=ell;x=184;y=237;width=33;height=31;bc=#BC7749;pw=0;"
shape[20] = "func=rect;x=177;y=252;width=23;height=71;angle=27;bc=#BC7749;pw=0;"
shape[21] = "func=rect;x=93;y=259;width=33;height=65;angle=4;bc=#BC7749;pw=0;"
shape[22] = "func=ell;x=90;y=310;width=33;height=31;bc=#BC7749;pw=0;"
shape[23] = "func=rect;x=81;y=325;width=23;height=71;angle=27;bc=#BC7749;pw=0;"
shape[24] = "func=rect;x=159;y=316;width=46;height=23;angle=27;bc=#BC7749;pw=0;"
shape[25] = "func=ell;x=154;y=311;width=21;height=20;bc=#BC7749;pw=0;"
shape[26] = "func=ell;x=195;y=339;width=11;height=11;bc=#BC7749;pw=0;"
shape[27] = "func=ell;x=199;y=336;width=14;height=6;angle=29;bc=#BC7749;pw=0;"
shape[28] = "func=ell;x=199;y=332;width=14;height=6;angle=29;bc=#BC7749;pw=0;"
shape[29] = "func=ell;x=200;y=329;width=14;height=6;angle=29;bc=#BC7749;pw=0;"
shape[30] = "func=ell;x=60;y=383;width=21;height=20;bc=#BC7749;pw=0;"
shape[31] = "func=rect;x=70;y=390;width=46;height=23;angle=27;bc=#BC7749;pw=0;"
shape[32] = "func=line;x=100;y=162;x1=0;y1=0;x2=35;y2=6;pc=#331500;pw=4;"
shape[33] = "func=line;x=98;y=170;x1=0;y1=0;x2=37;y2=6;pc=#331500;pw=4;"
shape[34] = "func=ell;x=74;y=83;width=51;height=22;angle=337;bc=#612800;pw=0;"
shape[35] = "func=ell;x=75;y=95;width=27;height=53;angle=355;bc=#612800;pw=0;"
shape[36] = "func=ell;x=119;y=128;width=24;height=11;angle=350;bc=#612800;pw=0;"
shape[37] = "func=ell;x=109;y=75;width=11;height=12;bc=#612800;pw=0;"
shape[38] = "func=ell;x=113;y=128;width=11;height=12;bc=#612800;pw=0;"
shape[39] = "func=ell;x=104;y=127;width=11;height=12;bc=#612800;pw=0;"
shape[40] = "func=ell;x=135;y=124;width=11;height=12;bc=#612800;pw=0;"
shape[41] = "func=ell;x=97;y=121;width=11;height=12;bc=#612800;pw=0;"
shape[42] = "func=ell;x=115;y=85;width=11;height=12;bc=#612800;pw=0;"
shape[43] = "func=ell;x=117;y=76;width=11;height=12;bc=#612800;pw=0;"
shape[44] = "func=ell;x=98;y=75;width=11;height=12;bc=#612800;pw=0;"
shape[45] = "func=ell;x=92;y=78;width=11;height=12;bc=#612800;pw=0;"
shape[46] = "func=ell;x=79;y=83;width=11;height=12;bc=#612800;pw=0;"
shape[47] = "func=ell;x=72;y=91;width=11;height=12;bc=#612800;pw=0;"
shape[48] = "func=ell;x=69;y=102;width=11;height=12;bc=#612800;pw=0;"
shape[49] = "func=ell;x=68;y=113;width=11;height=12;bc=#612800;pw=0;"
shape[50] = "func=ell;x=70;y=124;width=11;height=12;bc=#612800;pw=0;"
shape[51] = "func=ell;x=74;y=134;width=11;height=12;bc=#612800;pw=0;"
shape[52] = "func=ell;x=93;y=133;width=11;height=12;bc=#612800;pw=0;"
shape[53] = "func=line;x=174;y=316;x1=15;y1=0;x2=0;y2=21;pc=#331500;pw=4;"
shape[54] = "func=line;x=182;y=321;x1=15;y1=0;x2=0;y2=22;pc=#331500;pw=4;"
shape[55] = "func=line;x=82;y=389;x1=12;y1=0;x2=0;y2=19;pc=#331500;pw=4;"
shape[56] = "func=line;x=91;y=393;x1=12;y1=0;x2=0;y2=20;pc=#331500;pw=4;"
shape[57] = "func=line;x=176;y=282;x1=0;y1=0;x2=24;y2=11;pc=#331500;pw=4;"
shape[58] = "func=line;x=165;y=308;x1=0;y1=0;x2=25;y2=7;pc=#331500;pw=4;"
shape[59] = "func=line;x=79;y=358;x1=0;y1=0;x2=24;y2=9;pc=#331500;pw=4;"
shape[60] = "func=line;x=68;y=379;x1=0;y1=0;x2=26;y2=6;pc=#331500;pw=4;"
shape[61] = "func=line;x=161;y=294;x1=0;y1=14;x2=37;y2=0;pc=#331500;pw=4;"
shape[62] = "func=line;x=68;y=368;x1=0;y1=11;x2=33;y2=0;pc=#331500;pw=4;"
shape[63] = "func=ell;x=84;y=233;width=23;height=55;angle=6;bc=#AA9988;pw=0;"
shape[64] = "func=ell;x=97;y=235;width=62;height=39;angle=341;bc=#AA9988;pw=0;"
shape[65] = "func=ell;x=140;y=226;width=54;height=26;angle=359;bc=#AA9988;pw=0;"
shape[66] = "func=ell;x=85;y=257;width=37;height=38;angle=354;bc=#AA9988;pw=0;"
shape[67] = "func=ell;x=135;y=249;width=48;height=23;angle=341;bc=#AA9988;pw=0;"
shape[68] = "func=ell;x=113;y=252;width=37;height=38;angle=354;bc=#AA9988;pw=0;"
shape[69] = "func=ell;x=97;y=243;width=2;height=0;bc=#FFFFFF;pw=0;"
shape[70] = "func=ell;x=103;y=234;width=17;height=18;bc=#FFFFFF;pc=#AA8327;pw=4;"
shape[71] = "func=ell;x=116;y=231;width=17;height=18;bc=#FFFFFF;pc=#AA8327;pw=4;"
shape[72] = "func=ell;x=129;y=228;width=17;height=18;bc=#FFFFFF;pc=#AA8327;pw=4;"
shape[73] = "func=rect;x=107;y=232;width=10;height=12;bc=#FFFFFF;pw=0;"
shape[74] = "func=rect;x=119;y=232;width=10;height=12;angle=348;bc=#FFFFFF;pw=0;"
shape[75] = "func=rect;x=131;y=227;width=10;height=12;angle=337;bc=#FFFFFF;pw=0;"
shape[76] = "func=ell;x=97;y=232;width=10;height=19;bc=#FFFFFF;pc=#AA8327;pw=4;"
shape[77] = "func=ell;x=141;y=221;width=10;height=19;angle=335;bc=#FFFFFF;pc=#AA8327;pw=4;"
shape[78] = "func=rect;x=101;y=231;width=3;height=12;angle=5;bc=#FFFFFF;pw=0;"
shape[79] = "func=rect;x=143;y=222;width=3;height=12;angle=335;bc=#FFFFFF;pw=0;"
shape[80] = "func=tri;x=55;y=271;x1=8;y1=0;x2=0;y2=23;x3=16;y3=23;angle=245;bc=#2E2E2E;pw=0;"
shape[81] = "func=rect;x=70;y=260;width=49;height=16;angle=336;bc=#2E2E2E;pw=0;"
shape[82] = "func=rect;x=116;y=243;width=36;height=14;angle=334;bc=#90321D;pw=0;"
shape[83] = "func=rect;x=116;y=237;width=6;height=41;angle=333;bc=#666666;pw=0;"
shape[84] = "func=ell;x=106;y=229;width=13;height=15;bc=#666666;pw=0;"
shape[85] = "func=ell;x=118;y=270;width=13;height=15;bc=#666666;pw=0;"
shape[86] = "func=line;x=123;y=246;x1=0;y1=0;x2=6;y2=13;pw=0;"
shape[87] = "func=line;x=123;y=246;x1=0;y1=0;x2=6;y2=14;pc=#331500;pw=4;"
shape[88] = "func=line;x=129;y=244;x1=0;y1=0;x2=6;y2=12;pc=#331500;pw=4;"
shape[89] = "func=line;x=134;y=241;x1=0;y1=0;x2=6;y2=12;pc=#331500;pw=4;"
shape[90] = "func=line;x=142;y=238;x1=0;y1=0;x2=4;y2=13;pc=#331500;pw=4;"
shape[91] = "func=ell;x=21;y=58;width=33;height=29;angle=323;bc=#BC7749;pw=0;"
shape[92] = "func=rect;x=3;y=45;width=129;height=14;angle=329;bc=#984106;pw=0;"
shape[93] = "func=ell;x=0;y=79;width=17;height=16;bc=#984106;pw=0;"
shape[94] = "func=ell;x=75;y=8;width=80;height=31;angle=332;bc=#984106;pw=0;"
shape[95] = "func=ell;x=135;y=58;width=2;height=2;bc=#984106;pw=0;"
shape[96] = "func=ell;x=59;y=36;width=28;height=11;angle=328;bc=#984106;pw=0;"
shape[97] = "func=ell;x=75;y=42;width=28;height=11;angle=334;bc=#984106;pw=0;"
shape[98] = "func=ell;x=108;y=0;width=28;height=11;angle=344;bc=#984106;pw=0;"
shape[99] = "func=ell;x=125;y=13;width=25;height=15;angle=321;bc=#984106;pw=0;"
shape[100] = "func=ell;x=43;y=64;width=11;height=10;bc=#BC7749;pw=0;"
shape[101] = "func=ell;x=37;y=48;width=9;height=16;angle=343;bc=#BC7749;pw=0;"
shape[102] = "func=ell;x=31;y=52;width=9;height=16;angle=343;bc=#BC7749;pw=0;"
shape[103] = "func=ell;x=26;y=57;width=9;height=16;angle=343;bc=#BC7749;pw=0;"
shape[104] = "func=ell;x=21;y=63;width=9;height=16;angle=343;bc=#BC7749;pw=0;"
shape[105] = "func=ell;x=226;y=64;width=29;height=96;angle=346;bc=#AB7630;pw=0;"
shape[106] = "func=ell;x=224;y=109;width=29;height=96;angle=346;bc=#AB7630;pw=0;"
shape[107] = "func=ell;x=210;y=130;width=29;height=96;angle=346;bc=#AB7630;pw=0;"
shape[108] = "func=ell;x=187;y=110;width=29;height=96;angle=346;bc=#AB7630;pw=0;"
shape[109] = "func=ell;x=170;y=125;width=18;height=49;bc=#4F3112;pw=0;"
shape[110] = "func=ell;x=178;y=104;width=18;height=49;bc=#4F3112;pw=0;"
shape[111] = "func=ell;x=190;y=90;width=18;height=49;bc=#4F3112;pw=0;"
shape[112] = "func=ell;x=202;y=83;width=18;height=49;bc=#4F3112;pw=0;"
shape[113] = "func=ell;x=213;y=66;width=18;height=49;bc=#4F3112;pw=0;"
shape[114] = "func=ell;x=224;y=57;width=18;height=49;bc=#4F3112;pw=0;"
shape[115] = "func=ell;x=218;y=90;width=18;height=49;bc=#4F3112;pw=0;"
shape[116] = "func=ell;x=209;y=111;width=18;height=49;bc=#4F3112;pw=0;"
shape[117] = "func=ell;x=196;y=120;width=18;height=49;bc=#4F3112;pw=0;"
shape[118] = "func=ell;x=183;y=128;width=18;height=49;bc=#4F3112;pw=0;"
shape[119] = "func=ell;x=223;y=245;width=18;height=49;bc=#4F3112;pw=0;"
shape[120] = "func=rect;x=228;y=186;width=8;height=63;bc=#AB7630;pw=0;"
shape[121] = "func=tri;x=224;y=133;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[122] = "func=tri;x=215;y=147;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[123] = "func=tri;x=220;y=140;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[124] = "func=tri;x=206;y=153;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[125] = "func=tri;x=199;y=162;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[126] = "func=tri;x=189;y=168;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[127] = "func=tri;x=175;y=165;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[128] = "func=tri;x=232;y=273;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[129] = "func=tri;x=223;y=277;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
shape[130] = "func=tri;x=228;y=284;x1=4;y1=0;x2=0;y2=25;x3=9;y3=25;angle=181;bc=#4F3112;pw=0;"
EndSub

Sub Shapes_Move
' Shapes | Move shapes
' param iMin, iMax - shape indices to add
' param shape - array of shapes
' param scale - to zoom
' param x, y - position to move
' return shX, shY - new position of shapes
Stack.PushValue("local", i)
s = scale
shX = x
shY = y
For i = iMin To iMax
shp = shape[i]
If silverlight And Text.IsSubText("tri|line", shp["func"]) Then
_x = shp["wx"]
_y = shp["wy"]
Else
_x = shp["rx"]
_y = shp["ry"]
EndIf
Shapes.Move(shp["obj"], shX + _x * s, shY + _y * s)
EndFor
i = Stack.PopValue("local")
EndSub