Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Created a sine wave using the turtle library. #536

Merged
merged 9 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ SR No | Project | Author
99 | [Find IMDB Ratings](https://github.com/chavarera/python-mini-projects/tree/master/projects/Find_imdb_rating)| [Utkarsh Bajaj](https://github.com/utkarshbajaj)
100 | [Terminal Based Hangman Game](https://github.com/chavarera/python-mini-projects/tree/master/projects/Terminal_Based_Hangman_Game)| [neohboonyee99](https://github.com/neohboonyee99)
101 | [Diff Utility](https://github.com/Python-World/python-mini-projects/tree/master/projects/Diff_Util)| [KILLinefficiency](https://github.com/KILLinefficiency)
102 | [Sine_Wave](https://github.com/chavarera/python-mini-projects/tree/master/projects/Sine_Wave)| [echoaj](https://github.com/echoaj)
21 changes: 21 additions & 0 deletions projects/Sine_Wave/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Script Title
This script draws a sine wave using the built-in Python library Turtle.
The image below demonstrates the equation of a sine wave.
![Screenshot of the sine wave equation](equation.png)
[source](https://www.mathsisfun.com/algebra/amplitude-period-frequency-phase-shift.html)

### Prerequisites
None

### How to run the script
1) Open a terminal
2) Navigate to the "Sine_Wave" directory containing this python file using the command prompt.
3) **Execute:** `python sine_wave.py`

### Screenshot/GIF showing the sample use of the script
![Screenshot of the sine_wave.py file](screenshot.png)


## *Author Name*
[echoaj](https://github.com/echoaj)

Binary file added projects/Sine_Wave/equation.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/Sine_Wave/screenshot.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions projects/Sine_Wave/sine_wave.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from turtle import *
from math import *


A = 50 # Amplitude
B = 100 # WaveLength
C = 0 # Horizontal Shift
D = 0 # Vertical Shift

penup()
# As x increases y increases and decreases as it is evaluated.
for x in range(-200, 200):
# Sine Wave Equation
y = A * sin((2 * pi / B) * (x + C)) + D
goto(x, y)
pendown()

hideturtle()
mainloop()
Binary file modified projects/Todo_app/test.db
Binary file not shown.