# How do I move a shape along a sine curve?

**URL:** <https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830>\
**Category:** Coding Questions\
**Created:** [May 3, 2021, 9:24pm UTC](https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830 "2021-05-03T21:24:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![idonwannadothisanymo](https://avatars.discourse-cdn.com/v4/letter/i/a9a28c/32.png) [@idonwannadothisanymo](https://discourse.processing.org/u/idonwannadothisanymo)\
**Post date:** [May 3, 2021, 9:24pm UTC](https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830/1 "2021-05-03T21:24:32Z")

</div>

I want to move a circle along a sine curve. How do I do this?

Pleassseee!

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [May 3, 2021, 9:45pm UTC](https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830/2 "2021-05-03T21:45:18Z")

</div>

I love your passion 🙂

Maybe you can start with drawing a circle?

---

<div class="post-metadata">

**Author:** ![idonwannadothisanymo](https://avatars.discourse-cdn.com/v4/letter/i/a9a28c/32.png) [@idonwannadothisanymo](https://discourse.processing.org/u/idonwannadothisanymo)\
**Post date:** [May 3, 2021, 9:50pm UTC](https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830/3 "2021-05-03T21:50:25Z")

</div>

Thanks, I do have a circle!  
I’m stuck with how to set up the x and y(x and y coordinates of the circle) to animate the circle, do you have any ideas on this?

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [May 3, 2021, 9:51pm UTC](https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830/4 "2021-05-03T21:51:34Z")

</div>

Sorry I have no idea - do you want to share the code to draw a circle?

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [May 3, 2021, 10:34pm UTC](https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830/5 "2021-05-03T22:34:41Z")

</div>

Hello,

You have to start somewhere…

I encourage you to review the resources available here:

- The Processing _website_ has references, examples, tutorials, etc.  
[https://processing.org/](https://processing.org/)

- The Processing PDE has lots to offer!  
An exploration of the tabs will reveal what is available; libraries, tools, examples and more.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1d6a45100f4930df324acb8966086c8eaa28eee4.png)

- The Coding Train  
[https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1\_aw](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw)  
[https://thecodingtrain.com/](https://thecodingtrain.com/)

- Happy Coding  
[Processing Tutorials - Happy Coding](https://happycoding.io/tutorials/processing/)

- The source code can give insight if you are adventurous:  
[GitHub - processing/processing: Source code for the Processing Core and Development Environment (PDE)](https://github.com/processing/processing)  
Some of the Processing helper functions are here:  
[processing/core/src/processing/core/PApplet.java at master · processing/processing · GitHub](https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java)

- The Processing Foundation  
[https://processingfoundation.org/](https://processingfoundation.org/)  
Check out the tabs.  
In the education tab, there is a reference to the Coding Train.

- And the Internet. `:)`

There may be something of interest in there for you.

Sine waves? There is a tutorial on trigonometry. And coordinate system and shapes.

`:)`
