How to draw 90 degree angles in intersection points using tikzpicture environment
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Please consider this MWE:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
endaxis
endtikzpicture
endcenter
enddocument
I would like to draw a 90
degree angles in the two interception points:
The functions are y^3 = x
and x^2/(16/3)+y^2/(16)=1
.
Thanks!
tikz-pgf
 |Â
show 2 more comments
up vote
2
down vote
favorite
Please consider this MWE:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
endaxis
endtikzpicture
endcenter
enddocument
I would like to draw a 90
degree angles in the two interception points:
The functions are y^3 = x
and x^2/(16/3)+y^2/(16)=1
.
Thanks!
tikz-pgf
1
That's an interesting question, +1. Will look at it when I'm back in our burrow unless someone else answered it in between.
â marmot
2 hours ago
@marmot the others are not? Hahahaha. Ok, enjoy.
â manooooh
1 hour ago
Maybe this awesome Skillmon's answer help?
â manooooh
1 hour ago
2
I donâÂÂt think the first function isy^3 = x
â¦
â Ruixi Zhang
1 hour ago
1
@RuixiZhang I agree with you. manooooh, do you want your function, which isy=-3*x/|x|^2/3
, ory^3=x
?
â marmot
1 hour ago
 |Â
show 2 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Please consider this MWE:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
endaxis
endtikzpicture
endcenter
enddocument
I would like to draw a 90
degree angles in the two interception points:
The functions are y^3 = x
and x^2/(16/3)+y^2/(16)=1
.
Thanks!
tikz-pgf
Please consider this MWE:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
endaxis
endtikzpicture
endcenter
enddocument
I would like to draw a 90
degree angles in the two interception points:
The functions are y^3 = x
and x^2/(16/3)+y^2/(16)=1
.
Thanks!
tikz-pgf
tikz-pgf
asked 2 hours ago
manooooh
6691212
6691212
1
That's an interesting question, +1. Will look at it when I'm back in our burrow unless someone else answered it in between.
â marmot
2 hours ago
@marmot the others are not? Hahahaha. Ok, enjoy.
â manooooh
1 hour ago
Maybe this awesome Skillmon's answer help?
â manooooh
1 hour ago
2
I donâÂÂt think the first function isy^3 = x
â¦
â Ruixi Zhang
1 hour ago
1
@RuixiZhang I agree with you. manooooh, do you want your function, which isy=-3*x/|x|^2/3
, ory^3=x
?
â marmot
1 hour ago
 |Â
show 2 more comments
1
That's an interesting question, +1. Will look at it when I'm back in our burrow unless someone else answered it in between.
â marmot
2 hours ago
@marmot the others are not? Hahahaha. Ok, enjoy.
â manooooh
1 hour ago
Maybe this awesome Skillmon's answer help?
â manooooh
1 hour ago
2
I donâÂÂt think the first function isy^3 = x
â¦
â Ruixi Zhang
1 hour ago
1
@RuixiZhang I agree with you. manooooh, do you want your function, which isy=-3*x/|x|^2/3
, ory^3=x
?
â marmot
1 hour ago
1
1
That's an interesting question, +1. Will look at it when I'm back in our burrow unless someone else answered it in between.
â marmot
2 hours ago
That's an interesting question, +1. Will look at it when I'm back in our burrow unless someone else answered it in between.
â marmot
2 hours ago
@marmot the others are not? Hahahaha. Ok, enjoy.
â manooooh
1 hour ago
@marmot the others are not? Hahahaha. Ok, enjoy.
â manooooh
1 hour ago
Maybe this awesome Skillmon's answer help?
â manooooh
1 hour ago
Maybe this awesome Skillmon's answer help?
â manooooh
1 hour ago
2
2
I donâÂÂt think the first function is
y^3 = x
â¦â Ruixi Zhang
1 hour ago
I donâÂÂt think the first function is
y^3 = x
â¦â Ruixi Zhang
1 hour ago
1
1
@RuixiZhang I agree with you. manooooh, do you want your function, which is
y=-3*x/|x|^2/3
, or y^3=x
?â marmot
1 hour ago
@RuixiZhang I agree with you. manooooh, do you want your function, which is
y=-3*x/|x|^2/3
, or y^3=x
?â marmot
1 hour ago
 |Â
