I am looking for alittle help, I am trying to create a program which demonstrates the orbit of a object: I have code of how to do this with a older programming language. But when I try to implement in java it fails. I was hoping I could have some help transferring it over to java, thank you.

here's the older programming program:

Code :

rem initial conditions
rem assume m = 1, M = 1, G = 1, R = 1
rem period should be 2pi
x = 0
y = 1.0
vx = 1.0
vy = 1.0
dt = 0.1
t = 0
rem move velocity back by half a time step
rem not position, just velocity
rem this is "leapfrog" time integration method
r = sqrt(x^2 + y^2)
F = 1/(r^2)
ax = -F*x/r
ay = -F*y/r
vx = vx - 0.5*ax*dt
vy = vy - 0.5*ay*dt
open "data.txt" for output as #1
print #1, x, y
graphics 0
pset(250,200)
graphics circle 10
rem loop for about 10 orbits
while t<2000000
rem polar coordinates
r = sqrt(x^2 + y^2)
F = 1/(r^2)
ax = -F*x/r
ay = -F*y/r
vx = vx + ax*dt
vy = vy + ay*dt
rem move the object
x = x + vx*dt
y = y + vy*dt
print #1, x, y
pset (20*x+200, 20*y+200)
graphics circle 2
t = t + dt
wend

thanks ]]>