# Draw a circle segment

**URL:** <https://discourse.processing.org/t/draw-a-circle-segment/29900>\
**Category:** Coding Questions\
**Created:** [May 6, 2021, 9:29am UTC](https://discourse.processing.org/t/draw-a-circle-segment/29900 "2021-05-06T09:29:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaftigMelo](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@SaftigMelo](https://discourse.processing.org/u/SaftigMelo)\
**Post date:** [May 6, 2021, 9:29am UTC](https://discourse.processing.org/t/draw-a-circle-segment/29900/1 "2021-05-06T09:29:16Z")

</div>

Hello, I am currently trying to draw a sailboat with Processing in Java. I'm failing on the bottom part right now.  
I was thinking that I can use a circle segment for it.  
I wanted to use the arc() method for this only it doesn't work.  
The call: arc(x, y, 20, 20, 45, 45);  
I played a bit with the parameters hoping this would work.  
If there is no circle segment to draw, I figured I could "squeeze" another shape, like a semicircle, to the right size or I could use a trapezoid for it.  
  
1.) Is there a method for a circle segment?  
2.) Are there methods for scaling?  
3.) Is there a method for a trapezoid or do I have to do it with a rectangle and two triangles?  
  
Sorry if there are any grammar mistaces. I asked on a German forum and I was too lazy to rewrite the whole text.

---

<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:** [May 6, 2021, 9:42am UTC](https://discourse.processing.org/t/draw-a-circle-segment/29900/2 "2021-05-06T09:42:40Z")

</div>

Did you read the reference for arc?

The angles must be 45 and 45+180 and radians

Also you can have it wider than high

Two or three lines would work:

```auto

\ ________ /

```

---

<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:** [May 6, 2021, 9:42am UTC](https://discourse.processing.org/t/draw-a-circle-segment/29900/3 "2021-05-06T09:42:47Z")

</div>

Hello,

arc(x, y, 20, 20, 45, 45)

Check out the reference for arc() for examples:  
_[arc() / Reference / Processing.org](https://processing.org/reference/arc_.html)_

You should be using radians for angles.

I encourage you to review the resources available here:

- The Processing website has references, examples, tutorials, etc.  
[https://processing.org/](https://processing.org/)

- Processing has lots to offer!  
An exploration of the tabs will reveal what is available; libraries, tools, _ **examples** _ and more.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1d6a45100f4930df324acb8966086c8eaa28eee4.png)

- The Coding Train  
[https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1\_aw](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw)  
[https://thecodingtrain.com/](https://thecodingtrain.com/)

- Happy Coding  
[Processing Tutorials - Happy Coding](https://happycoding.io/tutorials/processing/)

`:)`

---

<div class="post-metadata">

**Author:** ![SaftigMelo](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@SaftigMelo](https://discourse.processing.org/u/SaftigMelo)\
**Post date:** [May 6, 2021, 9:54am UTC](https://discourse.processing.org/t/draw-a-circle-segment/29900/4 "2021-05-06T09:54:53Z")

</div>

I just found it out. But thanks anyway. I think this will help me later.

---

<div class="post-metadata">

**Author:** ![SaftigMelo](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@SaftigMelo](https://discourse.processing.org/u/SaftigMelo)\
**Post date:** [May 6, 2021, 9:55am UTC](https://discourse.processing.org/t/draw-a-circle-segment/29900/5 "2021-05-06T09:55:43Z")

</div>

Yeah, your right. Ty
