# Weird arc full circle (bug?)

**URL:** <https://discourse.processing.org/t/weird-arc-full-circle-bug/13439>\
**Category:** Coding Questions\
**Created:** [August 17, 2019, 8:04pm UTC](https://discourse.processing.org/t/weird-arc-full-circle-bug/13439 "2019-08-17T20:04:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![atuco](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@atuco](https://discourse.processing.org/u/atuco)\
**Post date:** [August 17, 2019, 8:04pm UTC](https://discourse.processing.org/t/weird-arc-full-circle-bug/13439/1 "2019-08-17T20:04:15Z")

</div>

Hi,

I try to export a processing sketch in js but I’ve a strange behaviour. There are stranges randoms (and always in the begining of the sketch) full circles only in the js  
You can see in this page: [https://codepen.io/atuco/pen/ExYyoWW](https://codepen.io/atuco/pen/ExYyoWW)

Do you have an idea ?

---

<div class="post-metadata">

**Author:** ![figraham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/figraham/32/4161_2.png) [@figraham](https://discourse.processing.org/u/figraham)\
**Post date:** [August 17, 2019, 10:53pm UTC](https://discourse.processing.org/t/weird-arc-full-circle-bug/13439/2 "2019-08-17T22:53:58Z")

</div>

Nice sketch! Looks like `arc(x, y, w, h, pi, pi)` produces a circle. You can see this if you comment out the `arcEnd = map(...)` and add `arcEnd = pi`. I guess the assumption is that when arc is called with the same start and stop you want a circle in p5.js. It probably makes sense sometimes but clearly it’s not what you’re looking for.

You could either change the to look something like `arcEnd = map(sin(offset + theta), -1, 1, pi + 0.01, pi*2)` or add an if statement so the arc is only drawn when `(arcEnd !== pi)`. Hope that helps.
