Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.mso.anu.edu.au/pfrancis/simulations/51Peg.py
Дата изменения: Wed Oct 2 15:44:25 2013
Дата индексирования: Sun Apr 10 03:43:47 2016
Кодировка:
from __future__ import division
from visual import *
import random
import math

scene = display(range=(16.0,16.0,16.0),width=1300,height=800,forward=(0.2,1.0,0.0))

scene.lights=[]
scene.ambient = color.red

theta = 0.0

dstar = 1.0
starpos = (-dstar*math.cos(theta),0.0,-dstar*math.sin(theta))
starrad = 0.85
starcol = (0.9,0.9,0.8)

starlight = local_light(pos=starpos,
color=starcol)
star = sphere(pos = starpos, radius = starrad, color=starcol,
material=materials.emissive)

dplanet = 7.9
planetpos = (dplanet*math.cos(theta),0.0,dplanet*math.sin(theta))
planetrad = 0.35
planetcol = (0.7,0.4,0.1)

planet = sphere(pos = planetpos, radius=planetrad, color=planetcol)

dtheta = 0.001
while 1:
rate(100)
theta += dtheta
planetpos = (dplanet*math.cos(theta),0.0,dplanet*math.sin(theta))
planet.pos = planetpos
starpos = (-dstar*math.cos(theta),0.0,-dstar*math.sin(theta))
star.pos = starpos
starlight.pos = starpos