Intersection of a line with a plane, where is wrong in third way?












3















Let SABCD be a pyramid, SA perpendicular to the plane ABC, the base of pyramid is a rectangle,SA=h, AB=a, AD=b. A plane P passing A and perpendicular to the line SC cut the lines SB, SD, SC respectively at E, F, K.
I tried it in three ways.



First way



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
usepackage{tkz-euclide}
usetkzobj{all}
usetikzlibrary{intersections,calc,backgrounds}
begin{document}
tdplotsetmaincoords{60}{120}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h)
coordinate (E) at ({a*h^2/(a^2+h^2)}, 0, {a^2*h/(a^2+h^2)})
coordinate (F) at (0, {b*h^2/(b^2+h^2)}, {b^2*h/(b^2+h^2)})
coordinate (K) at ({a*h^2/(a^2+b^2+h^2)}, {b*h^2/(a^2+b^2+h^2)}, {(a^2+b^2)*h/(a^2+b^2+h^2)});

begin{scope}
draw [dashed, thick, name path=B--D] (B) -- (D);
draw [dashed, thick, name path=C--A] (C) -- (A);
path [name intersections={of=B--D and C--A,by=O}];
end{scope}

begin{scope}
draw [dashed, thick, name path=S--O] (S) -- (O);
draw [dashed, thick, name path=E--F] (E) -- (F);
path [name intersections={of=S--O and E--F,by=I}];
end{scope}

begin{scope}
draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C) (E) -- (K) --(F);
draw [thick, dashed] (A) -- (K) (E) -- (F) ;
tkzMarkRightAngle(S,A,D)
tkzMarkRightAngle(S,A,B)
tkzMarkRightAngle(A,B,C)
tkzMarkRightAngle(B,A,D)
tkzMarkRightAngle(A,F,D)
tkzMarkRightAngle(A,E,B)
tkzMarkRightAngle(A,K,C)
end{scope}

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right,O/below,I/below}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}
end{tikzpicture}

end{document}


Second way



documentclass[border=3mm,12pt]{standalone}
usepackage{fouriernc}
usepackage{tikz,tikz-3dplot}
usepackage{tkz-euclide}
usetkzobj{all}

newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

