# Transform path to follow an arc

**URL:** <https://discourse.processing.org/t/transform-path-to-follow-an-arc/22166>\
**Category:** Coding Questions\
**Created:** [June 25, 2020, 5:25pm UTC](https://discourse.processing.org/t/transform-path-to-follow-an-arc/22166 "2020-06-25T17:25:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [June 26, 2020, 10:21pm UTC](https://discourse.processing.org/t/transform-path-to-follow-an-arc/22166/4 "2020-06-26T22:21:08Z")

</div>

I have a bit of a hard time understanding your original question.

> [@rebeccajkaye](#):
>
> I have a line in the shape of a sine wave (although I’d like to apply this thinking to any points following a ‘flat’ path

What are your initial points?  
What is a “flat path”?

> [@rebeccajkaye](#):
>
> I am trying to turn this ‘linear path’ so that the same pattern follows a circular path.

Can you draw this original “linear” path first before you apply your transformation?

> [@rebeccajkaye](#):
>
> My lines in the curve don’t join either (I’m not sure what I’ve done wrong by creating the x2,y2 points for my curve

Could you provide a screenshot of what you mean with that?

Please rephrase your challenge as it will be easier to answer.

If I word what you are trying to do, you want to do a vectorial addition of your initial linear path with a sinusoidal path which will result in a curve path. And you want this path to join at the end.

Probably this post relates to your effort? [Wave displaced circle](https://discourse.processing.org/t/wave-displaced-circle/808)

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/03d63e043c750920d1ceb08c9b49c96ccbba951c.png)

I have modified your initial code to make it dynamic. You can move your mouse along the x and y. Along the x, it adjust the amplitude of the sine wave. Along the Y, it adjust the steps to draw the curve. I use the blue color to draw your base line for the wave, red and green to plot your referential wave and yellow to be your initial line (?). This is the output:

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a13067312e96af11debb519ac02d133075238442.png)

Kf

---

_[View the full topic](https://discourse.processing.org/t/transform-path-to-follow-an-arc/22166)._
