Tangent Lines Intersecting Curves











up vote
1
down vote

favorite












Why I am only getting one point of intersection read by the program? Solution is to breaking to two parts with tangent lines drawn at different lengths.



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at/.list={0.3,0.3},
normal at/.list={}] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-2,total=t},cyan]
(intersection-t) circle (2pt);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
(intersection-t) circle (2pt);
end{tikzpcicture}
end{document}


This outputs:



enter image description here










share|improve this question






















  • Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
    – marmot
    yesterday















up vote
1
down vote

favorite












Why I am only getting one point of intersection read by the program? Solution is to breaking to two parts with tangent lines drawn at different lengths.



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at/.list={0.3,0.3},
normal at/.list={}] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-2,total=t},cyan]
(intersection-t) circle (2pt);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
(intersection-t) circle (2pt);
end{tikzpcicture}
end{document}


This outputs:



enter image description here










share|improve this question






















  • Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
    – marmot
    yesterday













up vote
1
down vote

favorite









up vote
1
down vote

favorite











Why I am only getting one point of intersection read by the program? Solution is to breaking to two parts with tangent lines drawn at different lengths.



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at/.list={0.3,0.3},
normal at/.list={}] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-2,total=t},cyan]
(intersection-t) circle (2pt);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
(intersection-t) circle (2pt);
end{tikzpcicture}
end{document}


This outputs:



enter image description here










share|improve this question













Why I am only getting one point of intersection read by the program? Solution is to breaking to two parts with tangent lines drawn at different lengths.



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at/.list={0.3,0.3},
normal at/.list={}] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-2,total=t},cyan]
(intersection-t) circle (2pt);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
(intersection-t) circle (2pt);
end{tikzpcicture}
end{document}


This outputs:



enter image description here







intersections






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









MathScholar

4238




4238












  • Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
    – marmot
    yesterday


















  • Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
    – marmot
    yesterday
















Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
– marmot
yesterday




Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
– marmot
yesterday










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










The style tangent at=<pos> attaches a tangent at position pos. So tangent at/.list={0.3,0.3} will just create two identical tangents. However, this has nothing to do with the intersections. Rather, you want to mark the last two intersections of the tangent with the curve. (TikZ finds more intersections since a tangent of course runs very close to the curve, so some of the additional intersections are not true intersections but result from numerical inaccuracies.)



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at=0.3] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
pgfextra{pgfmathtruncatemacro{prevt}{t-1}}
foreach i in {prevt,t} {(intersection-i) circle (2pt)};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer





















  • @Thank Marmot. You are a tremendous help to me!
    – MathScholar
    yesterday











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%2f461640%2ftangent-lines-intersecting-curves%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
0
down vote



accepted










The style tangent at=<pos> attaches a tangent at position pos. So tangent at/.list={0.3,0.3} will just create two identical tangents. However, this has nothing to do with the intersections. Rather, you want to mark the last two intersections of the tangent with the curve. (TikZ finds more intersections since a tangent of course runs very close to the curve, so some of the additional intersections are not true intersections but result from numerical inaccuracies.)



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at=0.3] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
pgfextra{pgfmathtruncatemacro{prevt}{t-1}}
foreach i in {prevt,t} {(intersection-i) circle (2pt)};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer





















  • @Thank Marmot. You are a tremendous help to me!
    – MathScholar
    yesterday















up vote
0
down vote



accepted










The style tangent at=<pos> attaches a tangent at position pos. So tangent at/.list={0.3,0.3} will just create two identical tangents. However, this has nothing to do with the intersections. Rather, you want to mark the last two intersections of the tangent with the curve. (TikZ finds more intersections since a tangent of course runs very close to the curve, so some of the additional intersections are not true intersections but result from numerical inaccuracies.)



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at=0.3] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
pgfextra{pgfmathtruncatemacro{prevt}{t-1}}
foreach i in {prevt,t} {(intersection-i) circle (2pt)};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer





















  • @Thank Marmot. You are a tremendous help to me!
    – MathScholar
    yesterday













up vote
0
down vote



accepted







up vote
0
down vote



accepted






The style tangent at=<pos> attaches a tangent at position pos. So tangent at/.list={0.3,0.3} will just create two identical tangents. However, this has nothing to do with the intersections. Rather, you want to mark the last two intersections of the tangent with the curve. (TikZ finds more intersections since a tangent of course runs very close to the curve, so some of the additional intersections are not true intersections but result from numerical inaccuracies.)



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at=0.3] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
pgfextra{pgfmathtruncatemacro{prevt}{t-1}}
foreach i in {prevt,t} {(intersection-i) circle (2pt)};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer












The style tangent at=<pos> attaches a tangent at position pos. So tangent at/.list={0.3,0.3} will just create two identical tangents. However, this has nothing to do with the intersections. Rather, you want to mark the last two intersections of the tangent with the curve. (TikZ finds more intersections since a tangent of course runs very close to the curve, so some of the additional intersections are not true intersections but result from numerical inaccuracies.)



documentclass{article}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usetikzlibrary{decorations.markings}
begin{document}
pgfkeys{tikz/.cd,
tangent length/.store in=TangentLength,
tangent length=3.14cm,
normal length/.store in=NormalLength,
normal length=7mm}
newcounter{tangent}
newcounter{normal}
tikzset{tangent/.style={red,thin},normal/.style={blue,thin},
tangent at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{tangent}
draw[tangent,name path=tangent-thetangent] (-TangentLength,0) --
(9cm,0);
fill[tangent] (0,0) circle (2pt);}}}},
normal at/.style={postaction={decorate,decoration={markings,
mark=at position #1 with {stepcounter{normal}
draw[normal,name path=normal-thenormal] (0,-NormalLength) --
(0,NormalLength);
fill[normal] (0,0) circle (2pt);}}}},
}
begin{tikzpicture}
% Axes
draw [-latex] (-1,0) -- (11,0) node [right] {$x$};
draw [-latex] (0,-1) -- (0,6) node [above] {$y$};
% Origin
node at (0,0) [below left] {$0$};
% Points
coordinate (start) at (1,-0.8);
coordinate (c1) at (3,3);
coordinate (c2) at (5.5,1.5);
coordinate (c3) at (8,4);
coordinate (end) at (10.5,-0.8);
% show the points
% foreach n in {start,c1,c2,c3,end} fill [black] (n)
% circle (2pt) node [below] {};
% join the coordinates
draw [name path=curve,thick,tangent at=0.3] (start) to[out=70,in=180] (c1) to[out=0,in=180]
(c2) to[out=0,in=180] (c3) to[out=0,in=150] (end);
fill[name intersections={of=curve and tangent-1,total=t},cyan]
pgfextra{pgfmathtruncatemacro{prevt}{t-1}}
foreach i in {prevt,t} {(intersection-i) circle (2pt)};
end{tikzpicture}
end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









marmot

77.9k487166




77.9k487166












  • @Thank Marmot. You are a tremendous help to me!
    – MathScholar
    yesterday


















  • @Thank Marmot. You are a tremendous help to me!
    – MathScholar
    yesterday
















@Thank Marmot. You are a tremendous help to me!
– MathScholar
yesterday




@Thank Marmot. You are a tremendous help to me!
– MathScholar
yesterday


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461640%2ftangent-lines-intersecting-curves%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

Entries order in /etc/network/interfaces

新発田市

Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)