Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit aea2edf

Browse files
Merge pull request #536 from echoaj/master
Created a sine wave using the turtle library.
2 parents 7d688c6 + 7b44ca9 commit aea2edf

File tree

7 files changed

+41
-0
lines changed

7 files changed

+41
-0
lines changed

‎.DS_Store

-8 KB
Binary file not shown.

‎docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,4 @@ SR No | Project | Author
106106
99 | [Find IMDB Ratings](https://github.com/chavarera/python-mini-projects/tree/master/projects/Find_imdb_rating)| [Utkarsh Bajaj](https://github.com/utkarshbajaj)
107107
100 | [Terminal Based Hangman Game](https://github.com/chavarera/python-mini-projects/tree/master/projects/Terminal_Based_Hangman_Game)| [neohboonyee99](https://github.com/neohboonyee99)
108108
101 | [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)

‎projects/Sine_Wave/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+

‎projects/Sine_Wave/equation.PNG

96.4 KB
Loading[フレーム]

‎projects/Sine_Wave/screenshot.PNG

29.7 KB
Loading[フレーム]

‎projects/Sine_Wave/sine_wave.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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()

‎projects/Todo_app/test.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /