# How to make a dotted or dashed ellipse in p5.js?

**URL:** https://discourse.processing.org/t/how-to-make-a-dotted-or-dashed-ellipse-in-p5-js/35137
**Category:** Coding Questions
**Created:** [February 13, 2022, 4:21am UTC](https://discourse.processing.org/t/how-to-make-a-dotted-or-dashed-ellipse-in-p5-js/35137 "2022-02-13T04:21:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ongo](https://avatars.discourse-cdn.com/v4/letter/o/edb3f5/32.png) [@ongo](https://discourse.processing.org/u/ongo)
#### Post date: [February 13, 2022, 4:21am UTC](https://discourse.processing.org/t/how-to-make-a-dotted-or-dashed-ellipse-in-p5-js/35137/1 "2022-02-13T04:21:23Z")

</div>

I have no code example to provide, this is just a general question on how to do this. Are there any external libraries that could help with this? Any code examples would be much appreciated!

---

<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: [February 13, 2022, 10:29am UTC](https://discourse.processing.org/t/how-to-make-a-dotted-or-dashed-ellipse-in-p5-js/35137/2 "2022-02-13T10:29:55Z")

</div>

I think you need to program your own ellipse and provide the dotted

pseudo code:

```auto

for (float angle = 0; angle < 360; angle += 20) {
  x=cos(radians(angle)) .... ; 
  y=cos(radians(angle)) .... ; 
  point(x,y);
}

```

* * *

**Full Code**

```auto
size(1200, 700);

background(0); 

stroke(255); 

for (int angle = 0; angle < 360; angle += 3) { 

  float x=cos(radians(angle))*200 + 300 ; 
  float y=sin(radians(angle))*200 + 300 ; 
  point(x, y);
}

```
