• Log in or sign up for an account here: https://www.sythe.org/login

Making a dot move in a sinusoidal way, side-to-side

Nathan III

Apprentice
Joined
Jan 24, 2007
Sythe Gold
0
Messages
872
Location
Leeds, England
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!
 
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!

What's the exact issue? That equation works fine for moving around an origin sinusoidally.
Desmos | Graphing Calculator
o = origin, a = amplitude, f = frequency, t = time.

Is your question on the time? For that you'd just track the change in time between update calls and add that to your time counter. Good news if you don't even have to worry about bounding your t.
 
Runescape Gamblingrunescape gambling
Back
Top