Mini Project - 23BAI10294
Mini Project - 23BAI10294
ni
Slot: B21 + E21 + B22 +E22
Submitted To: Prof. Jayanthi J
Date of Submission: 5/8/24
Pro
jec
GUI Fidget
t Spinner
OUTPUT :
A GUI (Graphical User Interface) fidget spinner is a digital version of a physical
fidget spinner that you can interact with on a screen. It's designed to provide a
similar tactile experience as spinning a real fidget spinner, offering a way to
reduce stress or pass the time.
Explanation :
import tkinter as tk: This imports the Tkinter library and gives it the alias
tk for easier use.
import math: This imports the math library, which provides mathematical
functions such as cos and sin.
if self.speed < 0.1:: This checks if the speed is less than 0.1.
self.speed = 0: If the speed is less than 0.1, it sets the speed to 0.
x_center = 200: This sets the x-coordinate of the center of the spinner to
200.
y_center = 200: This sets the y-coordinate of the center of the spinner to
200.
radius = 50: This sets the radius of the spinner to 50.
These lines calculate the coordinates of three points on the spinner, which
are 120 degrees apart. The math.radians function converts the angle from
degrees to radians, and math.cos and math.sin calculate the x and y
offsets based on the angle.