AnswerBun.com

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.

2 Answers

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}%
    curvepnodes[plotpoints=11]{0}{360}{3 t Offset add PtoC}{A}
    psnpolygon[linecolor=red](0,numexprAnodecount-1){A}
end{pspicture}
end{document}

enter image description here

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}%
    curvepnodes[plotpoints=13]{0}{360}{3 t Offset add PtoC}{A}
    psnpolygon[linecolor=red](0,numexprAnodecount-1){A}
end{pspicture}}
end{document}

enter image description here

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}
% Radius of regular polygons
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}

enter image description here

Answered by Sebastiano on January 5, 2022

Add your own answers!

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

     

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

     

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

 

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

 

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

     

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP