Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [polygon]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
44 views

How to produce a polygon whose edges are a given distance from the edges of a given polygon?

Following MWE draws a closed polygon. \documentclass{report} \usepackage{tikz} \begin{document} \begin{tikzpicture \draw (0,0) -- (0,1) -- (0.5, 1.5) -- (1,1) -- (1,0) -- cycle; \end{tikzpicture}...
user avatar
  • 2,870
2 votes
1 answer
66 views

How to store the result of veclen with \setlength

I would simply like to compute the euclidean distance between 2 points and keep it in a variable. This is what I did \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric,calc} \...
user avatar
  • 51
0 votes
1 answer
65 views

How can I draw a regular polygon using Ipe?

Is there a way to easily draw a regular polygon using Ipe? The top toolbar has an icon for a polygon but not for a regular one, and manually aligning the vertices is a pain. The documentation doesn't ...
user avatar
  • 101
3 votes
2 answers
112 views

I can't take my shape one step further. how can I draw more

I can't keep repeating the shape in the corners. I can't issue a command like corner of the corner. I want it to continue in a loop like fractal but I couldn't make the loop. With the command I wrote, ...
user avatar
  • 33
6 votes
2 answers
139 views

Polygon with numbered vertices

About this, I'd like to numerate vertices of pentagon with a cyclic tikz function (e.g. \pgfmathtruncatemacro). How is it possible? Thank you! The code \documentclass{article} \usepackage[utf8]{...
user avatar
  • 793
0 votes
1 answer
59 views

Inserting text in a polyhedral folding drawing

Using the following code from this post, is it possible to modify the code to insert text inside different faces? Also is it possible to control the shape of the folding and cutting lines? \...
user avatar
  • 4,153
3 votes
2 answers
319 views

Adding points inside a regular hexagon

I am trying to create this image with latex, and I specifically add the red points in the interior of the regular hexagon as well as make the outer edges of the regular hexagon blue. I am able to ...
user avatar
1 vote
2 answers
139 views

Drawing a regular octagon with added lines and points

This is what I am trying to currently draw. I however do not know how to add the purple lines or green points. I am able to draw a regular octagon with points and the outer lines by the following: \...
user avatar
2 votes
2 answers
171 views

Add polygon of n sides using \pgfmathsetmarco

Hello i have the following code: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[help lines, color=gray!30] (0,0) grid (12,12); \...
user avatar
  • 71
4 votes
3 answers
287 views

Set Partitions and tikz [closed]

Please, how can I draw the colored rectangles which cover the nodes like the picture below,
user avatar
  • 51
1 vote
3 answers
149 views

How to draw a truncated triangle? TikZ or PSTricks

I would like to draw the following diagram. How do I do it? I tried this: \documentclass{article} \usepackage{tikz} \usepackage{pst-poly} \begin{document} \begin{pspicture} \PstTriangle ...
user avatar
0 votes
1 answer
30 views

Overlapping concentric polygons in Beamer

I want to create an animation in Beamer for approximating the area of a circle with regular polygons. For that, I need to overlap concentric polygons. The animation will be of the overlapping part. I ...
user avatar
-2 votes
2 answers
120 views

Asymptote code for point, segment, and some 3D prisms (Overleaf), project due this evening!

