File: solar_system.kbs

package info (click to toggle)
basic256 2.0.99.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,888 kB
  • sloc: cpp: 17,185; yacc: 4,025; lex: 1,466; java: 1,091; sh: 39; xml: 33; makefile: 20
file content (99 lines) | stat: -rw-r--r-- 1,697 bytes parent folder | download | duplicates (2)
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
# Solar System
#
# 2016, Open Source
# info@gunterheim.de
#
# The eight planets circling the sun
# Mercurius: 88 Tage
# Venus: 224 days
# Earth: 365 days
# Mars: 687 days
# Jupiter: 11,86 years
# Saturnus: 29 years
# Uranus: 84 years
# Neptune: 164,8 years
#
# Initializiations
keyboard=0
time=0
tick = 1/365		# speed
#
# Preparing graphics output
Graphsize 300,300
Fastgraphics
#
cls
print "Roundabout position of planets"
print "Stop with whitespace"

# Simulate until whitespace is hit
while keyboard <>32
	keyboard=key
	#
	# Deleting graphcis
	clg black
	#
	# years since start of simulation
	color white
	time = time + tick
	text 0,0,left(time + "0000",7) + " years"
	#
	# Sun
	color yellow
	circle 150,150,4
	#
	# Mercurius
	x1=10*cos(time*2*pi/88*365)+150
	y1=10*sin(time*2*pi/88*365)+150
	color darkyellow
	circle x1,y1,2
	#
	# Venus
	x2=20*cos(time*2*pi/224*365)+150
	y2=20*sin(time*2*pi/224*365)+150
	color grey
	circle x2,y2,2
	#
	# Earth
	x3=30*cos(time*2*pi)+150
	y3=30*sin(time*2*pi)+150
	color blue
	circle x3,y3,2
	#
	# Mars
	x4=45*cos(time*2*pi/687*365)+150
	y4=45*sin(time*2*pi/687*365)+150
	color red
	circle x4,y4,2
	#
	# Jupiter
	x5=70*cos(time*2*pi/4329*365)+150
	y5=70*sin(time*2*pi/4329*365)+150
	color orange
	circle x5,y5,3
	#
	# Saturnus
	x6=90*cos(time*2*pi/10585*365)+150
	y6=90*sin(time*2*pi/10585*365)+150
	color white
	circle x6,y6,3
	#
	# Uranus
	x7=110*cos(time*2*pi/30660*365)+150
	y7=110*sin(time*2*pi/30660*365)+150
	color darkgreen
	circle x7,y7,3
	#
	# Neptunus
	x8=130*cos(time*2*pi/60152*365)+150
	y8=130*sin(time*2*pi/60152*365)+150
	color darkblue
	circle x8,y8,3
	#
	# Draw everything
	refresh
	#
end while
print
print "The simulation was stopped."
end