How to fill a hexagon with vertices obtained from intersecting lines?
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-poly,pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
psset{unit=3.5cm,PstPicture=false,dotsize=.03}
PstHexagon[PolyName=A]
pspolygon(A1)(A3)(A5)
pspolygon(A2)(A4)(A6)
foreach m/n/p/q in
{3/2/1/90,2/1/2/45,1/6/3/-45,6/5/4/-90,5/4/5/-135,4/3/6/135}{%
pstMiddleAB[PosAngle=q]{Am}{An}{M_p}}
foreach m/n/p in {0/1/3,70/2/2,110/3/1,180/4/6,-110/5/5,-70/6/4}
{uput[m](An){$A_p$}}
foreach m/n/p/q/t/r in {1/3/4/2/90/1,2/6/1/3/45/2,1/5/2/6/-45/3,1/5/4/6/-90/4,3/5/4/6/-135/5,2/4/3/5/135/6}{pstInterLL[PosAngle=t]{Am}{An}{Ap}{Aq}{C_r}}
foreach m/n in {1/3,2/4,3/5,4/6,5/1,6/2}{ncLine{M_m}{C_n}}
foreach i in {1,...,6}{psdot(Ai)}
end{pspicture}
end{document}
I don't want to use many pstInterLL
calls to fill the green region above.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
Awesome ... TikZ code is serene.
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-poly,pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
psset{unit=3.5cm,PstPicture=false,dotsize=.03}
PstHexagon[PolyName=A]
pspolygon(A1)(A3)(A5)
pspolygon(A2)(A4)(A6)
foreach m/n/p/q in
{3/2/1/90,2/1/2/45,1/6/3/-45,6/5/4/-90,5/4/5/-135,4/3/6/135}{%
pstMiddleAB[PosAngle=q]{Am}{An}{Mp}}
foreach m/n/p in {0/1/3,70/2/2,110/3/1,180/4/6,-110/5/5,-70/6/4}
{uput[m](An){$A_p$}}
foreach m/n/p/q/t/r in {1/3/4/2/90/1,2/6/1/3/45/2,1/5/2/6/-45/3,1/5/4/6/-90/4,3/5/4/6/-135/5,2/4/3/5/135/6}{pstInterLL[PosAngle=t]{Am}{An}{Ap}{Aq}{Cr}}
foreach m/n/p/q/r in
{1/3/6/2/1,1/3/2/4/2,3/5/2/4/3,3/5/4/6/4,5/1/4/6/5,5/1/6/2/6}
{pstInterLL[PointName=none,PointSymbol=none]{Mm}{Cn}{Mp}{Cq}{ir}}
pspolygon*[linecolor=green](i1)(i2)(i3)(i4)(i5)(i6)
foreach m/n in {1/3,2/4,3/5,4/6,5/1,6/2}{ncLine{Mm}{Cn}}
foreach i in {1,...,6}{psdot(Ai)}
end{pspicture}
end{document}
pstricks
add a comment |
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-poly,pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
psset{unit=3.5cm,PstPicture=false,dotsize=.03}
PstHexagon[PolyName=A]
pspolygon(A1)(A3)(A5)
pspolygon(A2)(A4)(A6)
foreach m/n/p/q in
{3/2/1/90,2/1/2/45,1/6/3/-45,6/5/4/-90,5/4/5/-135,4/3/6/135}{%
pstMiddleAB[PosAngle=q]{Am}{An}{M_p}}
foreach m/n/p in {0/1/3,70/2/2,110/3/1,180/4/6,-110/5/5,-70/6/4}
{uput[m](An){$A_p$}}
foreach m/n/p/q/t/r in {1/3/4/2/90/1,2/6/1/3/45/2,1/5/2/6/-45/3,1/5/4/6/-90/4,3/5/4/6/-135/5,2/4/3/5/135/6}{pstInterLL[PosAngle=t]{Am}{An}{Ap}{Aq}{C_r}}
foreach m/n in {1/3,2/4,3/5,4/6,5/1,6/2}{ncLine{M_m}{C_n}}
foreach i in {1,...,6}{psdot(Ai)}
end{pspicture}
end{document}
I don't want to use many pstInterLL
calls to fill the green region above.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
Awesome ... TikZ code is serene.
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-poly,pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
psset{unit=3.5cm,PstPicture=false,dotsize=.03}
PstHexagon[PolyName=A]
pspolygon(A1)(A3)(A5)
pspolygon(A2)(A4)(A6)
foreach m/n/p/q in
{3/2/1/90,2/1/2/45,1/6/3/-45,6/5/4/-90,5/4/5/-135,4/3/6/135}{%
pstMiddleAB[PosAngle=q]{Am}{An}{Mp}}
foreach m/n/p in {0/1/3,70/2/2,110/3/1,180/4/6,-110/5/5,-70/6/4}
{uput[m](An){$A_p$}}
foreach m/n/p/q/t/r in {1/3/4/2/90/1,2/6/1/3/45/2,1/5/2/6/-45/3,1/5/4/6/-90/4,3/5/4/6/-135/5,2/4/3/5/135/6}{pstInterLL[PosAngle=t]{Am}{An}{Ap}{Aq}{Cr}}
foreach m/n/p/q/r in
{1/3/6/2/1,1/3/2/4/2,3/5/2/4/3,3/5/4/6/4,5/1/4/6/5,5/1/6/2/6}
{pstInterLL[PointName=none,PointSymbol=none]{Mm}{Cn}{Mp}{Cq}{ir}}
pspolygon*[linecolor=green](i1)(i2)(i3)(i4)(i5)(i6)
foreach m/n in {1/3,2/4,3/5,4/6,5/1,6/2}{ncLine{Mm}{Cn}}
foreach i in {1,...,6}{psdot(Ai)}
end{pspicture}
end{document}
pstricks
3
If this were TikZ, I would use the intersections library to find the vertices.
– John Kormylo
Jan 8 at 15:55
add a comment |
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-poly,pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
psset{unit=3.5cm,PstPicture=false,dotsize=.03}
PstHexagon[PolyName=A]
pspolygon(A1)(A3)(A5)
pspolygon(A2)(A4)(A6)
foreach m/n/p/q in
{3/2/1/90,2/1/2/45,1/6/3/-45,6/5/4/-90,5/4/5/-135,4/3/6/135}{%
pstMiddleAB[PosAngle=q]{Am}{An}{M_p}}
foreach m/n/p in {0/1/3,70/2/2,110/3/1,180/4/6,-110/5/5,-70/6/4}
{uput[m](An){$A_p$}}
foreach m/n/p/q/t/r in {1/3/4/2/90/1,2/6/1/3/45/2,1/5/2/6/-45/3,1/5/4/6/-90/4,3/5/4/6/-135/5,2/4/3/5/135/6}{pstInterLL[PosAngle=t]{Am}{An}{Ap}{Aq}{C_r}}
foreach m/n in {1/3,2/4,3/5,4/6,5/1,6/2}{ncLine{M_m}{C_n}}
foreach i in {1,...,6}{psdot(Ai)}
end{pspicture}
end{document}
I don't want to use many pstInterLL
calls to fill the green region above.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
Awesome ... TikZ code is serene.
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-poly,pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
psset{unit=3.5cm,PstPicture=false,dotsize=.03}
PstHexagon[PolyName=A]
pspolygon(A1)(A3)(A5)
pspolygon(A2)(A4)(A6)
foreach m/n/p/q in
{3/2/1/90,2/1/2/45,1/6/3/-45,6/5/4/-90,5/4/5/-135,4/3/6/135}{%
pstMiddleAB[PosAngle=q]{Am}{An}{Mp}}
foreach m/n/p in {0/1/3,70/2/2,110/3/1,180/4/6,-110/5/5,-70/6/4}
{uput[m](An){$A_p$}}
foreach m/n/p/q/t/r in {1/3/4/2/90/1,2/6/1/3/45/2,1/5/2/6/-45/3,1/5/4/6/-90/4,3/5/4/6/-135/5,2/4/3/5/135/6}{pstInterLL[PosAngle=t]{Am}{An}{Ap}{Aq}{Cr}}
foreach m/n/p/q/r in
{1/3/6/2/1,1/3/2/4/2,3/5/2/4/3,3/5/4/6/4,5/1/4/6/5,5/1/6/2/6}
{pstInterLL[PointName=none,PointSymbol=none]{Mm}{Cn}{Mp}{Cq}{ir}}
pspolygon*[linecolor=green](i1)(i2)(i3)(i4)(i5)(i6)
foreach m/n in {1/3,2/4,3/5,4/6,5/1,6/2}{ncLine{Mm}{Cn}}
foreach i in {1,...,6}{psdot(Ai)}
end{pspicture}
end{document}
pstricks
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-poly,pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
psset{unit=3.5cm,PstPicture=false,dotsize=.03}
PstHexagon[PolyName=A]
pspolygon(A1)(A3)(A5)
pspolygon(A2)(A4)(A6)
foreach m/n/p/q in
{3/2/1/90,2/1/2/45,1/6/3/-45,6/5/4/-90,5/4/5/-135,4/3/6/135}{%
pstMiddleAB[PosAngle=q]{Am}{An}{M_p}}
foreach m/n/p in {0/1/3,70/2/2,110/3/1,180/4/6,-110/5/5,-70/6/4}
{uput[m](An){$A_p$}}
foreach m/n/p/q/t/r in {1/3/4/2/90/1,2/6/1/3/45/2,1/5/2/6/-45/3,1/5/4/6/-90/4,3/5/4/6/-135/5,2/4/3/5/135/6}{pstInterLL[PosAngle=t]{Am}{An}{Ap}{Aq}{C_r}}
foreach m/n in {1/3,2/4,3/5,4/6,5/1,6/2}{ncLine{M_m}{C_n}}
foreach i in {1,...,6}{psdot(Ai)}
end{pspicture}
end{document}
I don't want to use many pstInterLL
calls to fill the green region above.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
Awesome ... TikZ code is serene.
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-poly,pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
psset{unit=3.5cm,PstPicture=false,dotsize=.03}
PstHexagon[PolyName=A]
pspolygon(A1)(A3)(A5)
pspolygon(A2)(A4)(A6)
foreach m/n/p/q in
{3/2/1/90,2/1/2/45,1/6/3/-45,6/5/4/-90,5/4/5/-135,4/3/6/135}{%
pstMiddleAB[PosAngle=q]{Am}{An}{Mp}}
foreach m/n/p in {0/1/3,70/2/2,110/3/1,180/4/6,-110/5/5,-70/6/4}
{uput[m](An){$A_p$}}
foreach m/n/p/q/t/r in {1/3/4/2/90/1,2/6/1/3/45/2,1/5/2/6/-45/3,1/5/4/6/-90/4,3/5/4/6/-135/5,2/4/3/5/135/6}{pstInterLL[PosAngle=t]{Am}{An}{Ap}{Aq}{Cr}}
foreach m/n/p/q/r in
{1/3/6/2/1,1/3/2/4/2,3/5/2/4/3,3/5/4/6/4,5/1/4/6/5,5/1/6/2/6}
{pstInterLL[PointName=none,PointSymbol=none]{Mm}{Cn}{Mp}{Cq}{ir}}
pspolygon*[linecolor=green](i1)(i2)(i3)(i4)(i5)(i6)
foreach m/n in {1/3,2/4,3/5,4/6,5/1,6/2}{ncLine{Mm}{Cn}}
foreach i in {1,...,6}{psdot(Ai)}
end{pspicture}
end{document}
pstricks
pstricks
edited Jan 9 at 2:07
Trong Vuong
asked Jan 8 at 15:46
Trong VuongTrong Vuong
7381323
7381323
3
If this were TikZ, I would use the intersections library to find the vertices.
– John Kormylo
Jan 8 at 15:55
add a comment |
3
If this were TikZ, I would use the intersections library to find the vertices.
– John Kormylo
Jan 8 at 15:55
3
3
If this were TikZ, I would use the intersections library to find the vertices.
– John Kormylo
Jan 8 at 15:55
If this were TikZ, I would use the intersections library to find the vertices.
– John Kormylo
Jan 8 at 15:55
add a comment |
4 Answers
4
active
oldest
votes
Trivial lines are intentionally ignored for the sake of fun.
documentclass[pstricks,border=1cm,12pt]{standalone}
usepackage{pst-eucl}
begin{document}
pspicture(-5,-5)(5,5)
foreach i in {1,...,6}{%
pstGeonode[PointName=A_i,PosAngle=thenumexpr(-i+1)*60+120](!5 pscalculate{(-i+1)*60+120} PtoC){Athenumexpri-1}
pstGeonode[PointName=M_i,PosAngle=thenumexpr(-i+1)*60+90](!5 60 sin mul pscalculate{(-i+1)*60+90} PtoC){Mthenumexpri-1}
pstGeonode[PointName=C_i,PosAngle=thenumexpr(-i+1)*60+90](!3 pscalculate{(-i+1)*60+90} PtoC){Cthenumexpri-1}
}
psnpolygon(0,5){A}
psnpolygon(0,5){C}
psset{PointName=none,PointSymbol=none}
pstInterLL{C0}{M4}{C1}{M5}{N0}
pnode(0,0){O}
foreach i in {1,...,5}{pstRotation[RotAngle=thenumexpr60*i]{O}{N0}[Ni]}
psnpolygon[fillstyle=solid,fillcolor=yellow](0,5){N}
endpspicture
end{document}
1
psnpolygon(startindex,stopindex){nodenameprefix}
creates a polygon based on a series of consecutive nodes.
– Artificial Hairless Armpit
Jan 8 at 17:08
I made the labels radially outward because it is good.
– Artificial Hairless Armpit
Jan 8 at 17:33
add a comment |
This is in the case you do not want to compute things by yourself and let TikZ find the contour.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{intersections,backgrounds}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=180-60*i:$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw[name path global=i-path] (150-60*i:rm) coordinate[label=150-60*i:$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=150-60*i:$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
foreach i [remember=i as j (initially 6)] in {1,...,6}
{
path[name intersections={of=i-path and j-path,by=i-i}];
}
begin{scope}[on background layer]
fill[blue] plot[variable=i,samples=6,domain=1:6] (i-i);
end{scope}
end{tikzpicture}
end{document}
2
Making radially outward labels might make it look nicer. :-)
– Artificial Hairless Armpit
Jan 8 at 18:25
1
@GodMustBeCrazy You're right. Thanks! (Really easy to implement with TikZ.)
– marmot
Jan 8 at 18:29
add a comment |
The shapes library can easily make hexagons:
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}
node[fill=green!50!black,regular polygon, regular polygon sides=6,
inner sep=0.73cm,rotate=-7] at (0,0) {};
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
add a comment |
Can be simplified with some psforeach
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon[linejoin=2](A1)(A3)(A5)(A6)(A2)(A4)(A6)(A5)(A4)(A3)(A2)(A1)(A5)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
psset{PointName=none,PointSymbol=none}
pstInterLL{M1}{C5}{M2}{C6}{i1} pstInterLL{M2}{C6}{M3}{C1}{i2}
pstInterLL{M3}{C1}{M4}{C2}{i3} pstInterLL{M4}{C2}{M5}{C3}{i4}
pstInterLL{M5}{C3}{M6}{C4}{i5} pstInterLL{M6}{C4}{M1}{C5}{i6}
pspolygon*[linecolor=blue](i1)(i2)(i3)(i4)(i5)(i6)
end{pspicture}
end{document}
and a shorter version without intersections:
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon(A1)(A2)(A3)(A4)(A5)(A6)pspolygon(A1)(A3)(A5)pspolygon(A2)(A4)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
pspolygon*[linecolor=red!40]%
(1.19;0.9)(1.19;1.9)(1.19;2.9)(1.19;3.9)(1.19;4.9)(1.19;5.9)
end{pspicture}
OP's node names are placed clockwise and you forgot the lineA2-A4
.
– Artificial Hairless Armpit
Jan 10 at 2:32
add a comment |
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469184%2fhow-to-fill-a-hexagon-with-vertices-obtained-from-intersecting-lines%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Trivial lines are intentionally ignored for the sake of fun.
documentclass[pstricks,border=1cm,12pt]{standalone}
usepackage{pst-eucl}
begin{document}
pspicture(-5,-5)(5,5)
foreach i in {1,...,6}{%
pstGeonode[PointName=A_i,PosAngle=thenumexpr(-i+1)*60+120](!5 pscalculate{(-i+1)*60+120} PtoC){Athenumexpri-1}
pstGeonode[PointName=M_i,PosAngle=thenumexpr(-i+1)*60+90](!5 60 sin mul pscalculate{(-i+1)*60+90} PtoC){Mthenumexpri-1}
pstGeonode[PointName=C_i,PosAngle=thenumexpr(-i+1)*60+90](!3 pscalculate{(-i+1)*60+90} PtoC){Cthenumexpri-1}
}
psnpolygon(0,5){A}
psnpolygon(0,5){C}
psset{PointName=none,PointSymbol=none}
pstInterLL{C0}{M4}{C1}{M5}{N0}
pnode(0,0){O}
foreach i in {1,...,5}{pstRotation[RotAngle=thenumexpr60*i]{O}{N0}[Ni]}
psnpolygon[fillstyle=solid,fillcolor=yellow](0,5){N}
endpspicture
end{document}
1
psnpolygon(startindex,stopindex){nodenameprefix}
creates a polygon based on a series of consecutive nodes.
– Artificial Hairless Armpit
Jan 8 at 17:08
I made the labels radially outward because it is good.
– Artificial Hairless Armpit
Jan 8 at 17:33
add a comment |
Trivial lines are intentionally ignored for the sake of fun.
documentclass[pstricks,border=1cm,12pt]{standalone}
usepackage{pst-eucl}
begin{document}
pspicture(-5,-5)(5,5)
foreach i in {1,...,6}{%
pstGeonode[PointName=A_i,PosAngle=thenumexpr(-i+1)*60+120](!5 pscalculate{(-i+1)*60+120} PtoC){Athenumexpri-1}
pstGeonode[PointName=M_i,PosAngle=thenumexpr(-i+1)*60+90](!5 60 sin mul pscalculate{(-i+1)*60+90} PtoC){Mthenumexpri-1}
pstGeonode[PointName=C_i,PosAngle=thenumexpr(-i+1)*60+90](!3 pscalculate{(-i+1)*60+90} PtoC){Cthenumexpri-1}
}
psnpolygon(0,5){A}
psnpolygon(0,5){C}
psset{PointName=none,PointSymbol=none}
pstInterLL{C0}{M4}{C1}{M5}{N0}
pnode(0,0){O}
foreach i in {1,...,5}{pstRotation[RotAngle=thenumexpr60*i]{O}{N0}[Ni]}
psnpolygon[fillstyle=solid,fillcolor=yellow](0,5){N}
endpspicture
end{document}
1
psnpolygon(startindex,stopindex){nodenameprefix}
creates a polygon based on a series of consecutive nodes.
– Artificial Hairless Armpit
Jan 8 at 17:08
I made the labels radially outward because it is good.
– Artificial Hairless Armpit
Jan 8 at 17:33
add a comment |
Trivial lines are intentionally ignored for the sake of fun.
documentclass[pstricks,border=1cm,12pt]{standalone}
usepackage{pst-eucl}
begin{document}
pspicture(-5,-5)(5,5)
foreach i in {1,...,6}{%
pstGeonode[PointName=A_i,PosAngle=thenumexpr(-i+1)*60+120](!5 pscalculate{(-i+1)*60+120} PtoC){Athenumexpri-1}
pstGeonode[PointName=M_i,PosAngle=thenumexpr(-i+1)*60+90](!5 60 sin mul pscalculate{(-i+1)*60+90} PtoC){Mthenumexpri-1}
pstGeonode[PointName=C_i,PosAngle=thenumexpr(-i+1)*60+90](!3 pscalculate{(-i+1)*60+90} PtoC){Cthenumexpri-1}
}
psnpolygon(0,5){A}
psnpolygon(0,5){C}
psset{PointName=none,PointSymbol=none}
pstInterLL{C0}{M4}{C1}{M5}{N0}
pnode(0,0){O}
foreach i in {1,...,5}{pstRotation[RotAngle=thenumexpr60*i]{O}{N0}[Ni]}
psnpolygon[fillstyle=solid,fillcolor=yellow](0,5){N}
endpspicture
end{document}
Trivial lines are intentionally ignored for the sake of fun.
documentclass[pstricks,border=1cm,12pt]{standalone}
usepackage{pst-eucl}
begin{document}
pspicture(-5,-5)(5,5)
foreach i in {1,...,6}{%
pstGeonode[PointName=A_i,PosAngle=thenumexpr(-i+1)*60+120](!5 pscalculate{(-i+1)*60+120} PtoC){Athenumexpri-1}
pstGeonode[PointName=M_i,PosAngle=thenumexpr(-i+1)*60+90](!5 60 sin mul pscalculate{(-i+1)*60+90} PtoC){Mthenumexpri-1}
pstGeonode[PointName=C_i,PosAngle=thenumexpr(-i+1)*60+90](!3 pscalculate{(-i+1)*60+90} PtoC){Cthenumexpri-1}
}
psnpolygon(0,5){A}
psnpolygon(0,5){C}
psset{PointName=none,PointSymbol=none}
pstInterLL{C0}{M4}{C1}{M5}{N0}
pnode(0,0){O}
foreach i in {1,...,5}{pstRotation[RotAngle=thenumexpr60*i]{O}{N0}[Ni]}
psnpolygon[fillstyle=solid,fillcolor=yellow](0,5){N}
endpspicture
end{document}
answered Jan 8 at 17:00
Artificial Hairless ArmpitArtificial Hairless Armpit
5,02711142
5,02711142
1
psnpolygon(startindex,stopindex){nodenameprefix}
creates a polygon based on a series of consecutive nodes.
– Artificial Hairless Armpit
Jan 8 at 17:08
I made the labels radially outward because it is good.
– Artificial Hairless Armpit
Jan 8 at 17:33
add a comment |
1
psnpolygon(startindex,stopindex){nodenameprefix}
creates a polygon based on a series of consecutive nodes.
– Artificial Hairless Armpit
Jan 8 at 17:08
I made the labels radially outward because it is good.
– Artificial Hairless Armpit
Jan 8 at 17:33
1
1
psnpolygon(startindex,stopindex){nodenameprefix}
creates a polygon based on a series of consecutive nodes.– Artificial Hairless Armpit
Jan 8 at 17:08
psnpolygon(startindex,stopindex){nodenameprefix}
creates a polygon based on a series of consecutive nodes.– Artificial Hairless Armpit
Jan 8 at 17:08
I made the labels radially outward because it is good.
– Artificial Hairless Armpit
Jan 8 at 17:33
I made the labels radially outward because it is good.
– Artificial Hairless Armpit
Jan 8 at 17:33
add a comment |
This is in the case you do not want to compute things by yourself and let TikZ find the contour.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{intersections,backgrounds}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=180-60*i:$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw[name path global=i-path] (150-60*i:rm) coordinate[label=150-60*i:$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=150-60*i:$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
foreach i [remember=i as j (initially 6)] in {1,...,6}
{
path[name intersections={of=i-path and j-path,by=i-i}];
}
begin{scope}[on background layer]
fill[blue] plot[variable=i,samples=6,domain=1:6] (i-i);
end{scope}
end{tikzpicture}
end{document}
2
Making radially outward labels might make it look nicer. :-)
– Artificial Hairless Armpit
Jan 8 at 18:25
1
@GodMustBeCrazy You're right. Thanks! (Really easy to implement with TikZ.)
– marmot
Jan 8 at 18:29
add a comment |
This is in the case you do not want to compute things by yourself and let TikZ find the contour.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{intersections,backgrounds}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=180-60*i:$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw[name path global=i-path] (150-60*i:rm) coordinate[label=150-60*i:$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=150-60*i:$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
foreach i [remember=i as j (initially 6)] in {1,...,6}
{
path[name intersections={of=i-path and j-path,by=i-i}];
}
begin{scope}[on background layer]
fill[blue] plot[variable=i,samples=6,domain=1:6] (i-i);
end{scope}
end{tikzpicture}
end{document}
2
Making radially outward labels might make it look nicer. :-)
– Artificial Hairless Armpit
Jan 8 at 18:25
1
@GodMustBeCrazy You're right. Thanks! (Really easy to implement with TikZ.)
– marmot
Jan 8 at 18:29
add a comment |
This is in the case you do not want to compute things by yourself and let TikZ find the contour.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{intersections,backgrounds}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=180-60*i:$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw[name path global=i-path] (150-60*i:rm) coordinate[label=150-60*i:$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=150-60*i:$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
foreach i [remember=i as j (initially 6)] in {1,...,6}
{
path[name intersections={of=i-path and j-path,by=i-i}];
}
begin{scope}[on background layer]
fill[blue] plot[variable=i,samples=6,domain=1:6] (i-i);
end{scope}
end{tikzpicture}
end{document}
This is in the case you do not want to compute things by yourself and let TikZ find the contour.
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{intersections,backgrounds}
begin{document}
begin{tikzpicture}
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=180-60*i:$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw[name path global=i-path] (150-60*i:rm) coordinate[label=150-60*i:$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=150-60*i:$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
foreach i [remember=i as j (initially 6)] in {1,...,6}
{
path[name intersections={of=i-path and j-path,by=i-i}];
}
begin{scope}[on background layer]
fill[blue] plot[variable=i,samples=6,domain=1:6] (i-i);
end{scope}
end{tikzpicture}
end{document}
edited Jan 8 at 18:29
answered Jan 8 at 17:31
marmotmarmot
113k5145275
113k5145275
2
Making radially outward labels might make it look nicer. :-)
– Artificial Hairless Armpit
Jan 8 at 18:25
1
@GodMustBeCrazy You're right. Thanks! (Really easy to implement with TikZ.)
– marmot
Jan 8 at 18:29
add a comment |
2
Making radially outward labels might make it look nicer. :-)
– Artificial Hairless Armpit
Jan 8 at 18:25
1
@GodMustBeCrazy You're right. Thanks! (Really easy to implement with TikZ.)
– marmot
Jan 8 at 18:29
2
2
Making radially outward labels might make it look nicer. :-)
– Artificial Hairless Armpit
Jan 8 at 18:25
Making radially outward labels might make it look nicer. :-)
– Artificial Hairless Armpit
Jan 8 at 18:25
1
1
@GodMustBeCrazy You're right. Thanks! (Really easy to implement with TikZ.)
– marmot
Jan 8 at 18:29
@GodMustBeCrazy You're right. Thanks! (Really easy to implement with TikZ.)
– marmot
Jan 8 at 18:29
add a comment |
The shapes library can easily make hexagons:
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}
node[fill=green!50!black,regular polygon, regular polygon sides=6,
inner sep=0.73cm,rotate=-7] at (0,0) {};
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
add a comment |
The shapes library can easily make hexagons:
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}
node[fill=green!50!black,regular polygon, regular polygon sides=6,
inner sep=0.73cm,rotate=-7] at (0,0) {};
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
add a comment |
The shapes library can easily make hexagons:
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}
node[fill=green!50!black,regular polygon, regular polygon sides=6,
inner sep=0.73cm,rotate=-7] at (0,0) {};
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
The shapes library can easily make hexagons:
documentclass[12pt,border=15pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}
node[fill=green!50!black,regular polygon, regular polygon sides=6,
inner sep=0.73cm,rotate=-7] at (0,0) {};
defr{3}
pgfmathsetmacro{rm}{r *sqrt(3)/2}
pgfmathsetmacro{rc}{rm *2/3}
foreach i in {1,...,6}{
draw (180-60*i:r) coordinate[label=$A_{i}$] (ai) --(120-60*i:r);
draw (180-60*i:r)--(60-60*i:r);
draw (150-60*i:rm) coordinate[label=$M_{i}$] (mi) --(30-60*i:rc);
draw (150-60*i:rc) coordinate[label=$C_{i}$] (ci) --(90-60*i:rc);
fill[black] (ai) circle (0.05);
fill[black] (mi) circle (0.05);
fill[black] (ci) circle (0.05);
}
end{tikzpicture}
end{document}
answered Jan 8 at 17:12
user177954
add a comment |
add a comment |
Can be simplified with some psforeach
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon[linejoin=2](A1)(A3)(A5)(A6)(A2)(A4)(A6)(A5)(A4)(A3)(A2)(A1)(A5)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
psset{PointName=none,PointSymbol=none}
pstInterLL{M1}{C5}{M2}{C6}{i1} pstInterLL{M2}{C6}{M3}{C1}{i2}
pstInterLL{M3}{C1}{M4}{C2}{i3} pstInterLL{M4}{C2}{M5}{C3}{i4}
pstInterLL{M5}{C3}{M6}{C4}{i5} pstInterLL{M6}{C4}{M1}{C5}{i6}
pspolygon*[linecolor=blue](i1)(i2)(i3)(i4)(i5)(i6)
end{pspicture}
end{document}
and a shorter version without intersections:
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon(A1)(A2)(A3)(A4)(A5)(A6)pspolygon(A1)(A3)(A5)pspolygon(A2)(A4)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
pspolygon*[linecolor=red!40]%
(1.19;0.9)(1.19;1.9)(1.19;2.9)(1.19;3.9)(1.19;4.9)(1.19;5.9)
end{pspicture}
OP's node names are placed clockwise and you forgot the lineA2-A4
.
– Artificial Hairless Armpit
Jan 10 at 2:32
add a comment |
Can be simplified with some psforeach
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon[linejoin=2](A1)(A3)(A5)(A6)(A2)(A4)(A6)(A5)(A4)(A3)(A2)(A1)(A5)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
psset{PointName=none,PointSymbol=none}
pstInterLL{M1}{C5}{M2}{C6}{i1} pstInterLL{M2}{C6}{M3}{C1}{i2}
pstInterLL{M3}{C1}{M4}{C2}{i3} pstInterLL{M4}{C2}{M5}{C3}{i4}
pstInterLL{M5}{C3}{M6}{C4}{i5} pstInterLL{M6}{C4}{M1}{C5}{i6}
pspolygon*[linecolor=blue](i1)(i2)(i3)(i4)(i5)(i6)
end{pspicture}
end{document}
and a shorter version without intersections:
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon(A1)(A2)(A3)(A4)(A5)(A6)pspolygon(A1)(A3)(A5)pspolygon(A2)(A4)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
pspolygon*[linecolor=red!40]%
(1.19;0.9)(1.19;1.9)(1.19;2.9)(1.19;3.9)(1.19;4.9)(1.19;5.9)
end{pspicture}
OP's node names are placed clockwise and you forgot the lineA2-A4
.
– Artificial Hairless Armpit
Jan 10 at 2:32
add a comment |
Can be simplified with some psforeach
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon[linejoin=2](A1)(A3)(A5)(A6)(A2)(A4)(A6)(A5)(A4)(A3)(A2)(A1)(A5)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
psset{PointName=none,PointSymbol=none}
pstInterLL{M1}{C5}{M2}{C6}{i1} pstInterLL{M2}{C6}{M3}{C1}{i2}
pstInterLL{M3}{C1}{M4}{C2}{i3} pstInterLL{M4}{C2}{M5}{C3}{i4}
pstInterLL{M5}{C3}{M6}{C4}{i5} pstInterLL{M6}{C4}{M1}{C5}{i6}
pspolygon*[linecolor=blue](i1)(i2)(i3)(i4)(i5)(i6)
end{pspicture}
end{document}
and a shorter version without intersections:
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon(A1)(A2)(A3)(A4)(A5)(A6)pspolygon(A1)(A3)(A5)pspolygon(A2)(A4)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
pspolygon*[linecolor=red!40]%
(1.19;0.9)(1.19;1.9)(1.19;2.9)(1.19;3.9)(1.19;4.9)(1.19;5.9)
end{pspicture}
Can be simplified with some psforeach
documentclass[12pt,border=15pt]{standalone}
usepackage{pst-eucl}
begin{document}
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon[linejoin=2](A1)(A3)(A5)(A6)(A2)(A4)(A6)(A5)(A4)(A3)(A2)(A1)(A5)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
psset{PointName=none,PointSymbol=none}
pstInterLL{M1}{C5}{M2}{C6}{i1} pstInterLL{M2}{C6}{M3}{C1}{i2}
pstInterLL{M3}{C1}{M4}{C2}{i3} pstInterLL{M4}{C2}{M5}{C3}{i4}
pstInterLL{M5}{C3}{M6}{C4}{i5} pstInterLL{M6}{C4}{M1}{C5}{i6}
pspolygon*[linecolor=blue](i1)(i2)(i3)(i4)(i5)(i6)
end{pspicture}
end{document}
and a shorter version without intersections:
begin{pspicture}(-4,-3.5)(4,3.5)
degrees[6]
multido{iA=1+1}{6}{pnode(3;iA){AiA}uput[iA]{0}(AiA){$A_iA$}}
multido{iA=1+1,iB=2+1}{5}{psLNode(AiA)(AiB){0.5}{MiA}uput[iA]{0}(MiA){$M_iA$}}
psLNode(A6)(A1){0.5}{M6}uput[6]{0}(M6){$M_6$}
pspolygon(A1)(A2)(A3)(A4)(A5)(A6)pspolygon(A1)(A3)(A5)pspolygon(A2)(A4)(A6)
multido{iA=1+1,iB=3+1}{4}{%
psLNode(AiA)(AiB){0.333}{CiA}qdisk(CiA){2pt}%
uput[iA]{0}(CiA){$C_iA$}}
psLNode(A5)(A1){0.333}{C5}qdisk(C5){2pt}uput[5]{0}(C5){$C_5$}
psLNode(A6)(A2){0.333}{C6}qdisk(C6){2pt}uput[6]{0}(C6){$C_6$}
multido{iA=3+1,iB=1+1}{4}{psline(MiA)(CiB)}
psline(M1)(C5)psline(M2)(C6)
pspolygon*[linecolor=red!40]%
(1.19;0.9)(1.19;1.9)(1.19;2.9)(1.19;3.9)(1.19;4.9)(1.19;5.9)
end{pspicture}
edited Jan 10 at 7:18
answered Jan 8 at 19:23
user2478
OP's node names are placed clockwise and you forgot the lineA2-A4
.
– Artificial Hairless Armpit
Jan 10 at 2:32
add a comment |
OP's node names are placed clockwise and you forgot the lineA2-A4
.
– Artificial Hairless Armpit
Jan 10 at 2:32
OP's node names are placed clockwise and you forgot the line
A2-A4
.– Artificial Hairless Armpit
Jan 10 at 2:32
OP's node names are placed clockwise and you forgot the line
A2-A4
.– Artificial Hairless Armpit
Jan 10 at 2:32
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469184%2fhow-to-fill-a-hexagon-with-vertices-obtained-from-intersecting-lines%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
If this were TikZ, I would use the intersections library to find the vertices.
– John Kormylo
Jan 8 at 15:55