How to Draw an Arc in Tikz – Full Guide
In this LaTeX tutorial, we will learn how to draw an arc in Tikz with lots of examples. I will start with the very basic arc first.
The basic sytax is:
\draw (x,y) arc [start angle=<start>, end angle=<end>, radius=<radius>];
- (x,y): The coordinates of the starting point of the arc.
- start angle: The angle at which the arc begins (measured counterclockwise from the positive x-axis).
- end angle: The angle at which the arc ends.
- radius: The distance from the center of the circle to the arc.
If you just want the arc symbol you can check this: Arc symbol in LaTeX – Different ways
Draw simple arc
\documentclass[tikz,border=3.14mm]{standalone} \begin{document} \begin{tikzpicture} % center at (0,0), radius 2, from 0 to 90 degrees \draw (0,0) arc [start angle=0, end angle=90, radius=2cm]; \end{tikzpicture} \end{document}
Output:
I just used \draw
command with arc
syntax.
You can change the angle and radius to suit your needs.
Draw a circle using arc in Tikz
We can set the end angle to 360 to draw a circle.
\documentclass[tikz,border=3.14mm]{standalone} \begin{document} \begin{tikzpicture} % center at (0,0), radius 2, from 0 to 90 degrees \draw (0,0) arc [start angle=0, end angle=360, radius=2cm]; \end{tikzpicture} \end{document}
Output:
Arc over a line in Tikz
\documentclass[tikz,border=3.14mm]{standalone} \begin{document} \begin{tikzpicture} % Draw a line followed by an arc and another line \draw (0,0) -- (1,0) arc [start angle=0, end angle=90, radius=1cm] -- (0,1); \end{tikzpicture} \end{document}
Output:
Customizing Arcs: Line Styles and Colors
We can customize line thickness, color, style with various options in Tikz.
Dotted and colored arc in Tikz
\documentclass[tikz,border=3.14mm]{standalone} \begin{document} \begin{tikzpicture} \draw[thick, dotted, red] (0,0) arc [start angle=0, end angle=90, radius=2cm]; \end{tikzpicture} \end{document}
Output:
This above code will generate a thick, dotted red arc from 0 to 90 degrees. You can adjust the thickness, line style, and color as per your needs.
Available Line Styles:
- Solid (default)
- Dotted:
dotted
- Dashed:
dashed
- Line thickness:
thin
,thick
,ultra thick
, or custom thickness likeline width=0.5mm
To learn more check: Draw line of any thickness in Tikz LaTeX
Arc with Arrowheads – Tikz
We can use the [->]
option to draw an arrow at the end of the arc. It can help us to understand the direction of the arc easily. I often use this to draw curve arrow in my LaTeX documents.
\documentclass[tikz,border=3.14mm]{standalone} \begin{document} \begin{tikzpicture} \draw[->] (0,0) arc [start angle=90, end angle=0, radius=2cm]; \end{tikzpicture} \end{document}
Output:
Tips to draw complex arc diagrams in LaTeX
You can name the points for reference and then using those points you can draw the arc diagrams just like this: ( I am showing a simple example here)
\documentclass[tikz,border=3.14mm]{standalone} \begin{document} \begin{tikzpicture} \coordinate (A) at (0,0); \coordinate (B) at (2,0); \coordinate (C) at (0,2); \draw (A) -- (B) arc [start angle=0, end angle=90, radius=2cm] -- (C); \end{tikzpicture} \end{document}
Here I am using the points A, B, C to draw the arc diagram. You can run the code to see the output.
If you need anything else apart from these, do let me know in the comment section below, I will be back with the solution.
Leave a Reply