How to the picture of Gordon, Webb and Wolpert
Clash Royale CLAN TAG#URR8PPP
Q
I am interested in the picture above, but I do not know how to graph it.
Is there any source about it ?
tikz-pgf graphics
add a comment |
Q
I am interested in the picture above, but I do not know how to graph it.
Is there any source about it ?
tikz-pgf graphics
1
This is pretty easy withTikZ
, even with my limited knowledge ofTikZ
– Christian Hupfer
Feb 3 at 14:27
add a comment |
Q
I am interested in the picture above, but I do not know how to graph it.
Is there any source about it ?
tikz-pgf graphics
Q
I am interested in the picture above, but I do not know how to graph it.
Is there any source about it ?
tikz-pgf graphics
tikz-pgf graphics
edited Feb 3 at 14:53
DLIN
asked Feb 3 at 13:36
DLINDLIN
1403
1403
1
This is pretty easy withTikZ
, even with my limited knowledge ofTikZ
– Christian Hupfer
Feb 3 at 14:27
add a comment |
1
This is pretty easy withTikZ
, even with my limited knowledge ofTikZ
– Christian Hupfer
Feb 3 at 14:27
1
1
This is pretty easy with
TikZ
, even with my limited knowledge of TikZ
– Christian Hupfer
Feb 3 at 14:27
This is pretty easy with
TikZ
, even with my limited knowledge of TikZ
– Christian Hupfer
Feb 3 at 14:27
add a comment |
4 Answers
4
active
oldest
votes
You can simply create two pics
, a square (quadro
in my Minimal Working Example, by the way, learn how to build it for your next question) and a triangle (triang
in my MWE), with an optional argument for rotation, and use them in a TikZ matrix
.
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
tikzset%
pics/quadro/.style=code=%
draw[fill=cyan!90!gray] (0,0) rectangle (1,1);
,
pics/triang/.style=code=%
draw[fill=cyan!90!gray, rotate around=#1:(.5,.5)] (0,0) -- (0,1) -- (1,0) -- cycle;
,
pics/triang/.default=0,
mymatrix/.style=
row sep=-pgflinewidth,
column sep=-pgflinewidth
,
begindocument
begintikzpicture
matrix[mymatrix]
pic triang=90; \
pic triang=180; &pic quadro; & pic quadro; \
& & pic triang=270; \
;
endtikzpicture
begintikzpicture
matrix[mymatrix]
pic quadro; \
pic triang=180; &pic quadro; & pic triang; \
& pic triang=180; \
;
endtikzpicture
enddocument
add a comment |
Another solution with regular nodes, a squared nodes and an isosceles triangle with 90 degrees on apex angle. You can place nodes on absolute coordinates or using relative positioning.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning, shapes.geometric, matrix
begindocument
begintikzpicture[
right angle triangle/.style=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=#1!70,
draw=#1!80!black,
,
tnw/.style=
right angle triangle=#1,
shape border rotate=135,
tne/.style=
right angle triangle=#1,
shape border rotate=45,
tsw/.style=
right angle triangle=#1,
shape border rotate=-135,
tse/.style=
right angle triangle=#1,
shape border rotate=-45,
sq/.style=
minimum size=1cm,
outer sep=0pt,
draw=#1!80!black,
fill=#1!70
]
node[tse=blue] at (0,0) ;
node[tne=blue] at (0,0) ;
node[sq=blue, anchor=north west] at (0,0) ;
node[sq=blue, anchor=north west] at (1,0) ;
node[tnw=blue] at (1,-1) ;
beginscope[shift=(3cm,.5cm), node distance=0pt]
node[sq=red] at (0,0) (a) ;
%use positioning before node specification to keep apex anchor
node[below=of a.south east, tne=orange] (b) ;
node[below right=of a.south east, sq=green] (c) ;
node[right=of c.south east, tsw=blue] (d) ;
node[below=of c.south east, tne=brown] (e) ;
endscope
endtikzpicture
enddocument
Update:
Another definition of styles for the right angle triangle and square allow to simplify and unify the syntax and placement of elements. Both elements are defined with two arguments:
rat=rotation respect the apex anchorposition of apex anchor
sqr=rotation respect right vertex anchorposition of right vertex anchor
Some examples:
documentclass[tikz,border=2mm]standalone
usetikzlibraryshapes.geometric
begindocument
begintikzpicture[
%right angle triangle
rat/.style 2 args=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
%the square is a kite shape
sqr/.style 2 args=
kite,
kite vertex angles=90,
% kite lower vertex angle=90
shape border uses incircle,
outer sep=0pt,
anchor=right vertex,
minimum size=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
]
node[rat=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(1,-1)];
beginscope[shift=(4cm,0cm), node distance=0pt]
node[sqr=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[rat=45(1,-1)];
node[rat=-135(1,-1)];
endscope
beginscope[shift=(0cm,-3cm), node distance=0pt]
node[rat=-90(0,0)];
node[rat=90(0,0)];
node[rat=180(0,0)];
node[rat=-90(0,-1cm*sqrt(2))];
node[rat=0(0,-1cm*sqrt(2))];
node[rat=180(0,-1cm*sqrt(2))];
node[rat=0(1cm*sqrt(2),-1cm*sqrt(2))];
node[rat=90(1cm*sqrt(2),-1cm*sqrt(2))];
endscope
beginscope[shift=(3cm,-4cm), node distance=0pt]
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(2,0)];
node[rat=-45(1,0)];
node[rat=-135(1,0)];
endscope
endtikzpicture
enddocument
add a comment |
It's easy with TikZ. The first image is:
documentclass[10pt,a4paper]article
usepackagetikz
begindocument
tikz
definecolorLBHTML5999D4
fill[LB] (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-11.5,1) -- (-8.5,1) -- (-8.5,-2) (-2.5,-2) -- (-5.5,-2) -- (-5.5,1);
enddocument
add a comment |
These things can be conveniently obtained by using clip
, local bounding box
es and grids.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture
beginscope[local bounding box=box1]
draw[clip] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
fill[dunno] (box1.south west) rectangle (box1.north east);
draw[ultra thin] (box1.south west) grid (box1.north east);
endscope
beginscope[local bounding box=box2,xshift=4cm]
draw[clip] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
fill[dunno] (box2.south west) rectangle (box2.north east);
draw[ultra thin] (box2.south west) grid (box2.north east);
endscope
endtikzpicture
enddocument
Or, perhaps even more convenient, use a path picture
.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture[GWW/.style=path picture=fill[dunno] (path picture bounding box.south west)
rectangle (path picture bounding box.north east);
draw[ultra thin] (path picture bounding box.south west)
grid (path picture bounding box.north east);]
draw[GWW] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
beginscope[xshift=4cm]
draw[GWW] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
endscope
endtikzpicture
enddocument
add a comment |
Your Answer
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%2f473170%2fhow-to-the-picture-of-gordon-webb-and-wolpert%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
You can simply create two pics
, a square (quadro
in my Minimal Working Example, by the way, learn how to build it for your next question) and a triangle (triang
in my MWE), with an optional argument for rotation, and use them in a TikZ matrix
.
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
tikzset%
pics/quadro/.style=code=%
draw[fill=cyan!90!gray] (0,0) rectangle (1,1);
,
pics/triang/.style=code=%
draw[fill=cyan!90!gray, rotate around=#1:(.5,.5)] (0,0) -- (0,1) -- (1,0) -- cycle;
,
pics/triang/.default=0,
mymatrix/.style=
row sep=-pgflinewidth,
column sep=-pgflinewidth
,
begindocument
begintikzpicture
matrix[mymatrix]
pic triang=90; \
pic triang=180; &pic quadro; & pic quadro; \
& & pic triang=270; \
;
endtikzpicture
begintikzpicture
matrix[mymatrix]
pic quadro; \
pic triang=180; &pic quadro; & pic triang; \
& pic triang=180; \
;
endtikzpicture
enddocument
add a comment |
You can simply create two pics
, a square (quadro
in my Minimal Working Example, by the way, learn how to build it for your next question) and a triangle (triang
in my MWE), with an optional argument for rotation, and use them in a TikZ matrix
.
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
tikzset%
pics/quadro/.style=code=%
draw[fill=cyan!90!gray] (0,0) rectangle (1,1);
,
pics/triang/.style=code=%
draw[fill=cyan!90!gray, rotate around=#1:(.5,.5)] (0,0) -- (0,1) -- (1,0) -- cycle;
,
pics/triang/.default=0,
mymatrix/.style=
row sep=-pgflinewidth,
column sep=-pgflinewidth
,
begindocument
begintikzpicture
matrix[mymatrix]
pic triang=90; \
pic triang=180; &pic quadro; & pic quadro; \
& & pic triang=270; \
;
endtikzpicture
begintikzpicture
matrix[mymatrix]
pic quadro; \
pic triang=180; &pic quadro; & pic triang; \
& pic triang=180; \
;
endtikzpicture
enddocument
add a comment |
You can simply create two pics
, a square (quadro
in my Minimal Working Example, by the way, learn how to build it for your next question) and a triangle (triang
in my MWE), with an optional argument for rotation, and use them in a TikZ matrix
.
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
tikzset%
pics/quadro/.style=code=%
draw[fill=cyan!90!gray] (0,0) rectangle (1,1);
,
pics/triang/.style=code=%
draw[fill=cyan!90!gray, rotate around=#1:(.5,.5)] (0,0) -- (0,1) -- (1,0) -- cycle;
,
pics/triang/.default=0,
mymatrix/.style=
row sep=-pgflinewidth,
column sep=-pgflinewidth
,
begindocument
begintikzpicture
matrix[mymatrix]
pic triang=90; \
pic triang=180; &pic quadro; & pic quadro; \
& & pic triang=270; \
;
endtikzpicture
begintikzpicture
matrix[mymatrix]
pic quadro; \
pic triang=180; &pic quadro; & pic triang; \
& pic triang=180; \
;
endtikzpicture
enddocument
You can simply create two pics
, a square (quadro
in my Minimal Working Example, by the way, learn how to build it for your next question) and a triangle (triang
in my MWE), with an optional argument for rotation, and use them in a TikZ matrix
.
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
tikzset%
pics/quadro/.style=code=%
draw[fill=cyan!90!gray] (0,0) rectangle (1,1);
,
pics/triang/.style=code=%
draw[fill=cyan!90!gray, rotate around=#1:(.5,.5)] (0,0) -- (0,1) -- (1,0) -- cycle;
,
pics/triang/.default=0,
mymatrix/.style=
row sep=-pgflinewidth,
column sep=-pgflinewidth
,
begindocument
begintikzpicture
matrix[mymatrix]
pic triang=90; \
pic triang=180; &pic quadro; & pic quadro; \
& & pic triang=270; \
;
endtikzpicture
begintikzpicture
matrix[mymatrix]
pic quadro; \
pic triang=180; &pic quadro; & pic triang; \
& pic triang=180; \
;
endtikzpicture
enddocument
answered Feb 3 at 18:19
CarLaTeXCarLaTeX
32k551133
32k551133
add a comment |
add a comment |
Another solution with regular nodes, a squared nodes and an isosceles triangle with 90 degrees on apex angle. You can place nodes on absolute coordinates or using relative positioning.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning, shapes.geometric, matrix
begindocument
begintikzpicture[
right angle triangle/.style=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=#1!70,
draw=#1!80!black,
,
tnw/.style=
right angle triangle=#1,
shape border rotate=135,
tne/.style=
right angle triangle=#1,
shape border rotate=45,
tsw/.style=
right angle triangle=#1,
shape border rotate=-135,
tse/.style=
right angle triangle=#1,
shape border rotate=-45,
sq/.style=
minimum size=1cm,
outer sep=0pt,
draw=#1!80!black,
fill=#1!70
]
node[tse=blue] at (0,0) ;
node[tne=blue] at (0,0) ;
node[sq=blue, anchor=north west] at (0,0) ;
node[sq=blue, anchor=north west] at (1,0) ;
node[tnw=blue] at (1,-1) ;
beginscope[shift=(3cm,.5cm), node distance=0pt]
node[sq=red] at (0,0) (a) ;
%use positioning before node specification to keep apex anchor
node[below=of a.south east, tne=orange] (b) ;
node[below right=of a.south east, sq=green] (c) ;
node[right=of c.south east, tsw=blue] (d) ;
node[below=of c.south east, tne=brown] (e) ;
endscope
endtikzpicture
enddocument
Update:
Another definition of styles for the right angle triangle and square allow to simplify and unify the syntax and placement of elements. Both elements are defined with two arguments:
rat=rotation respect the apex anchorposition of apex anchor
sqr=rotation respect right vertex anchorposition of right vertex anchor
Some examples:
documentclass[tikz,border=2mm]standalone
usetikzlibraryshapes.geometric
begindocument
begintikzpicture[
%right angle triangle
rat/.style 2 args=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
%the square is a kite shape
sqr/.style 2 args=
kite,
kite vertex angles=90,
% kite lower vertex angle=90
shape border uses incircle,
outer sep=0pt,
anchor=right vertex,
minimum size=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
]
node[rat=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(1,-1)];
beginscope[shift=(4cm,0cm), node distance=0pt]
node[sqr=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[rat=45(1,-1)];
node[rat=-135(1,-1)];
endscope
beginscope[shift=(0cm,-3cm), node distance=0pt]
node[rat=-90(0,0)];
node[rat=90(0,0)];
node[rat=180(0,0)];
node[rat=-90(0,-1cm*sqrt(2))];
node[rat=0(0,-1cm*sqrt(2))];
node[rat=180(0,-1cm*sqrt(2))];
node[rat=0(1cm*sqrt(2),-1cm*sqrt(2))];
node[rat=90(1cm*sqrt(2),-1cm*sqrt(2))];
endscope
beginscope[shift=(3cm,-4cm), node distance=0pt]
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(2,0)];
node[rat=-45(1,0)];
node[rat=-135(1,0)];
endscope
endtikzpicture
enddocument
add a comment |
Another solution with regular nodes, a squared nodes and an isosceles triangle with 90 degrees on apex angle. You can place nodes on absolute coordinates or using relative positioning.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning, shapes.geometric, matrix
begindocument
begintikzpicture[
right angle triangle/.style=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=#1!70,
draw=#1!80!black,
,
tnw/.style=
right angle triangle=#1,
shape border rotate=135,
tne/.style=
right angle triangle=#1,
shape border rotate=45,
tsw/.style=
right angle triangle=#1,
shape border rotate=-135,
tse/.style=
right angle triangle=#1,
shape border rotate=-45,
sq/.style=
minimum size=1cm,
outer sep=0pt,
draw=#1!80!black,
fill=#1!70
]
node[tse=blue] at (0,0) ;
node[tne=blue] at (0,0) ;
node[sq=blue, anchor=north west] at (0,0) ;
node[sq=blue, anchor=north west] at (1,0) ;
node[tnw=blue] at (1,-1) ;
beginscope[shift=(3cm,.5cm), node distance=0pt]
node[sq=red] at (0,0) (a) ;
%use positioning before node specification to keep apex anchor
node[below=of a.south east, tne=orange] (b) ;
node[below right=of a.south east, sq=green] (c) ;
node[right=of c.south east, tsw=blue] (d) ;
node[below=of c.south east, tne=brown] (e) ;
endscope
endtikzpicture
enddocument
Update:
Another definition of styles for the right angle triangle and square allow to simplify and unify the syntax and placement of elements. Both elements are defined with two arguments:
rat=rotation respect the apex anchorposition of apex anchor
sqr=rotation respect right vertex anchorposition of right vertex anchor
Some examples:
documentclass[tikz,border=2mm]standalone
usetikzlibraryshapes.geometric
begindocument
begintikzpicture[
%right angle triangle
rat/.style 2 args=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
%the square is a kite shape
sqr/.style 2 args=
kite,
kite vertex angles=90,
% kite lower vertex angle=90
shape border uses incircle,
outer sep=0pt,
anchor=right vertex,
minimum size=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
]
node[rat=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(1,-1)];
beginscope[shift=(4cm,0cm), node distance=0pt]
node[sqr=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[rat=45(1,-1)];
node[rat=-135(1,-1)];
endscope
beginscope[shift=(0cm,-3cm), node distance=0pt]
node[rat=-90(0,0)];
node[rat=90(0,0)];
node[rat=180(0,0)];
node[rat=-90(0,-1cm*sqrt(2))];
node[rat=0(0,-1cm*sqrt(2))];
node[rat=180(0,-1cm*sqrt(2))];
node[rat=0(1cm*sqrt(2),-1cm*sqrt(2))];
node[rat=90(1cm*sqrt(2),-1cm*sqrt(2))];
endscope
beginscope[shift=(3cm,-4cm), node distance=0pt]
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(2,0)];
node[rat=-45(1,0)];
node[rat=-135(1,0)];
endscope
endtikzpicture
enddocument
add a comment |
Another solution with regular nodes, a squared nodes and an isosceles triangle with 90 degrees on apex angle. You can place nodes on absolute coordinates or using relative positioning.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning, shapes.geometric, matrix
begindocument
begintikzpicture[
right angle triangle/.style=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=#1!70,
draw=#1!80!black,
,
tnw/.style=
right angle triangle=#1,
shape border rotate=135,
tne/.style=
right angle triangle=#1,
shape border rotate=45,
tsw/.style=
right angle triangle=#1,
shape border rotate=-135,
tse/.style=
right angle triangle=#1,
shape border rotate=-45,
sq/.style=
minimum size=1cm,
outer sep=0pt,
draw=#1!80!black,
fill=#1!70
]
node[tse=blue] at (0,0) ;
node[tne=blue] at (0,0) ;
node[sq=blue, anchor=north west] at (0,0) ;
node[sq=blue, anchor=north west] at (1,0) ;
node[tnw=blue] at (1,-1) ;
beginscope[shift=(3cm,.5cm), node distance=0pt]
node[sq=red] at (0,0) (a) ;
%use positioning before node specification to keep apex anchor
node[below=of a.south east, tne=orange] (b) ;
node[below right=of a.south east, sq=green] (c) ;
node[right=of c.south east, tsw=blue] (d) ;
node[below=of c.south east, tne=brown] (e) ;
endscope
endtikzpicture
enddocument
Update:
Another definition of styles for the right angle triangle and square allow to simplify and unify the syntax and placement of elements. Both elements are defined with two arguments:
rat=rotation respect the apex anchorposition of apex anchor
sqr=rotation respect right vertex anchorposition of right vertex anchor
Some examples:
documentclass[tikz,border=2mm]standalone
usetikzlibraryshapes.geometric
begindocument
begintikzpicture[
%right angle triangle
rat/.style 2 args=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
%the square is a kite shape
sqr/.style 2 args=
kite,
kite vertex angles=90,
% kite lower vertex angle=90
shape border uses incircle,
outer sep=0pt,
anchor=right vertex,
minimum size=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
]
node[rat=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(1,-1)];
beginscope[shift=(4cm,0cm), node distance=0pt]
node[sqr=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[rat=45(1,-1)];
node[rat=-135(1,-1)];
endscope
beginscope[shift=(0cm,-3cm), node distance=0pt]
node[rat=-90(0,0)];
node[rat=90(0,0)];
node[rat=180(0,0)];
node[rat=-90(0,-1cm*sqrt(2))];
node[rat=0(0,-1cm*sqrt(2))];
node[rat=180(0,-1cm*sqrt(2))];
node[rat=0(1cm*sqrt(2),-1cm*sqrt(2))];
node[rat=90(1cm*sqrt(2),-1cm*sqrt(2))];
endscope
beginscope[shift=(3cm,-4cm), node distance=0pt]
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(2,0)];
node[rat=-45(1,0)];
node[rat=-135(1,0)];
endscope
endtikzpicture
enddocument
Another solution with regular nodes, a squared nodes and an isosceles triangle with 90 degrees on apex angle. You can place nodes on absolute coordinates or using relative positioning.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning, shapes.geometric, matrix
begindocument
begintikzpicture[
right angle triangle/.style=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=#1!70,
draw=#1!80!black,
,
tnw/.style=
right angle triangle=#1,
shape border rotate=135,
tne/.style=
right angle triangle=#1,
shape border rotate=45,
tsw/.style=
right angle triangle=#1,
shape border rotate=-135,
tse/.style=
right angle triangle=#1,
shape border rotate=-45,
sq/.style=
minimum size=1cm,
outer sep=0pt,
draw=#1!80!black,
fill=#1!70
]
node[tse=blue] at (0,0) ;
node[tne=blue] at (0,0) ;
node[sq=blue, anchor=north west] at (0,0) ;
node[sq=blue, anchor=north west] at (1,0) ;
node[tnw=blue] at (1,-1) ;
beginscope[shift=(3cm,.5cm), node distance=0pt]
node[sq=red] at (0,0) (a) ;
%use positioning before node specification to keep apex anchor
node[below=of a.south east, tne=orange] (b) ;
node[below right=of a.south east, sq=green] (c) ;
node[right=of c.south east, tsw=blue] (d) ;
node[below=of c.south east, tne=brown] (e) ;
endscope
endtikzpicture
enddocument
Update:
Another definition of styles for the right angle triangle and square allow to simplify and unify the syntax and placement of elements. Both elements are defined with two arguments:
rat=rotation respect the apex anchorposition of apex anchor
sqr=rotation respect right vertex anchorposition of right vertex anchor
Some examples:
documentclass[tikz,border=2mm]standalone
usetikzlibraryshapes.geometric
begindocument
begintikzpicture[
%right angle triangle
rat/.style 2 args=
isosceles triangle,
isosceles triangle apex angle=90,
shape border uses incircle,
outer sep=0pt,
anchor=apex,
minimum width=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
%the square is a kite shape
sqr/.style 2 args=
kite,
kite vertex angles=90,
% kite lower vertex angle=90
shape border uses incircle,
outer sep=0pt,
anchor=right vertex,
minimum size=1cm*sqrt(2),
miter limit=1,
fill=blue!70,
draw=blue!80!black,
shape border rotate=#1,
at=#2,
node contents=,
,
]
node[rat=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(1,-1)];
beginscope[shift=(4cm,0cm), node distance=0pt]
node[sqr=-45(0,0)];
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[rat=45(1,-1)];
node[rat=-135(1,-1)];
endscope
beginscope[shift=(0cm,-3cm), node distance=0pt]
node[rat=-90(0,0)];
node[rat=90(0,0)];
node[rat=180(0,0)];
node[rat=-90(0,-1cm*sqrt(2))];
node[rat=0(0,-1cm*sqrt(2))];
node[rat=180(0,-1cm*sqrt(2))];
node[rat=0(1cm*sqrt(2),-1cm*sqrt(2))];
node[rat=90(1cm*sqrt(2),-1cm*sqrt(2))];
endscope
beginscope[shift=(3cm,-4cm), node distance=0pt]
node[rat=45(0,0)];
node[sqr=135(0,0)];
node[sqr=135(1,0)];
node[rat=135(2,0)];
node[rat=-45(1,0)];
node[rat=-135(1,0)];
endscope
endtikzpicture
enddocument
edited Feb 4 at 11:06
answered Feb 3 at 21:26
IgnasiIgnasi
93.7k4169311
93.7k4169311
add a comment |
add a comment |
It's easy with TikZ. The first image is:
documentclass[10pt,a4paper]article
usepackagetikz
begindocument
tikz
definecolorLBHTML5999D4
fill[LB] (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-11.5,1) -- (-8.5,1) -- (-8.5,-2) (-2.5,-2) -- (-5.5,-2) -- (-5.5,1);
enddocument
add a comment |
It's easy with TikZ. The first image is:
documentclass[10pt,a4paper]article
usepackagetikz
begindocument
tikz
definecolorLBHTML5999D4
fill[LB] (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-11.5,1) -- (-8.5,1) -- (-8.5,-2) (-2.5,-2) -- (-5.5,-2) -- (-5.5,1);
enddocument
add a comment |
It's easy with TikZ. The first image is:
documentclass[10pt,a4paper]article
usepackagetikz
begindocument
tikz
definecolorLBHTML5999D4
fill[LB] (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-11.5,1) -- (-8.5,1) -- (-8.5,-2) (-2.5,-2) -- (-5.5,-2) -- (-5.5,1);
enddocument
It's easy with TikZ. The first image is:
documentclass[10pt,a4paper]article
usepackagetikz
begindocument
tikz
definecolorLBHTML5999D4
fill[LB] (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-8.5,4) -- (-11.5,1) -- (-8.5,-2) -- (-5.5,-2) -- (-5.5,-5) -- (-2.5,-2) -- (-2.5,1) -- (-8.5,1) -- cycle;
draw (-11.5,1) -- (-8.5,1) -- (-8.5,-2) (-2.5,-2) -- (-5.5,-2) -- (-5.5,1);
enddocument
answered Feb 3 at 15:30
vi pavi pa
652111
652111
add a comment |
add a comment |
These things can be conveniently obtained by using clip
, local bounding box
es and grids.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture
beginscope[local bounding box=box1]
draw[clip] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
fill[dunno] (box1.south west) rectangle (box1.north east);
draw[ultra thin] (box1.south west) grid (box1.north east);
endscope
beginscope[local bounding box=box2,xshift=4cm]
draw[clip] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
fill[dunno] (box2.south west) rectangle (box2.north east);
draw[ultra thin] (box2.south west) grid (box2.north east);
endscope
endtikzpicture
enddocument
Or, perhaps even more convenient, use a path picture
.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture[GWW/.style=path picture=fill[dunno] (path picture bounding box.south west)
rectangle (path picture bounding box.north east);
draw[ultra thin] (path picture bounding box.south west)
grid (path picture bounding box.north east);]
draw[GWW] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
beginscope[xshift=4cm]
draw[GWW] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
endscope
endtikzpicture
enddocument
add a comment |
These things can be conveniently obtained by using clip
, local bounding box
es and grids.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture
beginscope[local bounding box=box1]
draw[clip] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
fill[dunno] (box1.south west) rectangle (box1.north east);
draw[ultra thin] (box1.south west) grid (box1.north east);
endscope
beginscope[local bounding box=box2,xshift=4cm]
draw[clip] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
fill[dunno] (box2.south west) rectangle (box2.north east);
draw[ultra thin] (box2.south west) grid (box2.north east);
endscope
endtikzpicture
enddocument
Or, perhaps even more convenient, use a path picture
.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture[GWW/.style=path picture=fill[dunno] (path picture bounding box.south west)
rectangle (path picture bounding box.north east);
draw[ultra thin] (path picture bounding box.south west)
grid (path picture bounding box.north east);]
draw[GWW] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
beginscope[xshift=4cm]
draw[GWW] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
endscope
endtikzpicture
enddocument
add a comment |
These things can be conveniently obtained by using clip
, local bounding box
es and grids.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture
beginscope[local bounding box=box1]
draw[clip] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
fill[dunno] (box1.south west) rectangle (box1.north east);
draw[ultra thin] (box1.south west) grid (box1.north east);
endscope
beginscope[local bounding box=box2,xshift=4cm]
draw[clip] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
fill[dunno] (box2.south west) rectangle (box2.north east);
draw[ultra thin] (box2.south west) grid (box2.north east);
endscope
endtikzpicture
enddocument
Or, perhaps even more convenient, use a path picture
.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture[GWW/.style=path picture=fill[dunno] (path picture bounding box.south west)
rectangle (path picture bounding box.north east);
draw[ultra thin] (path picture bounding box.south west)
grid (path picture bounding box.north east);]
draw[GWW] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
beginscope[xshift=4cm]
draw[GWW] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
endscope
endtikzpicture
enddocument
These things can be conveniently obtained by using clip
, local bounding box
es and grids.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture
beginscope[local bounding box=box1]
draw[clip] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
fill[dunno] (box1.south west) rectangle (box1.north east);
draw[ultra thin] (box1.south west) grid (box1.north east);
endscope
beginscope[local bounding box=box2,xshift=4cm]
draw[clip] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
fill[dunno] (box2.south west) rectangle (box2.north east);
draw[ultra thin] (box2.south west) grid (box2.north east);
endscope
endtikzpicture
enddocument
Or, perhaps even more convenient, use a path picture
.
documentclass[tikz,border=3.14mm]standalone
definecolordunnoRGB113,154,210
begindocument
begintikzpicture[GWW/.style=path picture=fill[dunno] (path picture bounding box.south west)
rectangle (path picture bounding box.north east);
draw[ultra thin] (path picture bounding box.south west)
grid (path picture bounding box.north east);]
draw[GWW] (0,0) -- ++(1,1) |- ++ (2,-1) -- ++ (0,-1) -- ++ (-1,-1)
|- ++(-1,1) -- cycle;
beginscope[xshift=4cm]
draw[GWW] (0,0) |- ++(1,1) |- ++ (1,-1) -- ++ (1,-1) -| ++ (-1,-1) -- cycle;
endscope
endtikzpicture
enddocument
answered Feb 3 at 16:00
marmotmarmot
103k4123234
103k4123234
add a comment |
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%2f473170%2fhow-to-the-picture-of-gordon-webb-and-wolpert%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
1
This is pretty easy with
TikZ
, even with my limited knowledge ofTikZ
– Christian Hupfer
Feb 3 at 14:27