File tree Expand file tree Collapse file tree 7 files changed +41
-0
lines changed Expand file tree Collapse file tree 7 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -106,3 +106,4 @@ SR No | Project | Author
10610699 | [ Find IMDB Ratings] ( https://github.com/chavarera/python-mini-projects/tree/master/projects/Find_imdb_rating ) | [ Utkarsh Bajaj] ( https://github.com/utkarshbajaj ) 
107107100 | [ Terminal Based Hangman Game] ( https://github.com/chavarera/python-mini-projects/tree/master/projects/Terminal_Based_Hangman_Game ) | [ neohboonyee99] ( https://github.com/neohboonyee99 ) 
108108101 | [ Diff Utility] ( https://github.com/Python-World/python-mini-projects/tree/master/projects/Diff_Util ) | [ KILLinefficiency] ( https://github.com/KILLinefficiency ) 
109+ 102 | [ Sine_Wave] ( https://github.com/chavarera/python-mini-projects/tree/master/projects/Sine_Wave ) | [ echoaj] ( https://github.com/echoaj ) 
Original file line number Diff line number Diff line change 1+ # Script Title  
2+ This script draws a sine wave using the built-in Python library Turtle.
3+ The image below demonstrates the equation of a sine wave.
4+ ![ Screenshot of the sine wave equation] ( equation.png ) 
5+ [ source] ( https://www.mathsisfun.com/algebra/amplitude-period-frequency-phase-shift.html ) 
6+ 
7+ ### Prerequisites  
8+ None
9+ 
10+ ### How to run the script  
11+ 1 )  Open a terminal
12+ 2 )  Navigate to the "Sine_Wave" directory containing this python file using the command prompt.
13+ 3 )  ** Execute:**  ` python sine_wave.py ` 
14+ 
15+ ### Screenshot/GIF showing the sample use of the script  
16+ ![ Screenshot of the sine_wave.py file] ( screenshot.png ) 
17+ 
18+ 
19+ ## * Author Name*  
20+ [ echoaj] ( https://github.com/echoaj ) 
21+ 
Original file line number Diff line number Diff line change 1+ from  turtle  import  * 
2+ from  math  import  * 
3+ 
4+ 
5+ A  =  50  # Amplitude 
6+ B  =  100  # WaveLength 
7+ C  =  0  # Horizontal Shift 
8+ D  =  0  # Vertical Shift 
9+ 
10+ penup ()
11+ # As x increases y increases and decreases as it is evaluated. 
12+ for  x  in  range (- 200 , 200 ):
13+  # Sine Wave Equation 
14+  y  =  A  *  sin ((2  *  pi  /  B ) *  (x  +  C )) +  D 
15+  goto (x , y )
16+  pendown ()
17+ 
18+ hideturtle ()
19+ mainloop ()
                         You can’t perform that action at this time. 
           
                  
0 commit comments