TikZ: Summation circle with four ports separated by two prependicular diameters











up vote
5
down vote

favorite












I would like to modify the code of this answer



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


to get the output of this answer of a summation circle with four input ports separated by two perpendicular diameters.





Additionally, if the circle is drawn by



documentclass{article}
usepackage{tikz,mathtools,amssymb}
usetikzlibrary{shapes,arrows,positioning,calc}

begin{document}
tikzset{
port/.style = {inner sep=0pt, font=tiny},
sum/.style n args = {4}{draw, circle, node distance = 2cm, minimum size=5mm, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command={
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}}},
}
begin{tikzpicture}[auto, node distance=5mm,>=latex',align=center,]
node [sum={}{+}{-}{}] (sum) {};
end{tikzpicture}
end{document}


how can the two prependicular diameters be drawn?



enter image description here










share|improve this question
























  • Can you also provide a complete MWE for your second variant?
    – Skillmon
    2 days ago










  • @Skillmon I apologize. I updated my question.
    – Diaa
    2 days ago















up vote
5
down vote

favorite












I would like to modify the code of this answer



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


to get the output of this answer of a summation circle with four input ports separated by two perpendicular diameters.





Additionally, if the circle is drawn by



documentclass{article}
usepackage{tikz,mathtools,amssymb}
usetikzlibrary{shapes,arrows,positioning,calc}

begin{document}
tikzset{
port/.style = {inner sep=0pt, font=tiny},
sum/.style n args = {4}{draw, circle, node distance = 2cm, minimum size=5mm, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command={
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}}},
}
begin{tikzpicture}[auto, node distance=5mm,>=latex',align=center,]
node [sum={}{+}{-}{}] (sum) {};
end{tikzpicture}
end{document}


how can the two prependicular diameters be drawn?



enter image description here










share|improve this question
























  • Can you also provide a complete MWE for your second variant?
    – Skillmon
    2 days ago










  • @Skillmon I apologize. I updated my question.
    – Diaa
    2 days ago













up vote
5
down vote

favorite









up vote
5
down vote

favorite











I would like to modify the code of this answer



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


to get the output of this answer of a summation circle with four input ports separated by two perpendicular diameters.





Additionally, if the circle is drawn by



documentclass{article}
usepackage{tikz,mathtools,amssymb}
usetikzlibrary{shapes,arrows,positioning,calc}

begin{document}
tikzset{
port/.style = {inner sep=0pt, font=tiny},
sum/.style n args = {4}{draw, circle, node distance = 2cm, minimum size=5mm, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command={
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}}},
}
begin{tikzpicture}[auto, node distance=5mm,>=latex',align=center,]
node [sum={}{+}{-}{}] (sum) {};
end{tikzpicture}
end{document}


how can the two prependicular diameters be drawn?



enter image description here










share|improve this question















I would like to modify the code of this answer



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


to get the output of this answer of a summation circle with four input ports separated by two perpendicular diameters.





Additionally, if the circle is drawn by



documentclass{article}
usepackage{tikz,mathtools,amssymb}
usetikzlibrary{shapes,arrows,positioning,calc}

begin{document}
tikzset{
port/.style = {inner sep=0pt, font=tiny},
sum/.style n args = {4}{draw, circle, node distance = 2cm, minimum size=5mm, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command={
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}}},
}
begin{tikzpicture}[auto, node distance=5mm,>=latex',align=center,]
node [sum={}{+}{-}{}] (sum) {};
end{tikzpicture}
end{document}


how can the two prependicular diameters be drawn?



enter image description here







tikz-pgf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago

























asked 2 days ago









Diaa

2,51011644




2,51011644












  • Can you also provide a complete MWE for your second variant?
    – Skillmon
    2 days ago










  • @Skillmon I apologize. I updated my question.
    – Diaa
    2 days ago


















  • Can you also provide a complete MWE for your second variant?
    – Skillmon
    2 days ago










  • @Skillmon I apologize. I updated my question.
    – Diaa
    2 days ago
















Can you also provide a complete MWE for your second variant?
– Skillmon
2 days ago




Can you also provide a complete MWE for your second variant?
– Skillmon
2 days ago












@Skillmon I apologize. I updated my question.
– Diaa
2 days ago




@Skillmon I apologize. I updated my question.
– Diaa
2 days ago










1 Answer
1






active

oldest

votes

















up vote
5
down vote



accepted










Do you mean like this?



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


enter image description here



It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:



documentclass{standalone}
usepackage{tikz}

tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer























  • Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
    – Diaa
    2 days ago










  • Off-topic question: is it possible to declare multiple nodes using one single command node?
    – Diaa
    19 hours ago










  • @Diaa node is the same as path node so you can specify further nodes using node (a) {a} node (b) {b} ....
    – Skillmon
    16 hours ago













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',
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
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460260%2ftikz-summation-circle-with-four-ports-separated-by-two-prependicular-diameters%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote



accepted










Do you mean like this?



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


enter image description here



It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:



documentclass{standalone}
usepackage{tikz}

tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer























  • Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
    – Diaa
    2 days ago










  • Off-topic question: is it possible to declare multiple nodes using one single command node?
    – Diaa
    19 hours ago










  • @Diaa node is the same as path node so you can specify further nodes using node (a) {a} node (b) {b} ....
    – Skillmon
    16 hours ago

















up vote
5
down vote



accepted










Do you mean like this?



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


enter image description here



It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:



documentclass{standalone}
usepackage{tikz}

tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer























  • Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
    – Diaa
    2 days ago










  • Off-topic question: is it possible to declare multiple nodes using one single command node?
    – Diaa
    19 hours ago










  • @Diaa node is the same as path node so you can specify further nodes using node (a) {a} node (b) {b} ....
    – Skillmon
    16 hours ago















up vote
5
down vote



accepted







up vote
5
down vote



accepted






Do you mean like this?



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


enter image description here



It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:



documentclass{standalone}
usepackage{tikz}

tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer














Do you mean like this?



documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}


enter image description here



It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:



documentclass{standalone}
usepackage{tikz}

tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 16 hours ago

























answered 2 days ago









Skillmon

20.1k11840




20.1k11840












  • Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
    – Diaa
    2 days ago










  • Off-topic question: is it possible to declare multiple nodes using one single command node?
    – Diaa
    19 hours ago










  • @Diaa node is the same as path node so you can specify further nodes using node (a) {a} node (b) {b} ....
    – Skillmon
    16 hours ago




















  • Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
    – Diaa
    2 days ago










  • Off-topic question: is it possible to declare multiple nodes using one single command node?
    – Diaa
    19 hours ago










  • @Diaa node is the same as path node so you can specify further nodes using node (a) {a} node (b) {b} ....
    – Skillmon
    16 hours ago


















Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago




Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago












Off-topic question: is it possible to declare multiple nodes using one single command node?
– Diaa
19 hours ago




Off-topic question: is it possible to declare multiple nodes using one single command node?
– Diaa
19 hours ago












@Diaa node is the same as path node so you can specify further nodes using node (a) {a} node (b) {b} ....
– Skillmon
16 hours ago






@Diaa node is the same as path node so you can specify further nodes using node (a) {a} node (b) {b} ....
– Skillmon
16 hours ago




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460260%2ftikz-summation-circle-with-four-ports-separated-by-two-prependicular-diameters%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

サソリ

広島県道265号伴広島線

Accessing regular linux commands in Huawei's Dopra Linux