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:

intersections
add a comment |
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:

intersections
Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
– marmot
yesterday
add a comment |
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:

intersections
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:

intersections
intersections
asked yesterday
MathScholar
4238
4238
Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
– marmot
yesterday
add a comment |
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
add a comment |
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}

@Thank Marmot. You are a tremendous help to me!
– MathScholar
yesterday
add a comment |
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}

@Thank Marmot. You are a tremendous help to me!
– MathScholar
yesterday
add a comment |
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}

@Thank Marmot. You are a tremendous help to me!
– MathScholar
yesterday
add a comment |
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}

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}

answered yesterday
marmot
77.9k487166
77.9k487166
@Thank Marmot. You are a tremendous help to me!
– MathScholar
yesterday
add a comment |
@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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461640%2ftangent-lines-intersecting-curves%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please replace ` end{tikzpcicture}` by ` end{tikzpicture}`.
– marmot
yesterday