# Draw a decagon in LaTeX

TeX - LaTeX Asked on January 5, 2022

I need to draw a graph with 10 nodes in LaTeX. I thought about doing it with tikz and try to give exact coordinates to draw a decagon but I don’t know what coordinates to give.

A solution with PSTricks only for either fun or comparison purposes.

curvepnodes is useful to define an array of nodes for any given number of nodes and curve functions. For example, we can use it to make an array of 12 nodes on a circle. Offset is provided as the rotation offset.

documentclass[pstricks,margin=5mm]{standalone}
usepackage{pst-node,pst-plot}

begin{document}
begin{pspicture}[showpoints,dotscale=1](-4,-4)(4,4)
pstVerb{/Offset 30 def}%
psnpolygon[linecolor=red](0,numexprAnodecount-1){A}
end{pspicture}
end{document}


# Animated version

documentclass[pstricks,margin=5mm]{standalone}
usepackage{pst-node,pst-plot}

begin{document}
multido{i=0+10}{10}{%
begin{pspicture}[showpoints,dotscale=6](-4,-4)(4,4)
pstVerb{/Offset ispace def}%
psnpolygon[linecolor=red](0,numexprAnodecount-1){A}
end{pspicture}}
end{document}


Answered by Unreal Engine 5 Coming Soon on January 5, 2022

In this link you can find a series of regular polygons...I have changed the code to have the penthagon. Here the drawing is without coordinates.

documentclass[12pt]{article}
usepackage{tikz}
begin{document}
newdimenR
R=1cm
This is a pentagon $n=10$,
begin{tikzpicture}
draw[yshift=-6.0R] (0:R) foreach x in {36,72,...,359} {
-- (x:R)
} -- cycle (90:R) node[above] {$scriptstyle n=10$} ;
end{tikzpicture}
that it could be used as a symbol.
end{document}


Answered by Sebastiano on January 5, 2022

## Related Questions

### Setting paragraph indention

1  Asked on September 27, 2021 by nino-oostrom

### Why getting a larger image box when rotating?

1  Asked on September 27, 2021 by rob41

### Make two figures aligned at top

5  Asked on September 27, 2021 by dplanet

### How to Arrange Graphics (TikZ) If Using Input Command?

0  Asked on September 26, 2021

### Creating a very long timeline

0  Asked on September 26, 2021 by texomat

### clefval.sty: ! Package inputenc Error: Invalid UTF-8 byte “A0

2  Asked on September 26, 2021 by edd-barrett

### MikTex – pdflatex does not compile – initexmf.exe

1  Asked on September 26, 2021 by francois

### Undefined Control Sequence while using setmathdigitfont in xepersian

0  Asked on September 26, 2021 by ali-kazemkhanloo

### How do we make new command like “newcommand{eql}[2]{begin{align}label(#2)}#1end{align}}”

0  Asked on September 26, 2021 by latexatha

### Converting LaTeX to Word format? Better yet, with equation-editor format equations?

3  Asked on September 26, 2021 by carl-smith

### Problem listening to a WAV file embedded into a beamer presentation using Adobe Reader

0  Asked on September 26, 2021 by user221292

### Inline descriptions and automatic sorted glossary entries

1  Asked on September 26, 2021 by scott-lovell

### Jewish and Muslim holidays formula

0  Asked on September 26, 2021

### Print a list of selected enumerated list labels

2  Asked on September 26, 2021

### Height filling minipages in Beamer

1  Asked on September 26, 2021 by bconic

### Histogram with multiple plots of same data

1  Asked on September 26, 2021 by user221282

### Circle above a letter

4  Asked on September 26, 2021

### PDF output works in an embedded window, but not in the separate window

0  Asked on September 26, 2021 by koval-boris

### How do I define a new function juse

1  Asked on September 26, 2021

### Putting two images beside each other

6  Asked on September 26, 2021 by simplicity