usetikzlibrary{intersections,calc,backgrounds}
tikzset{projection of point/.style args={(#1,#2,#3) on line through (#4,#5,#6)
and (#7,#8,#9)}{%
/utils/exec=pgfmathsetmacro{myprefactor}{((#1-#4)*(#7-#4)+(#2-#5)*(#8-#5)+(#3-#6)*(#9-#6))/((#7-#4)*(#7-#4)+(#8-#5)*(#8-#5)+(#9-#6)*(#9-#6))},
insert path={%
({#4+myprefactor*(#7-#4)},{#5+myprefactor*(#8-#5)},{#6+myprefactor*(#9-#6)})}
}}

begin{document}

tdplotsetmaincoords{60}{120}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);

path[projection of point={(0,0,0) on line through (a,0,0) and (0,0,h)}]
coordinate (E)
[projection of point={(0,0,0) on line through (0,0,h) and (0,b,0) }]
coordinate (F)
[projection of point={(0,0,0) on line through (0,0,h) and (a,b,0) }]
coordinate (K);

begin{scope}
draw [dashed, thick, name path=B--D] (B) -- (D);
draw [dashed, thick, name path=C--A] (C) -- (A);
path [name intersections={of=B--D and C--A,by=O}];
end{scope}

begin{scope}
draw [dashed, thick, name path=S--O] (S) -- (O);
draw [dashed, thick, name path=E--F] (E) -- (F);
path [name intersections={of=S--O and E--F,by=I}];
end{scope}


begin{scope}
draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C) (E) -- (K) --(F);
draw [thick, dashed] (A) -- (K) (E) -- (F) ;

tkzMarkRightAngle(S,A,D)
tkzMarkRightAngle(S,A,B)
tkzMarkRightAngle(A,B,C)
tkzMarkRightAngle(B,A,D)
tkzMarkRightAngle(A,F,D)
tkzMarkRightAngle(A,E,B)
tkzMarkRightAngle(A,K,C)
end{scope}

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right,O/below,I/below}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



Third way
Base on the answer Is there a command to find coordinates of projection of a point on a plane?



I defined command defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-#4,#2-#5,#3-#6)} and tried



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){#1*#4+#2*#5+#3*#6}
defVPTD(#1,#2,#3)x(#4,#5,#6){(#2*#6-#3*#5,#3*#4-#1*#6,#1*#5-#2*#4)}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-#4,#2-#5,#3-#6)}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+#4,#2+#5,#3+#6)}
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-SPTD#1.#4)}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{(SPTD#3.#4-SPTD#1.#4)/(SPTD#2.#4-SPTD#1.#4)}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


I got
enter image description here










share|improve this question


















  • 2





    This was a really stupid error that I made. Sorry for this!

    – marmot
    Jan 28 at 6:01
















3















Let SABCD be a pyramid, SA perpendicular to the plane ABC, the base of pyramid is a rectangle,SA=h, AB=a, AD=b. A plane P passing A and perpendicular to the line SC cut the lines SB, SD, SC respectively at E, F, K.
I tried it in three ways.



First way



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
usepackage{tkz-euclide}
usetkzobj{all}
usetikzlibrary{intersections,calc,backgrounds}
begin{document}
tdplotsetmaincoords{60}{120}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h)
coordinate (E) at ({a*h^2/(a^2+h^2)}, 0, {a^2*h/(a^2+h^2)})
coordinate (F) at (0, {b*h^2/(b^2+h^2)}, {b^2*h/(b^2+h^2)})
coordinate (K) at ({a*h^2/(a^2+b^2+h^2)}, {b*h^2/(a^2+b^2+h^2)}, {(a^2+b^2)*h/(a^2+b^2+h^2)});

begin{scope}
draw [dashed, thick, name path=B--D] (B) -- (D);
draw [dashed, thick, name path=C--A] (C) -- (A);
path [name intersections={of=B--D and C--A,by=O}];
end{scope}

begin{scope}
draw [dashed, thick, name path=S--O] (S) -- (O);
draw [dashed, thick, name path=E--F] (E) -- (F);
path [name intersections={of=S--O and E--F,by=I}];
end{scope}

begin{scope}
draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C) (E) -- (K) --(F);
draw [thick, dashed] (A) -- (K) (E) -- (F) ;
tkzMarkRightAngle(S,A,D)
tkzMarkRightAngle(S,A,B)
tkzMarkRightAngle(A,B,C)
tkzMarkRightAngle(B,A,D)
tkzMarkRightAngle(A,F,D)
tkzMarkRightAngle(A,E,B)
tkzMarkRightAngle(A,K,C)
end{scope}

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right,O/below,I/below}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}
end{tikzpicture}

end{document}


Second way



documentclass[border=3mm,12pt]{standalone}
usepackage{fouriernc}
usepackage{tikz,tikz-3dplot}
usepackage{tkz-euclide}
usetkzobj{all}

newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

usetikzlibrary{intersections,calc,backgrounds}
tikzset{projection of point/.style args={(#1,#2,#3) on line through (#4,#5,#6)
and (#7,#8,#9)}{%
/utils/exec=pgfmathsetmacro{myprefactor}{((#1-#4)*(#7-#4)+(#2-#5)*(#8-#5)+(#3-#6)*(#9-#6))/((#7-#4)*(#7-#4)+(#8-#5)*(#8-#5)+(#9-#6)*(#9-#6))},
insert path={%
({#4+myprefactor*(#7-#4)},{#5+myprefactor*(#8-#5)},{#6+myprefactor*(#9-#6)})}
}}

begin{document}

tdplotsetmaincoords{60}{120}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);

path[projection of point={(0,0,0) on line through (a,0,0) and (0,0,h)}]
coordinate (E)
[projection of point={(0,0,0) on line through (0,0,h) and (0,b,0) }]
coordinate (F)
[projection of point={(0,0,0) on line through (0,0,h) and (a,b,0) }]
coordinate (K);

begin{scope}
draw [dashed, thick, name path=B--D] (B) -- (D);
draw [dashed, thick, name path=C--A] (C) -- (A);
path [name intersections={of=B--D and C--A,by=O}];
end{scope}

begin{scope}
draw [dashed, thick, name path=S--O] (S) -- (O);
draw [dashed, thick, name path=E--F] (E) -- (F);
path [name intersections={of=S--O and E--F,by=I}];
end{scope}


begin{scope}
draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C) (E) -- (K) --(F);
draw [thick, dashed] (A) -- (K) (E) -- (F) ;

tkzMarkRightAngle(S,A,D)
tkzMarkRightAngle(S,A,B)
tkzMarkRightAngle(A,B,C)
tkzMarkRightAngle(B,A,D)
tkzMarkRightAngle(A,F,D)
tkzMarkRightAngle(A,E,B)
tkzMarkRightAngle(A,K,C)
end{scope}

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right,O/below,I/below}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



Third way
Base on the answer Is there a command to find coordinates of projection of a point on a plane?



I defined command defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-#4,#2-#5,#3-#6)} and tried



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){#1*#4+#2*#5+#3*#6}
defVPTD(#1,#2,#3)x(#4,#5,#6){(#2*#6-#3*#5,#3*#4-#1*#6,#1*#5-#2*#4)}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-#4,#2-#5,#3-#6)}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+#4,#2+#5,#3+#6)}
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-SPTD#1.#4)}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{(SPTD#3.#4-SPTD#1.#4)/(SPTD#2.#4-SPTD#1.#4)}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


I got
enter image description here










share|improve this question


















  • 2





    This was a really stupid error that I made. Sorry for this!

    – marmot
    Jan 28 at 6:01














3












3








3








Let SABCD be a pyramid, SA perpendicular to the plane ABC, the base of pyramid is a rectangle,SA=h, AB=a, AD=b. A plane P passing A and perpendicular to the line SC cut the lines SB, SD, SC respectively at E, F, K.
I tried it in three ways.



First way



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
usepackage{tkz-euclide}
usetkzobj{all}
usetikzlibrary{intersections,calc,backgrounds}
begin{document}
tdplotsetmaincoords{60}{120}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h)
coordinate (E) at ({a*h^2/(a^2+h^2)}, 0, {a^2*h/(a^2+h^2)})
coordinate (F) at (0, {b*h^2/(b^2+h^2)}, {b^2*h/(b^2+h^2)})
coordinate (K) at ({a*h^2/(a^2+b^2+h^2)}, {b*h^2/(a^2+b^2+h^2)}, {(a^2+b^2)*h/(a^2+b^2+h^2)});

begin{scope}
draw [dashed, thick, name path=B--D] (B) -- (D);
draw [dashed, thick, name path=C--A] (C) -- (A);
path [name intersections={of=B--D and C--A,by=O}];
end{scope}

begin{scope}
draw [dashed, thick, name path=S--O] (S) -- (O);
draw [dashed, thick, name path=E--F] (E) -- (F);
path [name intersections={of=S--O and E--F,by=I}];
end{scope}

begin{scope}
draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C) (E) -- (K) --(F);
draw [thick, dashed] (A) -- (K) (E) -- (F) ;
tkzMarkRightAngle(S,A,D)
tkzMarkRightAngle(S,A,B)
tkzMarkRightAngle(A,B,C)
tkzMarkRightAngle(B,A,D)
tkzMarkRightAngle(A,F,D)
tkzMarkRightAngle(A,E,B)
tkzMarkRightAngle(A,K,C)
end{scope}

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right,O/below,I/below}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}
end{tikzpicture}

end{document}


Second way



documentclass[border=3mm,12pt]{standalone}
usepackage{fouriernc}
usepackage{tikz,tikz-3dplot}
usepackage{tkz-euclide}
usetkzobj{all}

newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

usetikzlibrary{intersections,calc,backgrounds}
tikzset{projection of point/.style args={(#1,#2,#3) on line through (#4,#5,#6)
and (#7,#8,#9)}{%
/utils/exec=pgfmathsetmacro{myprefactor}{((#1-#4)*(#7-#4)+(#2-#5)*(#8-#5)+(#3-#6)*(#9-#6))/((#7-#4)*(#7-#4)+(#8-#5)*(#8-#5)+(#9-#6)*(#9-#6))},
insert path={%
({#4+myprefactor*(#7-#4)},{#5+myprefactor*(#8-#5)},{#6+myprefactor*(#9-#6)})}
}}

begin{document}

tdplotsetmaincoords{60}{120}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);

path[projection of point={(0,0,0) on line through (a,0,0) and (0,0,h)}]
coordinate (E)
[projection of point={(0,0,0) on line through (0,0,h) and (0,b,0) }]
coordinate (F)
[projection of point={(0,0,0) on line through (0,0,h) and (a,b,0) }]
coordinate (K);

begin{scope}
draw [dashed, thick, name path=B--D] (B) -- (D);
draw [dashed, thick, name path=C--A] (C) -- (A);
path [name intersections={of=B--D and C--A,by=O}];
end{scope}

begin{scope}
draw [dashed, thick, name path=S--O] (S) -- (O);
draw [dashed, thick, name path=E--F] (E) -- (F);
path [name intersections={of=S--O and E--F,by=I}];
end{scope}


begin{scope}
draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C) (E) -- (K) --(F);
draw [thick, dashed] (A) -- (K) (E) -- (F) ;

tkzMarkRightAngle(S,A,D)
tkzMarkRightAngle(S,A,B)
tkzMarkRightAngle(A,B,C)
tkzMarkRightAngle(B,A,D)
tkzMarkRightAngle(A,F,D)
tkzMarkRightAngle(A,E,B)
tkzMarkRightAngle(A,K,C)
end{scope}

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right,O/below,I/below}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



Third way
Base on the answer Is there a command to find coordinates of projection of a point on a plane?



I defined command defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-#4,#2-#5,#3-#6)} and tried



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){#1*#4+#2*#5+#3*#6}
defVPTD(#1,#2,#3)x(#4,#5,#6){(#2*#6-#3*#5,#3*#4-#1*#6,#1*#5-#2*#4)}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-#4,#2-#5,#3-#6)}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+#4,#2+#5,#3+#6)}
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-SPTD#1.#4)}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{(SPTD#3.#4-SPTD#1.#4)/(SPTD#2.#4-SPTD#1.#4)}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


I got
enter image description here










share|improve this question














Let SABCD be a pyramid, SA perpendicular to the plane ABC, the base of pyramid is a rectangle,SA=h, AB=a, AD=b. A plane P passing A and perpendicular to the line SC cut the lines SB, SD, SC respectively at E, F, K.
I tried it in three ways.



First way



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
usepackage{tkz-euclide}
usetkzobj{all}
usetikzlibrary{intersections,calc,backgrounds}
begin{document}
tdplotsetmaincoords{60}{120}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h)
coordinate (E) at ({a*h^2/(a^2+h^2)}, 0, {a^2*h/(a^2+h^2)})
coordinate (F) at (0, {b*h^2/(b^2+h^2)}, {b^2*h/(b^2+h^2)})
coordinate (K) at ({a*h^2/(a^2+b^2+h^2)}, {b*h^2/(a^2+b^2+h^2)}, {(a^2+b^2)*h/(a^2+b^2+h^2)});

begin{scope}
draw [dashed, thick, name path=B--D] (B) -- (D);
draw [dashed, thick, name path=C--A] (C) -- (A);
path [name intersections={of=B--D and C--A,by=O}];
end{scope}

begin{scope}
draw [dashed, thick, name path=S--O] (S) -- (O);
draw [dashed, thick, name path=E--F] (E) -- (F);
path [name intersections={of=S--O and E--F,by=I}];
end{scope}

begin{scope}
draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C) (E) -- (K) --(F);
draw [thick, dashed] (A) -- (K) (E) -- (F) ;
tkzMarkRightAngle(S,A,D)
tkzMarkRightAngle(S,A,B)
tkzMarkRightAngle(A,B,C)
tkzMarkRightAngle(B,A,D)
tkzMarkRightAngle(A,F,D)
tkzMarkRightAngle(A,E,B)
tkzMarkRightAngle(A,K,C)
end{scope}

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right,O/below,I/below}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}
end{tikzpicture}

end{document}


Second way



documentclass[border=3mm,12pt]{standalone}
usepackage{fouriernc}
usepackage{tikz,tikz-3dplot}
usepackage{tkz-euclide}
usetkzobj{all}

newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

usetikzlibrary{intersections,calc,backgrounds}
tikzset{projection of point/.style args={(#1,#2,#3) on line through (#4,#5,#6)
and (#7,#8,#9)}{%
/utils/exec=pgfmathsetmacro{myprefactor}{((#1-#4)*(#7-#4)+(#2-#5)*(#8-#5)+(#3-#6)*(#9-#6))/((#7-#4)*(#7-#4)+(#8-#5)*(#8-#5)+(#9-#6)*(#9-#6))},
insert path={%
({#4+myprefactor*(#7-#4)},{#5+myprefactor*(#8-#5)},{#6+myprefactor*(#9-#6)})}
}}

begin{document}

tdplotsetmaincoords{60}{120}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);

path[projection of point={(0,0,0) on line through (a,0,0) and (0,0,h)}]
coordinate (E)
[projection of point={(0,0,0) on line through (0,0,h) and (0,b,0) }]
coordinate (F)
[projection of point={(0,0,0) on line through (0,0,h) and (a,b,0) }]
coordinate (K);

begin{scope}
draw [dashed, thick, name path=B--D] (B) -- (D);
draw [dashed, thick, name path=C--A] (C) -- (A);
path [name intersections={of=B--D and C--A,by=O}];
end{scope}

begin{scope}
draw [dashed, thick, name path=S--O] (S) -- (O);
draw [dashed, thick, name path=E--F] (E) -- (F);
path [name intersections={of=S--O and E--F,by=I}];
end{scope}


begin{scope}
draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C) (E) -- (K) --(F);
draw [thick, dashed] (A) -- (K) (E) -- (F) ;

tkzMarkRightAngle(S,A,D)
tkzMarkRightAngle(S,A,B)
tkzMarkRightAngle(A,B,C)
tkzMarkRightAngle(B,A,D)
tkzMarkRightAngle(A,F,D)
tkzMarkRightAngle(A,E,B)
tkzMarkRightAngle(A,K,C)
end{scope}

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right,O/below,I/below}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



Third way
Base on the answer Is there a command to find coordinates of projection of a point on a plane?



I defined command defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-#4,#2-#5,#3-#6)} and tried



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){#1*#4+#2*#5+#3*#6}
defVPTD(#1,#2,#3)x(#4,#5,#6){(#2*#6-#3*#5,#3*#4-#1*#6,#1*#5-#2*#4)}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-#4,#2-#5,#3-#6)}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+#4,#2+#5,#3+#6)}
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-SPTD#1.#4)}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{(SPTD#3.#4-SPTD#1.#4)/(SPTD#2.#4-SPTD#1.#4)}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


I got
enter image description here







tikz-pgf tikz-3dplot






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 28 at 3:52









minhthien_2016minhthien_2016

1,226916




1,226916








  • 2





    This was a really stupid error that I made. Sorry for this!

    – marmot
    Jan 28 at 6:01














  • 2





    This was a really stupid error that I made. Sorry for this!

    – marmot
    Jan 28 at 6:01








2




2





This was a really stupid error that I made. Sorry for this!

– marmot
Jan 28 at 6:01





This was a really stupid error that I made. Sorry for this!

– marmot
Jan 28 at 6:01










1 Answer
1






active

oldest

votes


















2














I am sorry, my original code has a flaw. I simply forgot to put brackets around the scalar products like SPTD#3.#4 and so on. And when testing this in the update to the previous answer, this did not matter. Once one adds these brackets, one gets



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))}
defVPTD(#1,#2,#3)x(#4,#5,#6){((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-1*(#4),#2-1*(#5),#3-1*(#6))}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+1*(#4),#2+1*(#5),#3+1*(#6))}
% the line is given by vec x = vec ell_0 + t vec ell
% the points in the plane fulfill (vec P_0 - vec x)cdotvec n =0
% inserting the line equation in the plane equation gives
% (vec Q - vec ell_0 - d vec ell)cdot vec n = 0
% solving for d yields
% d = (vec Q cdot vec n - vec ell_0cdotvec n)/(vecellcdot vec n)
%
% in the macro vec ell_0 = #1 , vec ell = #2 - #1
% #3 : vec Q and #4 : vec n
% so d=(#3.#4-#1.#4)/(#2.#4-#1.#4)
% and vec P = vec ell_0 + d * vec ell = #1 + d * (#2-#1)
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-(SPTD#1.#4))}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{((SPTD#3.#4)-(SPTD#1.#4))/((SPTD#2.#4)-(SPTD#1.#4))}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



This agrees with what you got with your other very nice methods. Sorry for the confusion!






share|improve this answer





















  • 1





    Can you select all answers and make a package?

    – minhthien_2016
    Jan 28 at 6:08






  • 1





    @minhthien_2016 I can try to clean up and write the styles more similar. This is what I plan to do (I also want to make parsing the vectors more elegant.) I don't have much experience in package writing. Anybody who wants to write a package is very welcome to use these styles. I guess that collecting these and other tricks in a TikZ library may make sense. (There is a conceptual point that I would like solve: can one store the 3D coordinates in symbolic coordinates? That would make these things much more elegant.)

    – marmot
    Jan 28 at 6:13






  • 2





    I use Maple, so finding coordinates of points is not too difficult. This approach is easy to know when using Maple. I want it to be written in TeX for everyone to use TeX easily.

    – minhthien_2016
    Jan 28 at 6:20











  • Can you see at here tex.stackexchange.com/questions/400808/… ?

    – minhthien_2016
    Jan 31 at 8:22











  • And my question at here tex.stackexchange.com/questions/401630/…

    – minhthien_2016
    Jan 31 at 8:28











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


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472175%2fintersection-of-a-line-with-a-plane-where-is-wrong-in-third-way%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









2














I am sorry, my original code has a flaw. I simply forgot to put brackets around the scalar products like SPTD#3.#4 and so on. And when testing this in the update to the previous answer, this did not matter. Once one adds these brackets, one gets



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))}
defVPTD(#1,#2,#3)x(#4,#5,#6){((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-1*(#4),#2-1*(#5),#3-1*(#6))}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+1*(#4),#2+1*(#5),#3+1*(#6))}
% the line is given by vec x = vec ell_0 + t vec ell
% the points in the plane fulfill (vec P_0 - vec x)cdotvec n =0
% inserting the line equation in the plane equation gives
% (vec Q - vec ell_0 - d vec ell)cdot vec n = 0
% solving for d yields
% d = (vec Q cdot vec n - vec ell_0cdotvec n)/(vecellcdot vec n)
%
% in the macro vec ell_0 = #1 , vec ell = #2 - #1
% #3 : vec Q and #4 : vec n
% so d=(#3.#4-#1.#4)/(#2.#4-#1.#4)
% and vec P = vec ell_0 + d * vec ell = #1 + d * (#2-#1)
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-(SPTD#1.#4))}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{((SPTD#3.#4)-(SPTD#1.#4))/((SPTD#2.#4)-(SPTD#1.#4))}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



This agrees with what you got with your other very nice methods. Sorry for the confusion!






share|improve this answer





















  • 1





    Can you select all answers and make a package?

    – minhthien_2016
    Jan 28 at 6:08






  • 1





    @minhthien_2016 I can try to clean up and write the styles more similar. This is what I plan to do (I also want to make parsing the vectors more elegant.) I don't have much experience in package writing. Anybody who wants to write a package is very welcome to use these styles. I guess that collecting these and other tricks in a TikZ library may make sense. (There is a conceptual point that I would like solve: can one store the 3D coordinates in symbolic coordinates? That would make these things much more elegant.)

    – marmot
    Jan 28 at 6:13






  • 2





    I use Maple, so finding coordinates of points is not too difficult. This approach is easy to know when using Maple. I want it to be written in TeX for everyone to use TeX easily.

    – minhthien_2016
    Jan 28 at 6:20











  • Can you see at here tex.stackexchange.com/questions/400808/… ?

    – minhthien_2016
    Jan 31 at 8:22











  • And my question at here tex.stackexchange.com/questions/401630/…

    – minhthien_2016
    Jan 31 at 8:28
















2














I am sorry, my original code has a flaw. I simply forgot to put brackets around the scalar products like SPTD#3.#4 and so on. And when testing this in the update to the previous answer, this did not matter. Once one adds these brackets, one gets



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))}
defVPTD(#1,#2,#3)x(#4,#5,#6){((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-1*(#4),#2-1*(#5),#3-1*(#6))}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+1*(#4),#2+1*(#5),#3+1*(#6))}
% the line is given by vec x = vec ell_0 + t vec ell
% the points in the plane fulfill (vec P_0 - vec x)cdotvec n =0
% inserting the line equation in the plane equation gives
% (vec Q - vec ell_0 - d vec ell)cdot vec n = 0
% solving for d yields
% d = (vec Q cdot vec n - vec ell_0cdotvec n)/(vecellcdot vec n)
%
% in the macro vec ell_0 = #1 , vec ell = #2 - #1
% #3 : vec Q and #4 : vec n
% so d=(#3.#4-#1.#4)/(#2.#4-#1.#4)
% and vec P = vec ell_0 + d * vec ell = #1 + d * (#2-#1)
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-(SPTD#1.#4))}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{((SPTD#3.#4)-(SPTD#1.#4))/((SPTD#2.#4)-(SPTD#1.#4))}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



This agrees with what you got with your other very nice methods. Sorry for the confusion!






share|improve this answer





















  • 1





    Can you select all answers and make a package?

    – minhthien_2016
    Jan 28 at 6:08






  • 1





    @minhthien_2016 I can try to clean up and write the styles more similar. This is what I plan to do (I also want to make parsing the vectors more elegant.) I don't have much experience in package writing. Anybody who wants to write a package is very welcome to use these styles. I guess that collecting these and other tricks in a TikZ library may make sense. (There is a conceptual point that I would like solve: can one store the 3D coordinates in symbolic coordinates? That would make these things much more elegant.)

    – marmot
    Jan 28 at 6:13






  • 2





    I use Maple, so finding coordinates of points is not too difficult. This approach is easy to know when using Maple. I want it to be written in TeX for everyone to use TeX easily.

    – minhthien_2016
    Jan 28 at 6:20











  • Can you see at here tex.stackexchange.com/questions/400808/… ?

    – minhthien_2016
    Jan 31 at 8:22











  • And my question at here tex.stackexchange.com/questions/401630/…

    – minhthien_2016
    Jan 31 at 8:28














2












2








2







I am sorry, my original code has a flaw. I simply forgot to put brackets around the scalar products like SPTD#3.#4 and so on. And when testing this in the update to the previous answer, this did not matter. Once one adds these brackets, one gets



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))}
defVPTD(#1,#2,#3)x(#4,#5,#6){((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-1*(#4),#2-1*(#5),#3-1*(#6))}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+1*(#4),#2+1*(#5),#3+1*(#6))}
% the line is given by vec x = vec ell_0 + t vec ell
% the points in the plane fulfill (vec P_0 - vec x)cdotvec n =0
% inserting the line equation in the plane equation gives
% (vec Q - vec ell_0 - d vec ell)cdot vec n = 0
% solving for d yields
% d = (vec Q cdot vec n - vec ell_0cdotvec n)/(vecellcdot vec n)
%
% in the macro vec ell_0 = #1 , vec ell = #2 - #1
% #3 : vec Q and #4 : vec n
% so d=(#3.#4-#1.#4)/(#2.#4-#1.#4)
% and vec P = vec ell_0 + d * vec ell = #1 + d * (#2-#1)
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-(SPTD#1.#4))}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{((SPTD#3.#4)-(SPTD#1.#4))/((SPTD#2.#4)-(SPTD#1.#4))}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



This agrees with what you got with your other very nice methods. Sorry for the confusion!






share|improve this answer















I am sorry, my original code has a flaw. I simply forgot to put brackets around the scalar products like SPTD#3.#4 and so on. And when testing this in the update to the previous answer, this did not matter. Once one adds these brackets, one gets



documentclass[border=3.14mm,12pt,tikz]{standalone}
usepackage{tikz,tikz-3dplot}
%% smuggling from https://tex.stackexchange.com/a/470979/121799
newcounter{smuggle}
DeclareRobustCommandsmuggleone[1]{%
stepcounter{smuggle}%
expandafterglobalexpandafterletcsname smuggle@arabic{smuggle}endcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabic{smuggle}endcsname
}
DeclareRobustCommandsmuggle[2][1]{%
smuggleone{#2}%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi
}

defparsecoord(#1,#2,#3)>(#4,#5,#6){%
def#4{#1}%
def#5{#2}%
def#6{#3}%
smuggle{#4}%
smuggle{#5}%
smuggle{#6}%
}
defSPTD(#1,#2,#3).(#4,#5,#6){((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))}
defVPTD(#1,#2,#3)x(#4,#5,#6){((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))}
defVecMinus(#1,#2,#3)-(#4,#5,#6){(#1-1*(#4),#2-1*(#5),#3-1*(#6))}
defVecAdd(#1,#2,#3)+(#4,#5,#6){(#1+1*(#4),#2+1*(#5),#3+1*(#6))}
% the line is given by vec x = vec ell_0 + t vec ell
% the points in the plane fulfill (vec P_0 - vec x)cdotvec n =0
% inserting the line equation in the plane equation gives
% (vec Q - vec ell_0 - d vec ell)cdot vec n = 0
% solving for d yields
% d = (vec Q cdot vec n - vec ell_0cdotvec n)/(vecellcdot vec n)
%
% in the macro vec ell_0 = #1 , vec ell = #2 - #1
% #3 : vec Q and #4 : vec n
% so d=(#3.#4-#1.#4)/(#2.#4-#1.#4)
% and vec P = vec ell_0 + d * vec ell = #1 + d * (#2-#1)
tikzset{intersection of line trough/.style args={#1 and #2 with plane
containing #3 and normal #4}{%
/utils/exec={pgfmathsetmacro{ltest}{abs(SPTD#2.#4-(SPTD#1.#4))}
parsecoord#1>(myAx,myAy,myAz)
parsecoord#2>(myBx,myBy,myBz)
ifdimltest pt<0.01pt
typeout{Planespace andspace linespace arespace parallel!ltest}
pgfmathsetmacro{myd}{0}
else
pgfmathsetmacro{myd}{((SPTD#3.#4)-(SPTD#1.#4))/((SPTD#2.#4)-(SPTD#1.#4))}
fi
%typeout{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
defmyP{({myAx+myd*(myBx-myAx)},{myAy+myd*(myBy-myAy)},{myAz+myd*(myBz-myAz)})}
smugglemyP},
insert path={%
myP}
}}

begin{document}
tdplotsetmaincoords{75}{110}
begin{tikzpicture}[tdplot_main_coords,scale=1.5]
pgfmathsetmacroa{3}
pgfmathsetmacrob{4}
pgfmathsetmacroh{5}

% definitions
path
coordinate(A) at (0,0,0)
coordinate (B) at (a,0,0)
coordinate (C) at (a,b,0)
coordinate (D) at (0,b,0)
coordinate (S) at (0,0,h);
defmynormal{VecMinus(a,b,0)-(0,0,h)}
typeout{mynormal:(a,b,-h)}
path[intersection of line trough={(0,0,h) and (a,0,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (E)
[intersection of line trough={(0,0,h) and (0,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (F)
[intersection of line trough={(0,0,h) and (a,b,0) with plane containing (0,0,0) and normal (a,b,-h)}] coordinate (K);


draw[dashed, thick]
(A) -- (B) (D)--(A) (S)--(A);
draw[dashed, thick]
(E) --(A) -- (F);
draw[ultra thick]
(S) -- (B) -- (C) -- (D)--cycle (S)--(C);

draw [thick, dashed] (A) -- (K) (A) -- (C) (B) -- (D) (E) -- (F) ;
draw [thick] (E) -- (K) -- (F) ;

foreach point/position in {A/left,B/below,C/below,S/above,D/right,E/left,D/right,F/right,K/above right}
{
fill (point) circle (1.5pt);
node[position=3pt] at (point) {$point$};
}

end{tikzpicture}
end{document}


enter image description here



This agrees with what you got with your other very nice methods. Sorry for the confusion!







share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday

























answered Jan 28 at 5:53









marmotmarmot

97.2k4112214




97.2k4112214








  • 1





    Can you select all answers and make a package?

    – minhthien_2016
    Jan 28 at 6:08






  • 1





    @minhthien_2016 I can try to clean up and write the styles more similar. This is what I plan to do (I also want to make parsing the vectors more elegant.) I don't have much experience in package writing. Anybody who wants to write a package is very welcome to use these styles. I guess that collecting these and other tricks in a TikZ library may make sense. (There is a conceptual point that I would like solve: can one store the 3D coordinates in symbolic coordinates? That would make these things much more elegant.)

    – marmot
    Jan 28 at 6:13






  • 2





    I use Maple, so finding coordinates of points is not too difficult. This approach is easy to know when using Maple. I want it to be written in TeX for everyone to use TeX easily.

    – minhthien_2016
    Jan 28 at 6:20











  • Can you see at here tex.stackexchange.com/questions/400808/… ?

    – minhthien_2016
    Jan 31 at 8:22











  • And my question at here tex.stackexchange.com/questions/401630/…

    – minhthien_2016
    Jan 31 at 8:28














  • 1





    Can you select all answers and make a package?

    – minhthien_2016
    Jan 28 at 6:08






  • 1





    @minhthien_2016 I can try to clean up and write the styles more similar. This is what I plan to do (I also want to make parsing the vectors more elegant.) I don't have much experience in package writing. Anybody who wants to write a package is very welcome to use these styles. I guess that collecting these and other tricks in a TikZ library may make sense. (There is a conceptual point that I would like solve: can one store the 3D coordinates in symbolic coordinates? That would make these things much more elegant.)

    – marmot
    Jan 28 at 6:13






  • 2





    I use Maple, so finding coordinates of points is not too difficult. This approach is easy to know when using Maple. I want it to be written in TeX for everyone to use TeX easily.

    – minhthien_2016
    Jan 28 at 6:20











  • Can you see at here tex.stackexchange.com/questions/400808/… ?

    – minhthien_2016
    Jan 31 at 8:22











  • And my question at here tex.stackexchange.com/questions/401630/…

    – minhthien_2016
    Jan 31 at 8:28








1




1





Can you select all answers and make a package?

– minhthien_2016
Jan 28 at 6:08





Can you select all answers and make a package?

– minhthien_2016
Jan 28 at 6:08




1




1





@minhthien_2016 I can try to clean up and write the styles more similar. This is what I plan to do (I also want to make parsing the vectors more elegant.) I don't have much experience in package writing. Anybody who wants to write a package is very welcome to use these styles. I guess that collecting these and other tricks in a TikZ library may make sense. (There is a conceptual point that I would like solve: can one store the 3D coordinates in symbolic coordinates? That would make these things much more elegant.)

– marmot
Jan 28 at 6:13





@minhthien_2016 I can try to clean up and write the styles more similar. This is what I plan to do (I also want to make parsing the vectors more elegant.) I don't have much experience in package writing. Anybody who wants to write a package is very welcome to use these styles. I guess that collecting these and other tricks in a TikZ library may make sense. (There is a conceptual point that I would like solve: can one store the 3D coordinates in symbolic coordinates? That would make these things much more elegant.)

– marmot
Jan 28 at 6:13




2




2





I use Maple, so finding coordinates of points is not too difficult. This approach is easy to know when using Maple. I want it to be written in TeX for everyone to use TeX easily.

– minhthien_2016
Jan 28 at 6:20





I use Maple, so finding coordinates of points is not too difficult. This approach is easy to know when using Maple. I want it to be written in TeX for everyone to use TeX easily.

– minhthien_2016
Jan 28 at 6:20













Can you see at here tex.stackexchange.com/questions/400808/… ?

– minhthien_2016
Jan 31 at 8:22





Can you see at here tex.stackexchange.com/questions/400808/… ?

– minhthien_2016
Jan 31 at 8:22













And my question at here tex.stackexchange.com/questions/401630/…

– minhthien_2016
Jan 31 at 8:28





And my question at here tex.stackexchange.com/questions/401630/…

– minhthien_2016
Jan 31 at 8:28


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472175%2fintersection-of-a-line-with-a-plane-where-is-wrong-in-third-way%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

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?