Program+15

Program #15 The Sine Wave  (It has its Ups and Downs)



Yes, anyone can draw a straight line ... But I want you to draw a wavy line (Don't make the amplitude too big ... I get sea-sick). The secret is converting a coordinate (Hint: the Y) to an occillating value. Convert decimal to radian measure. How do I do it? Radians = Degrees * 3.1415 / 180. Then you can uses Sin(Radians) and CoS(Radians) to get the sine warve (blue) and cosine wave (red).

Please use the subroutine below to draw blue, and red balls.