# Clock project (Urgent please)

**URL:** <https://discourse.processing.org/t/clock-project-urgent-please/17298>\
**Category:** Coding Questions\
**Created:** [January 23, 2020, 10:08pm UTC](https://discourse.processing.org/t/clock-project-urgent-please/17298 "2020-01-23T22:08:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@laura](https://discourse.processing.org/u/laura)\
**Post date:** [January 23, 2020, 10:08pm UTC](https://discourse.processing.org/t/clock-project-urgent-please/17298/1 "2020-01-23T22:08:24Z")

</div>

Hello everyone,  
I have to create a clock for my animation class and I have some issues with processing. It’s the first time I’m using this app…  
Please if someone can help me, I want to create a line for every minute that pass in a circular form (I don’t know if I’m clear)

 ![53a76ad1-2d50-48ee-b2f7-1fdfc391b20d](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/26da566af08effd395472740d30c58cf0bb8a8b7.jpeg)

---

<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:** [January 23, 2020, 10:26pm UTC](https://discourse.processing.org/t/clock-project-urgent-please/17298/2 "2020-01-23T22:26:04Z")

</div>

You need hour minute and second for this - see reference on the website

You need cosine and sine, see tutorial trigonometry on the website

---

<div class="post-metadata">

**Author:** ![laura](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@laura](https://discourse.processing.org/u/laura)\
**Post date:** [January 23, 2020, 10:31pm UTC](https://discourse.processing.org/t/clock-project-urgent-please/17298/4 "2020-01-23T22:31:10Z")

</div>

Yes thanks!  
i’m already using that tutorials and I wrote that code :  
void setup(){  
size(1000,1000);

xC = width/2;  
yC= height/2;  
rayonM = 200 ;  
angleM = 2\*PI/60;

}

void draw(){  
background(255);

```
xM = xC + rayonM*cos(angleM *minute()-PI/2);
yM = yC + rayonM*sin(angleM *minute()-PI/2);
strokeWeight(10);
 line(xC, yC, xM, yM);
 smooth();
xM = xC + rayonM*cos(angleM *minute()-PI/2);
yM = yC + rayonM*sin(angleM *minute()-PI/2);
strokeWeight(10);
 line(xC, yC, xM, yM);
 line(xC, yC, xM, yM);
 smooth();

```

}

But with that, the line is disappearing like a real clock and I want the lines to stay on the page, like one line = one minute, and 60 lines = 1 hour.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [January 23, 2020, 11:25pm UTC](https://discourse.processing.org/t/clock-project-urgent-please/17298/5 "2020-01-23T23:25:06Z")

</div>

Hi @laura – welcome.

> Please help us to **help you** by editing your original code post and [formatting your code](https://discourse.processing.org/faq#format-your-code).

To begin: your lines are disappearing because `background(255)` paints the whole canvas white each frame before drawing something new.

---

<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:** [January 24, 2020, 7:28am UTC](https://discourse.processing.org/t/clock-project-urgent-please/17298/6 "2020-01-24T07:28:30Z")

</div>

I encourage you to use background

To fill the clock with lines up to the number of minutes : use a for loop with minutes as upper boundary
