Javascript how to move the canvas element on sinusoid?



  • Hi, I'm interested in the question, like a circle painted in the canvas to make a move on the sinusoid trajectory.

    More grateful.



    1. Ask the basic coordinates x, my circle.
    2. Timer shift x by formula x1 = x + dxy by formula y1 = y + sin(x-x1) * sy (dx is a shift step, sy is a competitor at height to make the shift feel).

    I think you understand the idea, and you'll be able to draw a circle, and you'll get over it.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2