Arc

20°150120145, 174288, 314
<svg width="450" height="450" >
<path
d="M 145 174
Start Position
A 150
Radius X
120
Radius Y
20
Rotation
0
Large Arc Flag
0
Sweep Flag
288 314
End Position
"
stroke="#fa3838" stroke-width="20" fill="none"
/>
</svg>

Arc

An arc is a segment of a circle or ellipse. In SVG we can use the <path> element with the A command to draw an arc.

Moving to the starting point

Like most path segments, the arc command continues the previous segment. In this example we use the M command to move to the starting point and from there we start the curve.

Drawing an Arc

The A command is a complex one.

  1. First we set the horizontal and vertical radii of the arc. If these are equal, the arc is on a circle. If they are different, we get an elliptical arc.

  2. Then we set a rotation. This value only has an effect if the previous two values are different. This is the angle of the x-axis of the ellipse relative to the x-axis of the SVG canvas.

  3. Then the large arc flag determines if the arc is reaching the end point the short way or the long way.

  4. The sweep flag flag determines if the arc is drawn in a clockwise or counterclockwise direction.

  5. Finally, we set the end point coordinate. This is where the arc ends.

Styling

Stroke Color

You can set any color value that is valid in CSS. This includes named colors, hex codes, the rgb function and more. Set it to none to hide.

Stroke Width

Set the thickness of the stroke. It can be set to any positive number.

Stroke Linecap

Set the shape to be used at the end of a line or open subpath.

Stroke Linejoin

Set the shape to be used at the corners of paths and basic shapes when they are stroked.

Fill Color

You can set any color value that is valid in CSS. This includes named colors, hex codes, the rgb function and more. Set it to none to hide.