Small Basic: picture of the earth and the moon (código). Scaled distances


earth

Nonki Takahashi  This is my sample of community suggestion 1 (2) Draw a picture of the earth and the moon. (with scaled distances)
http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/bce001cb-ce65-4d23-8645-466098928115/
……………………………………………………………………………………………………………
re = 6378 ‘ equatorial radius of the earth [km]
rm = 1738 ‘ equatorial radius of the moon [km]
ro = 834400 ‘ radius of the orbit of the moon [km]
km = 1 / rm ‘ [px/km]
GraphicsWindow.BackgroundColor = “Black”
‘ draw the earth
GraphicsWindow.BrushColor = “Blue”
x = 40
y = 200
r = re * km
GraphicsWindow.FillEllipse(x – r, y – r, 2 * r, 2 * r)
GraphicsWindow.BrushColor = “Gray”
GraphicsWindow.DrawText(x – r, y + 10, “the earth”)
‘ draw the moon
GraphicsWindow.BrushColor = “Silver”
x = x + ro * km
r = rm * km
GraphicsWindow.FillEllipse(x – r, y – r, 2 * r, 2 * r)
GraphicsWindow.BrushColor = “Gray”
GraphicsWindow.DrawText(x – r, y + 10, “the moon”)

Deja un comentario