Detecting Circular Movement

How would you detect if something, say your mouse, is moving in a circle within a particular region? How could you make it to varying degrees of accuracy?

I’d say this wasn’t really a Newbie question … :open_mouth:

Firstly you can use to get the position that the mouse is. You’d could probably figure it out by storing the most recent points within perhaps 1/4 of a second intervals and then calculate their positions relative to each other to see if it had made a circle.

Though maths was never my strong point so I can’t help you much there. Just really hate maths. / Fist shake.

I’m sure someone else who is more awake will post with better advice soon though.

You could store the position of the entity/mouse over a time and then compare the angles between the positions. If all of the angles fall within a certain margin from their preceding ones, they are advancing in a circular path.

My question is, why do you need this 0_0

Volume control for his music player. To style like an iPod. That’s my guess :wink:

Yeah, that would work. Just gotta do the math now. Thanks Nev.


Volume control doesn’t work too well in Gmod, I’ve played with it and the sound difference is minimal.

Uh, I said that before lol.

Guess I just worded it wrong. Had been awake over a day at the time. x3