# draw arc

• Hi there,
I am not sure if this is the correct category to post this.
I am trying to draw an arc and I cannot find any example or explanation concerning this. In the documentation it says:
`arc(center, radius, startAngle, endAngle, clockwise)`
but it didn't work.
Assuming the center has two coordinates, I tried:
`arc((10, 10), 10, 20, 25, True)` and
`arc(10, 10, 10, 20, 25, True)`, both didn't give a result.

There were a few discussions and examples about arcTo(), but that didn't help me as I am trying something like this: Did anybody try something similar before?
Petra

• hello @Manufraktur,

here is a simple example using `arc()` to create a slice of pie: ``````from math import sin, cos, radians, pi

x0, y0 = 500, 500 # center point (A)
angleStart = 10
angleTotal = 55

fill(0, 1, 0)

# calculate point (B) from angle and radius

# draw pie slice using arc
B = BezierPath()
B.moveTo((x0, y0))
B.lineTo((x1, y1))
B.arc((x0, y0), radius, angleStart, angleStart + angleTotal, False)
B.closePath()
fill(1, 0, 0)
drawPath(B)

# draw points labels
fill(0, 0, 1)
fontSize(120)
text('A', (x0, y0))
text('B', (x1, y1))
``````

`arc()` is a bit tricky to use because point `B` and `angleStart` need to be kept in synch manually.

notice that, in this script, `B` is defined with distance & angle in relation to `A`.

if you prefer to define `B` by x/y position, as in your example, you’ll need to calculate the angle and distance of `B` in relation to `A`:

``````from math import hypot, atan2, degrees

x0, y0 = 500, 500 # A
x1, y1 = 872, 600 # B
angleTotal = 55

radius = hypot(x1 - x0, y1 - y0)
angleRadians = atan2(y1 - y0, x1 - x0)

# ...same as previous example...
``````

hope this makes sense! cheers

• Dear @gferreira,
thanks for your quick reply. It seems like this could solve my problem. I will give it a try tomorrow and let you know.