How do I draw the dashed lines as shown in this figureHow can I put a coloured outline around fraction...
How to use Mathemaica to do a complex integrate with poles in real axis?
How does Leonard in "Memento" remember reading and writing?
Avoid page break between paragraphs
Why does photorec keep finding files after I have filled the disk free space as root?
Constexpr if with a non-bool condition
How can the probability of a fumble decrease linearly with more dice?
Saint abbreviation
Move fast ...... Or you will lose
Why are all my replica super soldiers young adults or old teenagers?
What language shall they sing in?
What happens when a creature with flying blocks my non-flying attacker?
After checking in online, how do I know whether I need to go show my passport at airport check-in?
What is the difference between rolling more dice versus fewer dice?
How do I draw the dashed lines as shown in this figure
Python Pandas - difference between 'loc' and 'where'?
Why don't key signatures indicate the tonic?
How do I append a character to the end of every line in an excel cell?
Why publish a research paper when a blog post or a lecture slide can have more citation count than a journal paper?
Why is Agricola named as such?
Early credit roll before the end of the film
Let's Encrypt and EV certificates for different hosts in the same domain
How to visualize the Riemann-Roch theorem from complex analysis or geometric topology considerations?
Potential client has a problematic employee I can't work with
"We can't save the customer" error after Migration - Magento 2.3
How do I draw the dashed lines as shown in this figure
How can I put a coloured outline around fraction lines?Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideWhy do I get an extra white page before my TikZ picture?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?
I want to draw the dashed lines as shown in the below figure:
I have achieved the following so far:
MWE:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick] (a) -- (c);
draw[thick,red,dashed] (0.8,0.08) -- (0,-0.8);
end{tikzpicture}
end{document}
tikz-pgf
add a comment |
I want to draw the dashed lines as shown in the below figure:
I have achieved the following so far:
MWE:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick] (a) -- (c);
draw[thick,red,dashed] (0.8,0.08) -- (0,-0.8);
end{tikzpicture}
end{document}
tikz-pgf
add a comment |
I want to draw the dashed lines as shown in the below figure:
I have achieved the following so far:
MWE:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick] (a) -- (c);
draw[thick,red,dashed] (0.8,0.08) -- (0,-0.8);
end{tikzpicture}
end{document}
tikz-pgf
I want to draw the dashed lines as shown in the below figure:
I have achieved the following so far:
MWE:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick] (a) -- (c);
draw[thick,red,dashed] (0.8,0.08) -- (0,-0.8);
end{tikzpicture}
end{document}
tikz-pgf
tikz-pgf
edited 6 mins ago
JouleV
4,2351938
4,2351938
asked 2 hours ago
subham sonisubham soni
3,98382981
3,98382981
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
The task is not so difficult with decorations.markings
:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{decorations.pathmorphing,decorations.markings}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
end{tikzpicture}
end{document}
Bonus
Your entire figure:
documentclass[tikz,margin=3mm]{standalone}
usepackage{mathrsfs}
usetikzlibrary{decorations.pathmorphing,decorations.markings,calc,positioning}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);,
mark=at position 0.5 with coordinate (singularity);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
node[below left=1em and 1em of y,align=right,red] (es) {excision\surface};
draw[red,->] (es)--($(y)+(-.1,-.1)$);
node[above=10ex of singularity,red] (sn) {singularity};
draw[red,->] (sn)--($(singularity)+(0,1)$);
node[below left=.5ex and 2ex of b] {$mathcal{H}^+$};
path (b) -- (d) node[midway,above right] {$mathcal{I}^+$};
path (d) -- (e) node[midway,below right] {$mathcal{I}^-$};
path (e) -- (c) node[midway,below left] {$mathcal{H}^-$};
node[right=0pt of d] {$i^0$};
draw[postaction={
decoration={
markings,
mark=at position 0.15 with coordinate (enblue);
},
decorate
},thick,blue] (d) to[out=-150,in=-30] (c);
draw[<-,thick,blue] (enblue)--($(enblue)+(-60:1)$)--($(enblue)+(-60:1)+(.2,0)$) node[right,align=left] {$t$ = constant\in Schwarzschild\coordinates};
path[postaction={
decoration={
markings,
mark=at position 0.35 with coordinate (engren);
},
decorate
}] (c)--(b);
draw[thick,green!50!black,postaction={
decoration={
markings,
mark=at position 0.6 with coordinate (enargr);
},
decorate
}] (d) to[out=180,in=-30] (engren);
draw[thick,dashed,green!50!black] (engren)--($(engren)+(150:0.7)$);
draw[<-,thick,green!50!black] (enargr)--($(enargr)+(60:0.75)$)--($(enargr)+(60:0.75)+(2,0)$) node[right,align=left] {$tau$ = constant\in Kerr-Schild\coordinates};
end{tikzpicture}
end{document}
Can you please tell me how did you calculatemark=at position 0.7 with coordinate (x);
. Is there an easy way to determine this value
– subham soni
25 mins ago
Also, can you please explaindraw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); }
the meaning of the code
– subham soni
22 mins ago
@subhamsoni You can see why I used 0.7 if you use 0.5 or 0.8 or 0.75. Looking at the revisions you can see that I originally used 0.8, but then I changed to 0.7 to fit your figure better.
– JouleV
15 mins ago
Sure. can you please explain draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); } the meaning of the code
– subham soni
14 mins ago
@subhamsoni It is explained very well in section 50.5 of the TikZ - PGF manual.
– JouleV
13 mins ago
add a comment |
You can easily calculate where a point in the middle between two other points lies:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing,calc}
tikzset{
zigzag/.style={
decorate,
decoration={
zigzag,
amplitude=2.5pt,
segment length=2.5mm
}
}
}
begin{document}
defposition{0.6}
begin{tikzpicture}[thick]
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[red, zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw (a) -- (c);
draw[red, densely dashed, shorten >=0.5pt] ($(a)!position!(c)$) -- ($(a)!position!(b)$);
end{tikzpicture}
end{document}
add a comment |
It is possible to use the intersections
library which allows to calculate the intersection point of 2 paths. Here the zigzag
path and the dashed
path.
To draw a dashed parallel, I used the calc
library.
documentclass[tikz,border=5mm]{standalone}
%usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
usetikzlibrary{intersections}
usetikzlibrary{calc}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[name path=zz,thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick,name path=ac] (a) -- (c);
path[name path=dash] (.9,0.08) -- (0,-0.8);
coordinate [name intersections={of= zz and dash,by={i}}];
coordinate (j) at ($(i)+(c)-(b)$);
coordinate(k) at ($(i)+(b)-(c)$);
path[name path=dash](j)--(k);
path[name intersections={of= ac and dash,by={k}}];
draw [thick,red,dashed] (i) -- (k);
end{tikzpicture}
end{document}
the line isn't at the exact location like in the picture
– subham soni
2 hours ago
I just corrected that, is that okay with you?
– AndréC
1 hour ago
can you please tell how did you calculate path[name path=dash] (.9,0.08) -- (0,-0.8);
– subham soni
27 mins ago
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%2f476907%2fhow-do-i-draw-the-dashed-lines-as-shown-in-this-figure%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The task is not so difficult with decorations.markings
:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{decorations.pathmorphing,decorations.markings}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
end{tikzpicture}
end{document}
Bonus
Your entire figure:
documentclass[tikz,margin=3mm]{standalone}
usepackage{mathrsfs}
usetikzlibrary{decorations.pathmorphing,decorations.markings,calc,positioning}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);,
mark=at position 0.5 with coordinate (singularity);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
node[below left=1em and 1em of y,align=right,red] (es) {excision\surface};
draw[red,->] (es)--($(y)+(-.1,-.1)$);
node[above=10ex of singularity,red] (sn) {singularity};
draw[red,->] (sn)--($(singularity)+(0,1)$);
node[below left=.5ex and 2ex of b] {$mathcal{H}^+$};
path (b) -- (d) node[midway,above right] {$mathcal{I}^+$};
path (d) -- (e) node[midway,below right] {$mathcal{I}^-$};
path (e) -- (c) node[midway,below left] {$mathcal{H}^-$};
node[right=0pt of d] {$i^0$};
draw[postaction={
decoration={
markings,
mark=at position 0.15 with coordinate (enblue);
},
decorate
},thick,blue] (d) to[out=-150,in=-30] (c);
draw[<-,thick,blue] (enblue)--($(enblue)+(-60:1)$)--($(enblue)+(-60:1)+(.2,0)$) node[right,align=left] {$t$ = constant\in Schwarzschild\coordinates};
path[postaction={
decoration={
markings,
mark=at position 0.35 with coordinate (engren);
},
decorate
}] (c)--(b);
draw[thick,green!50!black,postaction={
decoration={
markings,
mark=at position 0.6 with coordinate (enargr);
},
decorate
}] (d) to[out=180,in=-30] (engren);
draw[thick,dashed,green!50!black] (engren)--($(engren)+(150:0.7)$);
draw[<-,thick,green!50!black] (enargr)--($(enargr)+(60:0.75)$)--($(enargr)+(60:0.75)+(2,0)$) node[right,align=left] {$tau$ = constant\in Kerr-Schild\coordinates};
end{tikzpicture}
end{document}
Can you please tell me how did you calculatemark=at position 0.7 with coordinate (x);
. Is there an easy way to determine this value
– subham soni
25 mins ago
Also, can you please explaindraw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); }
the meaning of the code
– subham soni
22 mins ago
@subhamsoni You can see why I used 0.7 if you use 0.5 or 0.8 or 0.75. Looking at the revisions you can see that I originally used 0.8, but then I changed to 0.7 to fit your figure better.
– JouleV
15 mins ago
Sure. can you please explain draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); } the meaning of the code
– subham soni
14 mins ago
@subhamsoni It is explained very well in section 50.5 of the TikZ - PGF manual.
– JouleV
13 mins ago
add a comment |
The task is not so difficult with decorations.markings
:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{decorations.pathmorphing,decorations.markings}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
end{tikzpicture}
end{document}
Bonus
Your entire figure:
documentclass[tikz,margin=3mm]{standalone}
usepackage{mathrsfs}
usetikzlibrary{decorations.pathmorphing,decorations.markings,calc,positioning}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);,
mark=at position 0.5 with coordinate (singularity);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
node[below left=1em and 1em of y,align=right,red] (es) {excision\surface};
draw[red,->] (es)--($(y)+(-.1,-.1)$);
node[above=10ex of singularity,red] (sn) {singularity};
draw[red,->] (sn)--($(singularity)+(0,1)$);
node[below left=.5ex and 2ex of b] {$mathcal{H}^+$};
path (b) -- (d) node[midway,above right] {$mathcal{I}^+$};
path (d) -- (e) node[midway,below right] {$mathcal{I}^-$};
path (e) -- (c) node[midway,below left] {$mathcal{H}^-$};
node[right=0pt of d] {$i^0$};
draw[postaction={
decoration={
markings,
mark=at position 0.15 with coordinate (enblue);
},
decorate
},thick,blue] (d) to[out=-150,in=-30] (c);
draw[<-,thick,blue] (enblue)--($(enblue)+(-60:1)$)--($(enblue)+(-60:1)+(.2,0)$) node[right,align=left] {$t$ = constant\in Schwarzschild\coordinates};
path[postaction={
decoration={
markings,
mark=at position 0.35 with coordinate (engren);
},
decorate
}] (c)--(b);
draw[thick,green!50!black,postaction={
decoration={
markings,
mark=at position 0.6 with coordinate (enargr);
},
decorate
}] (d) to[out=180,in=-30] (engren);
draw[thick,dashed,green!50!black] (engren)--($(engren)+(150:0.7)$);
draw[<-,thick,green!50!black] (enargr)--($(enargr)+(60:0.75)$)--($(enargr)+(60:0.75)+(2,0)$) node[right,align=left] {$tau$ = constant\in Kerr-Schild\coordinates};
end{tikzpicture}
end{document}
Can you please tell me how did you calculatemark=at position 0.7 with coordinate (x);
. Is there an easy way to determine this value
– subham soni
25 mins ago
Also, can you please explaindraw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); }
the meaning of the code
– subham soni
22 mins ago
@subhamsoni You can see why I used 0.7 if you use 0.5 or 0.8 or 0.75. Looking at the revisions you can see that I originally used 0.8, but then I changed to 0.7 to fit your figure better.
– JouleV
15 mins ago
Sure. can you please explain draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); } the meaning of the code
– subham soni
14 mins ago
@subhamsoni It is explained very well in section 50.5 of the TikZ - PGF manual.
– JouleV
13 mins ago
add a comment |
The task is not so difficult with decorations.markings
:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{decorations.pathmorphing,decorations.markings}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
end{tikzpicture}
end{document}
Bonus
Your entire figure:
documentclass[tikz,margin=3mm]{standalone}
usepackage{mathrsfs}
usetikzlibrary{decorations.pathmorphing,decorations.markings,calc,positioning}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);,
mark=at position 0.5 with coordinate (singularity);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
node[below left=1em and 1em of y,align=right,red] (es) {excision\surface};
draw[red,->] (es)--($(y)+(-.1,-.1)$);
node[above=10ex of singularity,red] (sn) {singularity};
draw[red,->] (sn)--($(singularity)+(0,1)$);
node[below left=.5ex and 2ex of b] {$mathcal{H}^+$};
path (b) -- (d) node[midway,above right] {$mathcal{I}^+$};
path (d) -- (e) node[midway,below right] {$mathcal{I}^-$};
path (e) -- (c) node[midway,below left] {$mathcal{H}^-$};
node[right=0pt of d] {$i^0$};
draw[postaction={
decoration={
markings,
mark=at position 0.15 with coordinate (enblue);
},
decorate
},thick,blue] (d) to[out=-150,in=-30] (c);
draw[<-,thick,blue] (enblue)--($(enblue)+(-60:1)$)--($(enblue)+(-60:1)+(.2,0)$) node[right,align=left] {$t$ = constant\in Schwarzschild\coordinates};
path[postaction={
decoration={
markings,
mark=at position 0.35 with coordinate (engren);
},
decorate
}] (c)--(b);
draw[thick,green!50!black,postaction={
decoration={
markings,
mark=at position 0.6 with coordinate (enargr);
},
decorate
}] (d) to[out=180,in=-30] (engren);
draw[thick,dashed,green!50!black] (engren)--($(engren)+(150:0.7)$);
draw[<-,thick,green!50!black] (enargr)--($(enargr)+(60:0.75)$)--($(enargr)+(60:0.75)+(2,0)$) node[right,align=left] {$tau$ = constant\in Kerr-Schild\coordinates};
end{tikzpicture}
end{document}
The task is not so difficult with decorations.markings
:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{decorations.pathmorphing,decorations.markings}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
end{tikzpicture}
end{document}
Bonus
Your entire figure:
documentclass[tikz,margin=3mm]{standalone}
usepackage{mathrsfs}
usetikzlibrary{decorations.pathmorphing,decorations.markings,calc,positioning}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[thick,red,zigzag,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (x);,
mark=at position 0.5 with coordinate (singularity);
},
decorate
}] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- cycle;
draw[thick,postaction={
decoration={
markings,
mark=at position 0.7 with coordinate (y);
},
decorate
}] (a) -- (c);
draw[dashed,red,thick] (x)--(y);
node[below left=1em and 1em of y,align=right,red] (es) {excision\surface};
draw[red,->] (es)--($(y)+(-.1,-.1)$);
node[above=10ex of singularity,red] (sn) {singularity};
draw[red,->] (sn)--($(singularity)+(0,1)$);
node[below left=.5ex and 2ex of b] {$mathcal{H}^+$};
path (b) -- (d) node[midway,above right] {$mathcal{I}^+$};
path (d) -- (e) node[midway,below right] {$mathcal{I}^-$};
path (e) -- (c) node[midway,below left] {$mathcal{H}^-$};
node[right=0pt of d] {$i^0$};
draw[postaction={
decoration={
markings,
mark=at position 0.15 with coordinate (enblue);
},
decorate
},thick,blue] (d) to[out=-150,in=-30] (c);
draw[<-,thick,blue] (enblue)--($(enblue)+(-60:1)$)--($(enblue)+(-60:1)+(.2,0)$) node[right,align=left] {$t$ = constant\in Schwarzschild\coordinates};
path[postaction={
decoration={
markings,
mark=at position 0.35 with coordinate (engren);
},
decorate
}] (c)--(b);
draw[thick,green!50!black,postaction={
decoration={
markings,
mark=at position 0.6 with coordinate (enargr);
},
decorate
}] (d) to[out=180,in=-30] (engren);
draw[thick,dashed,green!50!black] (engren)--($(engren)+(150:0.7)$);
draw[<-,thick,green!50!black] (enargr)--($(enargr)+(60:0.75)$)--($(enargr)+(60:0.75)+(2,0)$) node[right,align=left] {$tau$ = constant\in Kerr-Schild\coordinates};
end{tikzpicture}
end{document}
edited 1 hour ago
answered 2 hours ago
JouleVJouleV
4,2351938
4,2351938
Can you please tell me how did you calculatemark=at position 0.7 with coordinate (x);
. Is there an easy way to determine this value
– subham soni
25 mins ago
Also, can you please explaindraw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); }
the meaning of the code
– subham soni
22 mins ago
@subhamsoni You can see why I used 0.7 if you use 0.5 or 0.8 or 0.75. Looking at the revisions you can see that I originally used 0.8, but then I changed to 0.7 to fit your figure better.
– JouleV
15 mins ago
Sure. can you please explain draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); } the meaning of the code
– subham soni
14 mins ago
@subhamsoni It is explained very well in section 50.5 of the TikZ - PGF manual.
– JouleV
13 mins ago
add a comment |
Can you please tell me how did you calculatemark=at position 0.7 with coordinate (x);
. Is there an easy way to determine this value
– subham soni
25 mins ago
Also, can you please explaindraw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); }
the meaning of the code
– subham soni
22 mins ago
@subhamsoni You can see why I used 0.7 if you use 0.5 or 0.8 or 0.75. Looking at the revisions you can see that I originally used 0.8, but then I changed to 0.7 to fit your figure better.
– JouleV
15 mins ago
Sure. can you please explain draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); } the meaning of the code
– subham soni
14 mins ago
@subhamsoni It is explained very well in section 50.5 of the TikZ - PGF manual.
– JouleV
13 mins ago
Can you please tell me how did you calculate
mark=at position 0.7 with coordinate (x);
. Is there an easy way to determine this value– subham soni
25 mins ago
Can you please tell me how did you calculate
mark=at position 0.7 with coordinate (x);
. Is there an easy way to determine this value– subham soni
25 mins ago
Also, can you please explain
draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); }
the meaning of the code– subham soni
22 mins ago
Also, can you please explain
draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); }
the meaning of the code– subham soni
22 mins ago
@subhamsoni You can see why I used 0.7 if you use 0.5 or 0.8 or 0.75. Looking at the revisions you can see that I originally used 0.8, but then I changed to 0.7 to fit your figure better.
– JouleV
15 mins ago
@subhamsoni You can see why I used 0.7 if you use 0.5 or 0.8 or 0.75. Looking at the revisions you can see that I originally used 0.8, but then I changed to 0.7 to fit your figure better.
– JouleV
15 mins ago
Sure. can you please explain draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); } the meaning of the code
– subham soni
14 mins ago
Sure. can you please explain draw[thick,red,zigzag,postaction={ decoration={ markings, mark=at position 0.7 with coordinate (x); } the meaning of the code
– subham soni
14 mins ago
@subhamsoni It is explained very well in section 50.5 of the TikZ - PGF manual.
– JouleV
13 mins ago
@subhamsoni It is explained very well in section 50.5 of the TikZ - PGF manual.
– JouleV
13 mins ago
add a comment |
You can easily calculate where a point in the middle between two other points lies:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing,calc}
tikzset{
zigzag/.style={
decorate,
decoration={
zigzag,
amplitude=2.5pt,
segment length=2.5mm
}
}
}
begin{document}
defposition{0.6}
begin{tikzpicture}[thick]
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[red, zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw (a) -- (c);
draw[red, densely dashed, shorten >=0.5pt] ($(a)!position!(c)$) -- ($(a)!position!(b)$);
end{tikzpicture}
end{document}
add a comment |
You can easily calculate where a point in the middle between two other points lies:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing,calc}
tikzset{
zigzag/.style={
decorate,
decoration={
zigzag,
amplitude=2.5pt,
segment length=2.5mm
}
}
}
begin{document}
defposition{0.6}
begin{tikzpicture}[thick]
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[red, zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw (a) -- (c);
draw[red, densely dashed, shorten >=0.5pt] ($(a)!position!(c)$) -- ($(a)!position!(b)$);
end{tikzpicture}
end{document}
add a comment |
You can easily calculate where a point in the middle between two other points lies:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing,calc}
tikzset{
zigzag/.style={
decorate,
decoration={
zigzag,
amplitude=2.5pt,
segment length=2.5mm
}
}
}
begin{document}
defposition{0.6}
begin{tikzpicture}[thick]
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[red, zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw (a) -- (c);
draw[red, densely dashed, shorten >=0.5pt] ($(a)!position!(c)$) -- ($(a)!position!(b)$);
end{tikzpicture}
end{document}
You can easily calculate where a point in the middle between two other points lies:
documentclass{article}
usepackage{tikz}
usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing,calc}
tikzset{
zigzag/.style={
decorate,
decoration={
zigzag,
amplitude=2.5pt,
segment length=2.5mm
}
}
}
begin{document}
defposition{0.6}
begin{tikzpicture}[thick]
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[red, zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw (a) -- (c);
draw[red, densely dashed, shorten >=0.5pt] ($(a)!position!(c)$) -- ($(a)!position!(b)$);
end{tikzpicture}
end{document}
answered 1 hour ago
BubayaBubaya
620310
620310
add a comment |
add a comment |
It is possible to use the intersections
library which allows to calculate the intersection point of 2 paths. Here the zigzag
path and the dashed
path.
To draw a dashed parallel, I used the calc
library.
documentclass[tikz,border=5mm]{standalone}
%usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
usetikzlibrary{intersections}
usetikzlibrary{calc}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[name path=zz,thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick,name path=ac] (a) -- (c);
path[name path=dash] (.9,0.08) -- (0,-0.8);
coordinate [name intersections={of= zz and dash,by={i}}];
coordinate (j) at ($(i)+(c)-(b)$);
coordinate(k) at ($(i)+(b)-(c)$);
path[name path=dash](j)--(k);
path[name intersections={of= ac and dash,by={k}}];
draw [thick,red,dashed] (i) -- (k);
end{tikzpicture}
end{document}
the line isn't at the exact location like in the picture
– subham soni
2 hours ago
I just corrected that, is that okay with you?
– AndréC
1 hour ago
can you please tell how did you calculate path[name path=dash] (.9,0.08) -- (0,-0.8);
– subham soni
27 mins ago
add a comment |
It is possible to use the intersections
library which allows to calculate the intersection point of 2 paths. Here the zigzag
path and the dashed
path.
To draw a dashed parallel, I used the calc
library.
documentclass[tikz,border=5mm]{standalone}
%usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
usetikzlibrary{intersections}
usetikzlibrary{calc}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[name path=zz,thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick,name path=ac] (a) -- (c);
path[name path=dash] (.9,0.08) -- (0,-0.8);
coordinate [name intersections={of= zz and dash,by={i}}];
coordinate (j) at ($(i)+(c)-(b)$);
coordinate(k) at ($(i)+(b)-(c)$);
path[name path=dash](j)--(k);
path[name intersections={of= ac and dash,by={k}}];
draw [thick,red,dashed] (i) -- (k);
end{tikzpicture}
end{document}
the line isn't at the exact location like in the picture
– subham soni
2 hours ago
I just corrected that, is that okay with you?
– AndréC
1 hour ago
can you please tell how did you calculate path[name path=dash] (.9,0.08) -- (0,-0.8);
– subham soni
27 mins ago
add a comment |
It is possible to use the intersections
library which allows to calculate the intersection point of 2 paths. Here the zigzag
path and the dashed
path.
To draw a dashed parallel, I used the calc
library.
documentclass[tikz,border=5mm]{standalone}
%usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
usetikzlibrary{intersections}
usetikzlibrary{calc}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[name path=zz,thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick,name path=ac] (a) -- (c);
path[name path=dash] (.9,0.08) -- (0,-0.8);
coordinate [name intersections={of= zz and dash,by={i}}];
coordinate (j) at ($(i)+(c)-(b)$);
coordinate(k) at ($(i)+(b)-(c)$);
path[name path=dash](j)--(k);
path[name intersections={of= ac and dash,by={k}}];
draw [thick,red,dashed] (i) -- (k);
end{tikzpicture}
end{document}
It is possible to use the intersections
library which allows to calculate the intersection point of 2 paths. Here the zigzag
path and the dashed
path.
To draw a dashed parallel, I used the calc
library.
documentclass[tikz,border=5mm]{standalone}
%usepackage{xcolor}
usetikzlibrary{decorations.pathmorphing}
usetikzlibrary{intersections}
usetikzlibrary{calc}
tikzset{zigzag/.style={decorate,decoration=zigzag}}
begin{document}
begin{tikzpicture}
coordinate (c) at (0,-2);
coordinate (d) at (4,-2);
coordinate (e) at (2,-4);
draw[name path=zz,thick,red,zigzag] (-2,0) coordinate(a) -- (2,0) coordinate(b);
draw[thick,fill=blue!20] (c) -- (b) -- (d) -- (e) -- (c);
draw[thick,name path=ac] (a) -- (c);
path[name path=dash] (.9,0.08) -- (0,-0.8);
coordinate [name intersections={of= zz and dash,by={i}}];
coordinate (j) at ($(i)+(c)-(b)$);
coordinate(k) at ($(i)+(b)-(c)$);
path[name path=dash](j)--(k);
path[name intersections={of= ac and dash,by={k}}];
draw [thick,red,dashed] (i) -- (k);
end{tikzpicture}
end{document}
edited 1 hour ago
answered 2 hours ago
AndréCAndréC
9,41111447
9,41111447
the line isn't at the exact location like in the picture
– subham soni
2 hours ago
I just corrected that, is that okay with you?
– AndréC
1 hour ago
can you please tell how did you calculate path[name path=dash] (.9,0.08) -- (0,-0.8);
– subham soni
27 mins ago
add a comment |
the line isn't at the exact location like in the picture
– subham soni
2 hours ago
I just corrected that, is that okay with you?
– AndréC
1 hour ago
can you please tell how did you calculate path[name path=dash] (.9,0.08) -- (0,-0.8);
– subham soni
27 mins ago
the line isn't at the exact location like in the picture
– subham soni
2 hours ago
the line isn't at the exact location like in the picture
– subham soni
2 hours ago
I just corrected that, is that okay with you?
– AndréC
1 hour ago
I just corrected that, is that okay with you?
– AndréC
1 hour ago
can you please tell how did you calculate path[name path=dash] (.9,0.08) -- (0,-0.8);
– subham soni
27 mins ago
can you please tell how did you calculate path[name path=dash] (.9,0.08) -- (0,-0.8);
– subham soni
27 mins ago
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%2f476907%2fhow-do-i-draw-the-dashed-lines-as-shown-in-this-figure%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