Jump to content


Detect if mouse do multiple circle rotation around a XY point

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Would anyone know a method or algorithm in JS to calculate and detect if a mouse is moving by a circle around a target?


Example if a rotate mouse *2 time around a specific XY point, i would like to re-center my camera obj.

(in my context i need algoritme for a camera engine)

I search i little bit on the web, but no found good formula to perform this.

Maybe a will need a special api ? or a easy trick to do this with GSAP ?

i take a try on this forum, i not find similar codepen project to do this.

thank for suggest guys.


in context, the target position are know, i need to find a way to check if the mouse do multiple circle rotation around this target XY, in a timelaspe (maybe 1000 or 2000 ms)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.