How to draw 90 degree angles in intersection points using tikzpicture environment

The name of the pictureThe name of the pictureThe name of the pictureClash 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


Plot



I would like to draw a 90 degree angles in the two interception points:



90 degree angles



The functions are y^3 = x and x^2/(16/3)+y^2/(16)=1.



Thanks!










share|improve this question

















  • 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, or y^3=x?
    – marmot
    1 hour ago















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


Plot



I would like to draw a 90 degree angles in the two interception points:



90 degree angles



The functions are y^3 = x and x^2/(16/3)+y^2/(16)=1.



Thanks!










share|improve this question

















  • 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, or y^3=x?
    – marmot
    1 hour ago













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


Plot



I would like to draw a 90 degree angles in the two interception points:



90 degree angles



The functions are y^3 = x and x^2/(16/3)+y^2/(16)=1.



Thanks!










share|improve this question













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


Plot



I would like to draw a 90 degree angles in the two interception points:



90 degree angles



The functions are y^3 = x and x^2/(16/3)+y^2/(16)=1.



Thanks!







tikz-pgf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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, or y^3=x?
    – marmot
    1 hour ago













  • 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, or y^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











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


right angles






share|improve this answer






















  • 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

















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


enter image description here






share|improve this answer






















  • 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










  • @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










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: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
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%2f457000%2fhow-to-draw-90-degree-angles-in-intersection-points-using-tikzpicture-environmen%23new-answer', 'question_page');

);

Post as a guest






























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


right angles






share|improve this answer






















  • 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














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


right angles






share|improve this answer






















  • 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












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


right angles






share|improve this answer














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


right angles







share|improve this answer














share|improve this answer



share|improve this answer








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















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










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


enter image description here






share|improve this answer






















  • 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










  • @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














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


enter image description here






share|improve this answer






















  • 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










  • @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












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


enter image description here






share|improve this answer














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


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








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
















  • 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










  • @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















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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Comments

Popular posts from this blog

Long meetings (6-7 hours a day): Being “babysat” by supervisor

Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

Confectionery