I’m very bad at Asymptote and I need to create a version of the following diagram (if this doesn’t work, see screenshot, except without that grey dot which somehow got in my screenshot): \begin{...
user avatar
0 votes
2 answers
87 views

Force triangles to have same size despite different content

I have the following code that makes 4 triangles: \documentclass[crop,tikz]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{shapes} \begin{document} \tikzstyle{triangle} =...
user avatar
3 votes
2 answers
1k views

How do you name nodes/vertices with this type of code?

\begin{figure}[!h] \centering \begin{tikzpicture} \draw (0,0) \foreach \i in {5} \foreach \j in {1,...,\i}{ -- ++(360/\i*\j:2) }; \end{tikzpicture} \caption*{Note: Figure not drawn to scale.} \end{...
user avatar
  • 125
2 votes
1 answer
80 views

How do I pass a curved line through a relative coordinate in a polygon using Tikz?

I haven't found an answer that quite fits my situation. I need to link two rectangles, with a curved arrow, passing through the bottom right of a third rectangle, avoiding the text. I'm using a ...
user avatar
  • 473
1 vote
1 answer
178 views

Drawing a polygon of polygons

This question is vagely related to https://math.stackexchange.com/questions/3449433/selecting-cards-to-form-a-fair-game?noredirect=1#comment7090962_3449433. I am trying to visually illustrate the ways ...
user avatar
4 votes
2 answers
337 views

Drawing complex inscribed and circumscribed polygons in TikZ

I'm creating Traveller TNE character and ship sheets for my campaign and decided I could use this as a TikZ learning opportunity. However, the heading display seems to exceed my current level of skill....
user avatar
4 votes
1 answer
89 views

Fill polygonal node with image and rotate it

I need to fill a triangular node with an image, and rotate it at various angles. My approach for filling the node with an image is based on this one, and it works great if my node is not rotated, or ...
user avatar
0 votes
1 answer
313 views

How to draw irregular hendecagon in asymptote

I am sorry if this is a duplicate question but how would I draw an irregular hendecagon using asymptote? I am new to it and I know how to draw a regular one but not an irregular one. [asy] size(9cm); ...
user avatar
3 votes
1 answer
291 views

Problem with fill color

I use the following command to create regular polygons. The 5th argument is there to insert options for styling the polygons. Though the line width is 0.3mm as I set it, it looks like the fill=red ...
user avatar
  • 1,379
1 vote
1 answer
183 views

Coloring edges of a polygon differently

I would like to draw a regular 21 polygon, where the edges are labelled and have arrows in the middle using different colors. This is what I have done so far using this code \documentclass[...
user avatar
3 votes
2 answers
643 views

Arrows on edges of polygon

I would like to draw a regual 21 polygon, where the edges are labelled and have arrows in the middle. But I don't know how to get the arrows. This is what I have done so far \documentclass[border=5mm,...
user avatar
5 votes
3 answers
353 views

Colorize sides regular polygon

To illustrate what edge-coloring is, I'd like to colorize a regular polygon. I want to generate the shape using TikZ, then colorize the sides (edges) of the polygon separately, for instance by doing ...
user avatar
4 votes
2 answers
267 views

Position nodes relative to regular polygon anchors

I have a regular polygon, and I'd like to position nodes for instance above the first corner, or next to the nth side. This is my sample: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{...
user avatar
2 votes
2 answers
107 views

Efficient way of performing geometrical operations

I have to draw a series of regular (equiangular, actually) polygons, each of which is constructed by trisecting the sides of the previous polygon and subsequently cutting off its corners. Right now I'...
user avatar
  • 426
1 vote
1 answer
2k views

Filling a polygon defined by `\node` command

I draw a polygon using \node in TikZ, and I want to fill the polygon. When I use this method, it obviously fails because I do not use \coordinate to create the polygon. Is there a way to fill a ...
user avatar
  • 1,372
1 vote
1 answer
87 views

Translate some points of a polygon

I'm with a problem on this figure \documentclass{standalone} \usepackage{tikz, tkz-euclide} \usetkzobj{all} \begin{document} \begin{tikzpicture}[scale=4] \tkzDefPoints{0/0/D, .2/.5/P1, .7/....
user avatar
  • 161
3 votes
1 answer
207 views

What package(s) and commands do I need to create shapes as thought of by Jacob Barnett in LaTeX?

I watched both the "60 minutes" talk and the "numberphile" youtube video discussing how Jacob Barnett sees numbers as shapes. In both of them they mention that Barnett sees numbers as fractal-like ...
user avatar
  • 141
1 vote
0 answers
206 views

Drawing a polygon and using a third dimension to define the color

I would like to draw a polygon, with a non-regular shape, providing coordinates x and y. I know how to do it, e.g., by using the answer provided here. However, I would like to use the third dimension, ...
user avatar
3 votes
1 answer
80 views

Manipulating a polygon after few operations?

I've two polygons. The polygon have undergone some transformation like rotation and shifting. Suppose after the transformation, say as an example, how do I draw a perpendicular bisector from one of ...
user avatar
  • 163
2 votes
2 answers
641 views

drawing a line at the intersection of polygons?

I have two intersecting polygon. Since I am filling and drawing the second polygon on top of it, the first polygon becomes hidden(at the overlapping areas). I want to show the the overlap of first ...
user avatar
  • 163
5 votes
1 answer
205 views

Polygons one beside another

I'm trying to do two regular polygons side by side, but the second one always gets bigger then what I want. Could anyone help me? This requires tkz-obj-polygons.tex, which a beta-version of code for ...
user avatar
  • 161
2 votes
1 answer
1k views

How do I label vertices of polygons?

I am new to Tzik and only have basic knowledge, but I want to label the vertices of my polygon with non numeric symbols? but I only got \begin{figure}[h] \centering \begin{tikzpicture}[rotate=...
user avatar
15 votes
1 answer
2k views

How to draw a polygon with different line color and rounded corners?

I want to draw a polygon with different line color and rounded corners, but the corners of polygon are not rounded! \documentclass[12pt]{report} \usepackage{tikz} \begin{document} \begin{tikzpicture}[...
user avatar
  • 575
1 vote
2 answers
355 views

intersection of functions or polygon tikz?

Hello I am creating a plot using tikz I have created 3 functions on a plot and took the area above each of them using drawge. My question is how I can fill the area above intersection of two functions ...
user avatar
  • 25
5 votes
6 answers
7k views

How to draw a path to form a regular pentagon?

I already have a code that draws a regular hexagon the following way \begin{tikzpicture}[every node/.style={draw,shape=circle,fill=blue}] \path (0,0) node (p0) {} (-1.5,-1) node (p1) {} (-1.5,-2.5) ...
user avatar
  • 283
5 votes
4 answers
1k views

Filling a percentage of a regular polygon

I want to fill a polygon with a color. First of all the n-polygon should be divided in n equal parts. I've found a question similar to this: Drawing polygons And the solution of @Yori was almost wat ...
user avatar
15 votes
4 answers
1k views

polygons side by side

Could help me please, I tried to draw many polygons side by side without success! This is what I want My MWE: \documentclass{article} \usepackage{xcolor} \usepackage{pgf,tikz} \usetikzlibrary{...
user avatar
  • 1,382