# Basic Processing question for beginner (circular rays)

**URL:** <https://discourse.processing.org/t/basic-processing-question-for-beginner-circular-rays/39029>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [October 1, 2022, 2:40pm UTC](https://discourse.processing.org/t/basic-processing-question-for-beginner-circular-rays/39029 "2022-10-01T14:40:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghostmane](https://avatars.discourse-cdn.com/v4/letter/g/958977/32.png) [@ghostmane](https://discourse.processing.org/u/ghostmane)\
**Post date:** [October 1, 2022, 2:40pm UTC](https://discourse.processing.org/t/basic-processing-question-for-beginner-circular-rays/39029/1 "2022-10-01T14:40:38Z")

</div>

> please format code with \</\> button \* [homework policy](https://discourse.processing.org/faq/#homework) \* [asking questions](https://discourse.processing.org/t/2147)

 ![스크린샷(29)](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/c/3/c3296f323b25af432e37b78a2b80af750fab5744.png)

지금 이상태인데 저 선들이 한점에서 뻗어나가도록 모션을 넣고싶은데 어떻게 해야하나요?

그리고 모션이 끝난 다음에 이미지들을 넣고 그 위에 그림을 그릴 수 있도록 만들고싶은데 가능한가요?

at this moment on the screenshot i uploaded , I wanna make the lines go stretch out from the point at the middle. let me know how and after the motioning effect can i put some images on and draw on them? is it possible? please help me with that. thank u :~0

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [October 1, 2022, 3:41pm UTC](https://discourse.processing.org/t/basic-processing-question-for-beginner-circular-rays/39029/2 "2022-10-01T15:41:28Z")

</div>

The center is always  
250,250

You can find out targetX, targetY:

```auto
targetX=cos(angle) * random(200,300) + 250;

targetY=sin(angle) * random(200,300) + 250;

```

angle running as float from 0 to TWO\_PI

Or  
Use same radius for both:

myR =random(200,300) ;

After that you can proceed and freely draw  
images or whatever

---

<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:** [October 2, 2022, 3:10pm UTC](https://discourse.processing.org/t/basic-processing-question-for-beginner-circular-rays/39029/3 "2022-10-02T15:10:33Z")

</div>

Hello @ghostmane,

> [@ghostmane](#):
>
> I want to add motion so that the lines extend from one point. How do I do that?

You can [lerp](https://en.wikipedia.org/wiki/Linear_interpolation) over time from _(250, 250)_ to _(a, b)_ in your code in `draw()`:

`f = f+ 0.02; // 50 steps from 0 to 1`

There is a `lerp()` function that you can use or you can [do the math](https://www.youtube.com/watch?v=5KsVojEaoms).

![flowers.gif.mov](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/3/a/3af2619936be9aa38ece647d1c053532d3dd13aa.gif)

`:)`
