Python Forum
making dot move in a sinusoidal way
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
making dot move in a sinusoidal way
#1
Hi folks,

I am trying to move a dot side-to-side in Python, using the following equation: x_coordinates = 0 + (amplitude * sin(frequency*current time*2pi)). Does anyone have any ideas on how I might go about achieving this? I have searched for hours and I'm not even sure how to phrase the question succinctly enough for Google to comprehend!
Reply
#2
How do you want to display your sinusoidal output? Turtle graphics? Multiple print statements to the console? Something else?
Reply
#3
(May-03-2020, 03:28 AM)deanhystad Wrote: How do you want to display your sinusoidal output? Turtle graphics? Multiple print statements to the console? Something else?

Thanks for the reply! I would like to display it as an object, whereby the x axis position at each frame is determined by the output of the equation above.
Reply
#4
How do you want to display the output? Your program will need to draw something. TO do this it needs to use a package that supports graphics. There are a lot of graphics packages in python.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020