forked from ThisaraWeerakoon/MathSimulationWebApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconcentricCircle.html
More file actions
127 lines (118 loc) · 5.66 KB
/
concentricCircle.html
File metadata and controls
127 lines (118 loc) · 5.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!--edit here-->
<title>Colorful Concentric Circles with Python Turtle</title>
<link rel="stylesheet" href="./prism.css">
<link rel="stylesheet" href="./styles.css">
</head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<top-section class="top-nav">
<div>
<img src="./exmo.png" height="47px" top="10px">
</div>
<input id="menu-toggle" type="checkbox" />
<label class='menu-button-container' for="menu-toggle">
<div class='menu-button'></div>
</label>
<ul class="menu">
<!--add links-->
<li><a href="./SHM.html">An Artistic Exploration of Simple Harmonic Motion with Python Turtle</a></li>
<li><a href="./turtles1.html">Exploring Colorful Patterns with Python's Turtle Graphics</a></li>
<li><a href="./spirals.html" >Mesmerizing Spirals: A Colorful Turtle Art Adventure</a></li>
<li><a href="./Circular.html">Colorful Spiral Art with Python Turtle</a></li>
<li><a href="./ImageTracing.html">Drawing from an Image using OpenCV and Turtle</a></li>
<li><a href="./Spirograph.html">Spirograph Art with Python Turtle</a></li>
<li><a href="./gravity.html">Planetary motion</a></li>
<li><a href="./Functions.html">Visualizing Complex-Valued Functions</a></li>
<li><a href="./pendulum.html">Double Pendulum Simulation with Python Turtle</a></li>
<li><a href="./concentricCircle.html">Colorful Concentric Circles with Python Turtle</a></li>
<li><a href="./heart.html">Heart Shape with Python Turtle</a></li>
<li><a href="./clock.html">Python Turtle Clock</a></li>
</ul>
</top-section>
<body>
<script>/*<![CDATA[*/ /* Codebox Script by Fineshop Design */ function copyC(e,t){var o=document.getElementById(e),n=document.getElementById(t),e=getSelection(),t=document.createRange();e.removeAllRanges(),t.selectNodeContents(n),e.addRange(t),document.execCommand("copy"),e.removeAllRanges(),o.classList.add("copied"),document.getElementById("toastNotif").innerHTML="<span>Copied to Clipboard!</span>",setTimeout(()=>{o.classList.remove("copied")},3e3)} /*]]>*/</script>
<div id="content" class="content-wrapper">
<script src="./prism.js"></script>
<h1>Colorful Concentric Circles with Python Turtle</h1>
<p>
Welcome to this Python Turtle adventure! In this web page, we'll introduce you to a Python program that uses Turtle graphics to draw colorful concentric circles. The program creates mesmerizing patterns by drawing circles with different radii and colors on a black canvas.
</p>
<h2 class="panel-sticky">Drawing Colorful Concentric Circles</h2>
<p>
The Python program uses the Turtle graphics library to draw the concentric circles. It iterates through a loop, drawing circles of increasing radii, and changes the colors as the loop progresses. The colors used for the circles are red, yellow, and orange.
</p>
<!--[ Code Box ]-->
<div class='cBox'>
<div class='cBoxH'>
<!--[ Heading ]-->
<span>Code --> python</span>
<!--[ Copy Button ]-->
<button id='copy3' class='cBoxB' onclick="copyC('copy3','code3')">
<i class='icn'></i>
</button>
</div>
<!--[ python-code ]-->
<div id='code3'>
<pre class="line-numbers">
<code class="language-python"> <pre><code>
import turtle
from turtle import *
bgcolor("black")
speed(0)
hideturtle()
for i in range(120):
color("red")
circle(i)
color("yellow")
circle(i * 1.1)
color("orange")
circle(i * 1.2)
right(3)
forward(3)
done() </code></pre>
</code>
</pre>
</div>
</div>
<h2 class="panel-sticky">Running the Python Code</h2>
<p>
To see the colorful concentric circles drawing in action, save the Python code to a file with a .py extension, such as concentric_circles.py. Open a terminal or command prompt, navigate to the folder containing the file, and execute the following command:
</p>
<!--[ Code Box ]-->
<div class='cBox'>
<div class='cBoxH'>
<!--[ Heading ]-->
<span>Code --> python</span>
<!--[ Copy Button ]-->
<button id='copy3' class='cBoxB' onclick="copyC('copy3','code3')">
<i class='icn'></i>
</button>
</div>
<!--[ python-code ]-->
<div id='code3'>
<pre class="line-numbers">
<code class="language-python">python colorful_spiral.py
</code>
</pre>
</div>
</div>
<h2 class="panel-sticky">Behold the Colorful Patterns</h2>
<p>
As you run the Python program, a Turtle graphics window will pop up, and you'll witness the mesmerizing patterns of colorful concentric circles being drawn on the black canvas. The changing colors and radii create a visual spectacle that showcases the creative potential of Python Turtle!
</p>
<h2 class="panel-sticky">Experiment and Customize</h2>
<p>
Feel free to experiment with the number of circles, the angle of rotation, or the colors used to create different variations of the colorful patterns. You can unleash your creativity and generate unique artworks!
</p>
<h2 class="panel-sticky">Conclusion</h2>
<p>
With just a few lines of Python code and the magic of Turtle graphics, you've created beautiful and colorful concentric circles. It's a delightful way to explore the artistic side of Python and witness the stunning visual effects of simple geometric shapes.
</p>
<p>
Now you have the tools to create captivating visual patterns. Share your creations and let others enjoy the mesmerizing world of Python Turtle art!
</p>
</body>
</html>