I have never used the timer object before and I am having problems. It seems to calculate for the first time interval and then stops firing. I have placed the following code in the action event of the timer.
Dim vel as double
Dim theta as double
dim r as double
//Add a degree every time interval
Theta = theta + 1
r = sma*(1-ecc^2)/(1+ecccos(thetaPi/180))
vel = (GM(2/r-1/sma))^0.5
TxtVel.text = str(vel)
The program is supposed to display the changing speed of a planet as it orbits the sun. SMA , ecc, G and M are global properties or constants. The velocity should be calculated at 1 degree intervals per period. The code appears to work in so much that it displays the correct answer for the first period but it then stops. Can anybody tell me where I am going wrong.