show 2 more comments
2 Answers
2
active
oldest
votes
up vote
2
down vote
Another math exercise for me! Here you go:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
pgfmathsetmacrointersectionx-1.3157310986
pgfmathsetmacrointersectiony3.2873325096
pgfmathsetmacrointersectionangle%
atan((-2*intersectionx/(16/3))/(2*intersectiony/16))
pgfmathsetmacrocornersidelength0.3
filldraw (axis cs:intersectionx,intersectiony) circle (1pt);
draw[thick]
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)) --
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle)
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle)) --
(axis cs:intersectionx
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*sin(intersectionangle));
filldraw (axis cs:-intersectionx,-intersectiony) circle (1pt);
draw[thick]
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)
-cornersidelength*cos(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*sin(intersectionangle),
-intersectiony
-cornersidelength*cos(intersectionangle));
endaxis
endtikzpicture
endcenter
enddocument
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
add a comment |Â
up vote
2
down vote
There are some weird effects when one computes intersections of some paths defined inside an axis outside the axis, so I'm stuck with an ugly solution in which the factors 1.1
and 1.13
are hard coded. If it were not for these effects, one could have a much nicer solution which does not rely on any computations of the user...
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarycalc,intersections
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
begindocument
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80,name path=A] (-3)*x/abs(x)^(2/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80,name path=B] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
path[name intersections=of=A and B] (0,0) coordinate (O) (1,0)
coordinate(X);
endaxis
path
let p1=($(X)-(O)$),p2=($(intersection-1)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-1) -- + (-0.3,-0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-1) -- + (-0.3*n2*1cm/1pt,0.3) coordinate(aux2)
(intersection-1) -- + (-0.3cm-0.3*n2*1cm/1pt,0.3cm-0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
path
let p1=($(X)-(O)$),p2=($(intersection-2)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-2) -- + (0.3,0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-2) -- + (0.3*n2*1cm/1pt,-0.3) coordinate(aux2)
(intersection-2) -- + (0.3cm+0.3*n2*1cm/1pt,-0.3cm+0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
endtikzpicture
enddocument
I just noted that there seems something really weird going on with the pgfplotslibrary fillbetween.
â marmot
28 mins ago
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
@manooooh According to what I find here, we are all in trouble. ;-) More seriously, at this point Ruixi's nice answer is clearly superior. (On the other hand, if it were not for these unexpected problems, there would be a nice simple trick that would avoid the necessity to compute things by hand. However, I have no clue how to fix these problems.) In order to ploty=x^1/3
, you only need to drop the factor3
, i.e. plot-x/abs(x)^(2/3);
.
â marmot
2 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Another math exercise for me! Here you go:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
pgfmathsetmacrointersectionx-1.3157310986
pgfmathsetmacrointersectiony3.2873325096
pgfmathsetmacrointersectionangle%
atan((-2*intersectionx/(16/3))/(2*intersectiony/16))
pgfmathsetmacrocornersidelength0.3
filldraw (axis cs:intersectionx,intersectiony) circle (1pt);
draw[thick]
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)) --
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle)
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle)) --
(axis cs:intersectionx
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*sin(intersectionangle));
filldraw (axis cs:-intersectionx,-intersectiony) circle (1pt);
draw[thick]
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)
-cornersidelength*cos(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*sin(intersectionangle),
-intersectiony
-cornersidelength*cos(intersectionangle));
endaxis
endtikzpicture
endcenter
enddocument
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
add a comment |Â
up vote
2
down vote
Another math exercise for me! Here you go:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
pgfmathsetmacrointersectionx-1.3157310986
pgfmathsetmacrointersectiony3.2873325096
pgfmathsetmacrointersectionangle%
atan((-2*intersectionx/(16/3))/(2*intersectiony/16))
pgfmathsetmacrocornersidelength0.3
filldraw (axis cs:intersectionx,intersectiony) circle (1pt);
draw[thick]
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)) --
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle)
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle)) --
(axis cs:intersectionx
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*sin(intersectionangle));
filldraw (axis cs:-intersectionx,-intersectiony) circle (1pt);
draw[thick]
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)
-cornersidelength*cos(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*sin(intersectionangle),
-intersectiony
-cornersidelength*cos(intersectionangle));
endaxis
endtikzpicture
endcenter
enddocument
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Another math exercise for me! Here you go:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
pgfmathsetmacrointersectionx-1.3157310986
pgfmathsetmacrointersectiony3.2873325096
pgfmathsetmacrointersectionangle%
atan((-2*intersectionx/(16/3))/(2*intersectiony/16))
pgfmathsetmacrocornersidelength0.3
filldraw (axis cs:intersectionx,intersectiony) circle (1pt);
draw[thick]
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)) --
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle)
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle)) --
(axis cs:intersectionx
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*sin(intersectionangle));
filldraw (axis cs:-intersectionx,-intersectiony) circle (1pt);
draw[thick]
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)
-cornersidelength*cos(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*sin(intersectionangle),
-intersectiony
-cornersidelength*cos(intersectionangle));
endaxis
endtikzpicture
endcenter
enddocument
Another math exercise for me! Here you go:
documentclassarticle
usepackage[utf8]inputenc
usepackagepgfplots
pgfplotssetcompat=1.8
pgfplotssetsoldot/.style=color=black,only marks,mark=*
pgfplotssetholdot/.style=color=red,fill=white,very thick,only marks,mark=*
begindocument
begincenter
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80] (-3)*x/abs(x)*abs(x)^(1/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
pgfmathsetmacrointersectionx-1.3157310986
pgfmathsetmacrointersectiony3.2873325096
pgfmathsetmacrointersectionangle%
atan((-2*intersectionx/(16/3))/(2*intersectiony/16))
pgfmathsetmacrocornersidelength0.3
filldraw (axis cs:intersectionx,intersectiony) circle (1pt);
draw[thick]
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)) --
(axis cs:intersectionx
-cornersidelength*sin(intersectionangle)
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle)) --
(axis cs:intersectionx
+cornersidelength*cos(intersectionangle),
intersectiony
+cornersidelength*sin(intersectionangle));
filldraw (axis cs:-intersectionx,-intersectiony) circle (1pt);
draw[thick]
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*cos(intersectionangle)
+cornersidelength*sin(intersectionangle),
-intersectiony
+cornersidelength*sin(intersectionangle)
-cornersidelength*cos(intersectionangle)) --
(axis cs:-intersectionx
+cornersidelength*sin(intersectionangle),
-intersectiony
-cornersidelength*cos(intersectionangle));
endaxis
endtikzpicture
endcenter
enddocument
edited 51 mins ago
answered 57 mins ago
Ruixi Zhang
4,773318
4,773318
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
add a comment |Â
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
Am I in problems if you have to change the function to
y^3=x
? I plot it and there's is no nice display...â manooooh
7 mins ago
Am I in problems if you have to change the function to
y^3=x
? I plot it and there's is no nice display...â manooooh
7 mins ago
add a comment |Â
up vote
2
down vote
There are some weird effects when one computes intersections of some paths defined inside an axis outside the axis, so I'm stuck with an ugly solution in which the factors 1.1
and 1.13
are hard coded. If it were not for these effects, one could have a much nicer solution which does not rely on any computations of the user...
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarycalc,intersections
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
begindocument
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80,name path=A] (-3)*x/abs(x)^(2/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80,name path=B] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
path[name intersections=of=A and B] (0,0) coordinate (O) (1,0)
coordinate(X);
endaxis
path
let p1=($(X)-(O)$),p2=($(intersection-1)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-1) -- + (-0.3,-0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-1) -- + (-0.3*n2*1cm/1pt,0.3) coordinate(aux2)
(intersection-1) -- + (-0.3cm-0.3*n2*1cm/1pt,0.3cm-0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
path
let p1=($(X)-(O)$),p2=($(intersection-2)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-2) -- + (0.3,0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-2) -- + (0.3*n2*1cm/1pt,-0.3) coordinate(aux2)
(intersection-2) -- + (0.3cm+0.3*n2*1cm/1pt,-0.3cm+0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
endtikzpicture
enddocument
I just noted that there seems something really weird going on with the pgfplotslibrary fillbetween.
â marmot
28 mins ago
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
@manooooh According to what I find here, we are all in trouble. ;-) More seriously, at this point Ruixi's nice answer is clearly superior. (On the other hand, if it were not for these unexpected problems, there would be a nice simple trick that would avoid the necessity to compute things by hand. However, I have no clue how to fix these problems.) In order to ploty=x^1/3
, you only need to drop the factor3
, i.e. plot-x/abs(x)^(2/3);
.
â marmot
2 mins ago
add a comment |Â
up vote
2
down vote
There are some weird effects when one computes intersections of some paths defined inside an axis outside the axis, so I'm stuck with an ugly solution in which the factors 1.1
and 1.13
are hard coded. If it were not for these effects, one could have a much nicer solution which does not rely on any computations of the user...
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarycalc,intersections
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
begindocument
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80,name path=A] (-3)*x/abs(x)^(2/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80,name path=B] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
path[name intersections=of=A and B] (0,0) coordinate (O) (1,0)
coordinate(X);
endaxis
path
let p1=($(X)-(O)$),p2=($(intersection-1)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-1) -- + (-0.3,-0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-1) -- + (-0.3*n2*1cm/1pt,0.3) coordinate(aux2)
(intersection-1) -- + (-0.3cm-0.3*n2*1cm/1pt,0.3cm-0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
path
let p1=($(X)-(O)$),p2=($(intersection-2)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-2) -- + (0.3,0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-2) -- + (0.3*n2*1cm/1pt,-0.3) coordinate(aux2)
(intersection-2) -- + (0.3cm+0.3*n2*1cm/1pt,-0.3cm+0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
endtikzpicture
enddocument
I just noted that there seems something really weird going on with the pgfplotslibrary fillbetween.
â marmot
28 mins ago
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
@manooooh According to what I find here, we are all in trouble. ;-) More seriously, at this point Ruixi's nice answer is clearly superior. (On the other hand, if it were not for these unexpected problems, there would be a nice simple trick that would avoid the necessity to compute things by hand. However, I have no clue how to fix these problems.) In order to ploty=x^1/3
, you only need to drop the factor3
, i.e. plot-x/abs(x)^(2/3);
.
â marmot
2 mins ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
There are some weird effects when one computes intersections of some paths defined inside an axis outside the axis, so I'm stuck with an ugly solution in which the factors 1.1
and 1.13
are hard coded. If it were not for these effects, one could have a much nicer solution which does not rely on any computations of the user...
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarycalc,intersections
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
begindocument
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80,name path=A] (-3)*x/abs(x)^(2/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80,name path=B] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
path[name intersections=of=A and B] (0,0) coordinate (O) (1,0)
coordinate(X);
endaxis
path
let p1=($(X)-(O)$),p2=($(intersection-1)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-1) -- + (-0.3,-0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-1) -- + (-0.3*n2*1cm/1pt,0.3) coordinate(aux2)
(intersection-1) -- + (-0.3cm-0.3*n2*1cm/1pt,0.3cm-0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
path
let p1=($(X)-(O)$),p2=($(intersection-2)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-2) -- + (0.3,0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-2) -- + (0.3*n2*1cm/1pt,-0.3) coordinate(aux2)
(intersection-2) -- + (0.3cm+0.3*n2*1cm/1pt,-0.3cm+0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
endtikzpicture
enddocument
There are some weird effects when one computes intersections of some paths defined inside an axis outside the axis, so I'm stuck with an ugly solution in which the factors 1.1
and 1.13
are hard coded. If it were not for these effects, one could have a much nicer solution which does not rely on any computations of the user...
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarycalc,intersections
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
begindocument
begintikzpicture
beginaxis[
legend pos=outer north east,
axis lines = center,
axis equal,
xticklabel style = font=tiny,
yticklabel style = font=tiny,
xlabel = $x$,
ylabel = $y$,
clip=false,
legend style=cells=align=left,
legend cell align=left
]
addplot[thick,samples=80,name path=A] (-3)*x/abs(x)^(2/3); % From https://tex.stackexchange.com/a/144463/152550
addplot[thick,samples=80,name path=B] (sqrt(16/3)*cos((x) r), sqrt(16)*sin((x) r));
path[name intersections=of=A and B] (0,0) coordinate (O) (1,0)
coordinate(X);
endaxis
path
let p1=($(X)-(O)$),p2=($(intersection-1)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-1) -- + (-0.3,-0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-1) -- + (-0.3*n2*1cm/1pt,0.3) coordinate(aux2)
(intersection-1) -- + (-0.3cm-0.3*n2*1cm/1pt,0.3cm-0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
path
let p1=($(X)-(O)$),p2=($(intersection-2)-(O)$),n1=x2/x1,
n2=-1/(pow(abs(n1),2/3)) in
(intersection-2) -- + (0.3,0.3*n2*1cm/1pt) coordinate(aux1)
(intersection-2) -- + (0.3*n2*1cm/1pt,-0.3) coordinate(aux2)
(intersection-2) -- + (0.3cm+0.3*n2*1cm/1pt,-0.3cm+0.3*n2*1cm/1pt) coordinate(aux3);
path[draw=red] (aux3) -- ($(aux3)+1.13*($(aux2)-(aux3)$)$);
path[draw=red] (aux3) -- ($(aux3)+1.1*($(aux1)-(aux3)$)$);
endtikzpicture
enddocument
edited 28 mins ago
answered 37 mins ago
marmot
68.8k476148
68.8k476148
I just noted that there seems something really weird going on with the pgfplotslibrary fillbetween.
â marmot
28 mins ago
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
@manooooh According to what I find here, we are all in trouble. ;-) More seriously, at this point Ruixi's nice answer is clearly superior. (On the other hand, if it were not for these unexpected problems, there would be a nice simple trick that would avoid the necessity to compute things by hand. However, I have no clue how to fix these problems.) In order to ploty=x^1/3
, you only need to drop the factor3
, i.e. plot-x/abs(x)^(2/3);
.
â marmot
2 mins ago
add a comment |Â
I just noted that there seems something really weird going on with the pgfplotslibrary fillbetween.
â marmot
28 mins ago
Am I in problems if you have to change the function toy^3=x
? I plot it and there's is no nice display...
â manooooh
7 mins ago
@manooooh According to what I find here, we are all in trouble. ;-) More seriously, at this point Ruixi's nice answer is clearly superior. (On the other hand, if it were not for these unexpected problems, there would be a nice simple trick that would avoid the necessity to compute things by hand. However, I have no clue how to fix these problems.) In order to ploty=x^1/3
, you only need to drop the factor3
, i.e. plot-x/abs(x)^(2/3);
.
â marmot
2 mins ago
I just noted that there seems something really weird going on with the pgfplotslibrary fillbetween.
â marmot
28 mins ago
I just noted that there seems something really weird going on with the pgfplotslibrary fillbetween.
â marmot
28 mins ago
Am I in problems if you have to change the function to
y^3=x
? I plot it and there's is no nice display...â manooooh
7 mins ago
Am I in problems if you have to change the function to
y^3=x
? I plot it and there's is no nice display...â manooooh
7 mins ago
@manooooh According to what I find here, we are all in trouble. ;-) More seriously, at this point Ruixi's nice answer is clearly superior. (On the other hand, if it were not for these unexpected problems, there would be a nice simple trick that would avoid the necessity to compute things by hand. However, I have no clue how to fix these problems.) In order to plot
y=x^1/3
, you only need to drop the factor 3
, i.e. plot -x/abs(x)^(2/3);
.â marmot
2 mins ago
@manooooh According to what I find here, we are all in trouble. ;-) More seriously, at this point Ruixi's nice answer is clearly superior. (On the other hand, if it were not for these unexpected problems, there would be a nice simple trick that would avoid the necessity to compute things by hand. However, I have no clue how to fix these problems.) In order to plot
y=x^1/3
, you only need to drop the factor 3
, i.e. plot -x/abs(x)^(2/3);
.â marmot
2 mins ago
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f457000%2fhow-to-draw-90-degree-angles-in-intersection-points-using-tikzpicture-environmen%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
That's an interesting question, +1. Will look at it when I'm back in our burrow unless someone else answered it in between.
â marmot
2 hours ago
@marmot the others are not? Hahahaha. Ok, enjoy.
â manooooh
1 hour ago
Maybe this awesome Skillmon's answer help?
â manooooh
1 hour ago
2
I donâÂÂt think the first function is
y^3 = x
â¦â Ruixi Zhang
1 hour ago
1
@RuixiZhang I agree with you. manooooh, do you want your function, which is
y=-3*x/|x|^2/3
, ory^3=x
?â marmot
1 hour ago