Identification Division.
Program-Id. Planet.
* from Stauffer/Stanley
* From Newton to Mandelbrot
* Springer 1996
Data Division.
Working-Storage Section.
77 vx pic S9(4)V9(4).
77 vy pic S9(4)V9(4).
77 dt pic S9(4)V9(4).
Procedure Division.
display "vx, vy,dt="
accept vx,vy,dt
move 0 to x
move 1 to y
L40.
compute r2=x*x+y*y
compute r3=dt/(r2*function sqrt(r2))
compute vx=vx-x*r3
compute vy=vy-y*r3
compute x=x+dt*vx
compute y=y+dt*vy
display x, v
go to L40.
End-Program Planet.
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
|
Haftungshinweis
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.
|