Algorithm - Simulation of Elliptical Orbit

Algorithm - Simulation of Elliptical orbit
  1.     Start the program
  2.     Set screen size and caption
  3.     Create clock variable
  4.     Set x and y radius of ellipse.
  5.     Starting from degree 0 ending with 360 degrees in increments of 10 degrees  calculate the (x1, y1) coordinates to find a point in the elliptical orbit.
  6.     Convert degree to radians (degree * 2 * math.pi / 360)
  7.     Set background color, draw center circle, ellipse and another smaller circle on the ellipse
  8.     Refresh the screen every 5 clock ticks
  9.     Repeat steps 4 to 8 until user quits the program
  10.     Stop the program


2 comments:

  1. while converting to radians why we multiply with xradius and add xradius+50

    ReplyDelete
  2. Thanks, Dr. Anurekha, for such helpful material. Your generosity brightens one's day!

    ReplyDelete

Don't be a silent reader...
Leave your comments...

Anu