Algorithm - Simulation of Elliptical orbit
- Start the program
- Set screen size and caption
- Create clock variable
- Set x and y radius of ellipse.
- 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.
- Convert degree to radians (degree * 2 * math.pi / 360)
- Set background color, draw center circle, ellipse and another smaller circle on the ellipse
- Refresh the screen every 5 clock ticks
- Repeat steps 4 to 8 until user quits
the program
- Stop the program
while converting to radians why we multiply with xradius and add xradius+50
ReplyDeleteThanks, Dr. Anurekha, for such helpful material. Your generosity brightens one's day!
ReplyDelete