A hyperbolic triangle embedded in a saddle-shaped surface
Clash Royale CLAN TAG#URR8PPP
up vote
8
down vote
favorite
This is the diagram I would like to recreate. (from https://en.wikipedia.org/wiki/Hyperbolic_triangle)
From Is there any easy way to draw a ruled surface like a hyperbolic paraboloid in TikZ?, I found a way to draw the saddle-shaped surface.
Is there a way to draw the triangle on it? And get the colours/transparency like the picture?
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis
addplot3 [surf,shader=flat,draw=black] x^2-y^2;
endaxis
endtikzpicture
enddocument
tikz-pgf pgfplots 3d
add a comment |Â
up vote
8
down vote
favorite
This is the diagram I would like to recreate. (from https://en.wikipedia.org/wiki/Hyperbolic_triangle)
From Is there any easy way to draw a ruled surface like a hyperbolic paraboloid in TikZ?, I found a way to draw the saddle-shaped surface.
Is there a way to draw the triangle on it? And get the colours/transparency like the picture?
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis
addplot3 [surf,shader=flat,draw=black] x^2-y^2;
endaxis
endtikzpicture
enddocument
tikz-pgf pgfplots 3d
Welcome to TeX.SX! It seems that you are asking for a mathematical function for the hyperbolic triangle. If this is the case then this is the wrong page to ask that kind of question. If you would have such a function you should already have an idea of how to draw it. We could then help to fine-tune the plots so they differ from each other.
â Stefan Pinnow
Aug 16 at 17:57
Welcome, you might want to have a look at tex.stackexchange.com/questions/108915/â¦
â BambOo
Aug 16 at 17:59
add a comment |Â
up vote
8
down vote
favorite
up vote
8
down vote
favorite
This is the diagram I would like to recreate. (from https://en.wikipedia.org/wiki/Hyperbolic_triangle)
From Is there any easy way to draw a ruled surface like a hyperbolic paraboloid in TikZ?, I found a way to draw the saddle-shaped surface.
Is there a way to draw the triangle on it? And get the colours/transparency like the picture?
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis
addplot3 [surf,shader=flat,draw=black] x^2-y^2;
endaxis
endtikzpicture
enddocument
tikz-pgf pgfplots 3d
This is the diagram I would like to recreate. (from https://en.wikipedia.org/wiki/Hyperbolic_triangle)
From Is there any easy way to draw a ruled surface like a hyperbolic paraboloid in TikZ?, I found a way to draw the saddle-shaped surface.
Is there a way to draw the triangle on it? And get the colours/transparency like the picture?
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis
addplot3 [surf,shader=flat,draw=black] x^2-y^2;
endaxis
endtikzpicture
enddocument
tikz-pgf pgfplots 3d
tikz-pgf pgfplots 3d
edited Aug 16 at 18:08
asked Aug 16 at 17:49
Tony
655
655
Welcome to TeX.SX! It seems that you are asking for a mathematical function for the hyperbolic triangle. If this is the case then this is the wrong page to ask that kind of question. If you would have such a function you should already have an idea of how to draw it. We could then help to fine-tune the plots so they differ from each other.
â Stefan Pinnow
Aug 16 at 17:57
Welcome, you might want to have a look at tex.stackexchange.com/questions/108915/â¦
â BambOo
Aug 16 at 17:59
add a comment |Â
Welcome to TeX.SX! It seems that you are asking for a mathematical function for the hyperbolic triangle. If this is the case then this is the wrong page to ask that kind of question. If you would have such a function you should already have an idea of how to draw it. We could then help to fine-tune the plots so they differ from each other.
â Stefan Pinnow
Aug 16 at 17:57
Welcome, you might want to have a look at tex.stackexchange.com/questions/108915/â¦
â BambOo
Aug 16 at 17:59
Welcome to TeX.SX! It seems that you are asking for a mathematical function for the hyperbolic triangle. If this is the case then this is the wrong page to ask that kind of question. If you would have such a function you should already have an idea of how to draw it. We could then help to fine-tune the plots so they differ from each other.
â Stefan Pinnow
Aug 16 at 17:57
Welcome to TeX.SX! It seems that you are asking for a mathematical function for the hyperbolic triangle. If this is the case then this is the wrong page to ask that kind of question. If you would have such a function you should already have an idea of how to draw it. We could then help to fine-tune the plots so they differ from each other.
â Stefan Pinnow
Aug 16 at 17:57
Welcome, you might want to have a look at tex.stackexchange.com/questions/108915/â¦
â BambOo
Aug 16 at 17:59
Welcome, you might want to have a look at tex.stackexchange.com/questions/108915/â¦
â BambOo
Aug 16 at 17:59
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
8
down vote
accepted
In principle it is very simple: draw a parametric curve on the manifold and fill it.
documentclassarticle
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
tikzsetdeclare function=%
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
begintikzpicture
beginaxis[view=-2045,axis lines=none,colormap/cool]
addplot3 [surf,shader=interp,draw=black,domain=-1.2:1.2,domain y=-1.5:1.5,opacity=0.6] x^2-y^2;
addplot3 [domain=-2:2,samples=81,smooth,fill=green,fill opacity=0.1] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endaxis
endtikzpicture
enddocument
begintikzpicture
beginaxis[samples=41]
addplot[domain=-2:2] fx(x);
addplot[blue,domain=-2:2] fy(x);
endaxis
endtikzpicture
UPDATE: Tried to accommodate the requests in your comment. Please note also that the boundaries of the triangle are not pixelated on the pdf, the pixelation comes from the conversion to png.
ADDENDUM: Transparent plot with tikz-3dplot
. Note, however, that the top contour is guessed. You can not easily adjust the view angles here without doing some math before.
documentclass[tikz,border=3.14mm]standalone
usepackagetikz-3dplot
usetikzlibraryshadings
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
tikzsetdeclare function=%
f(x,y)=x*x-y*y;
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
usetikzlibrarybackgrounds,calc,positioning
begindocument
pgfmathsetmacroxmax1
pgfmathsetmacroymax1.5
foreach X in 190
tdplotsetmaincoords130X
begintikzpicture[font=sffamily,xscale=4,yscale=2]
%node at (0,0) X;
beginscope[tdplot_main_coords,samples=61,smooth,variable=x]
draw[name path=boundary] plot[domain=-ymax:ymax] (-xmax,x,f(-xmax,x))
-- plot[domain=-xmax:xmax] (x,ymax,f(x,ymax)
-- plot[domain=ymax:-ymax] (xmax,x,f(xmax,x))
-- plot[domain=xmax:-xmax] (x,-ymax,f(x,-ymax));
tikzsetdeclare function=ytop(x)=0.35-0.2*(x/xmax);
draw[name path=top] plot[domain=-xmax:xmax] (x,ytop(x),f(x,ytop(x)));
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=back,
intersection segments=
of=top and boundary,
sequence=B2--A2[reverse]
];
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=front,
intersection segments=
of=top and boundary,
sequence=B3--B0--A1--A2
];
shadedraw[thick,top color=green!20,bottom color=green!40,opacity=0.6]
plot[variable=x,domain=-2:2,samples=81] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endscope
endtikzpicture
enddocument
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
8
down vote
accepted
In principle it is very simple: draw a parametric curve on the manifold and fill it.
documentclassarticle
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
tikzsetdeclare function=%
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
begintikzpicture
beginaxis[view=-2045,axis lines=none,colormap/cool]
addplot3 [surf,shader=interp,draw=black,domain=-1.2:1.2,domain y=-1.5:1.5,opacity=0.6] x^2-y^2;
addplot3 [domain=-2:2,samples=81,smooth,fill=green,fill opacity=0.1] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endaxis
endtikzpicture
enddocument
begintikzpicture
beginaxis[samples=41]
addplot[domain=-2:2] fx(x);
addplot[blue,domain=-2:2] fy(x);
endaxis
endtikzpicture
UPDATE: Tried to accommodate the requests in your comment. Please note also that the boundaries of the triangle are not pixelated on the pdf, the pixelation comes from the conversion to png.
ADDENDUM: Transparent plot with tikz-3dplot
. Note, however, that the top contour is guessed. You can not easily adjust the view angles here without doing some math before.
documentclass[tikz,border=3.14mm]standalone
usepackagetikz-3dplot
usetikzlibraryshadings
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
tikzsetdeclare function=%
f(x,y)=x*x-y*y;
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
usetikzlibrarybackgrounds,calc,positioning
begindocument
pgfmathsetmacroxmax1
pgfmathsetmacroymax1.5
foreach X in 190
tdplotsetmaincoords130X
begintikzpicture[font=sffamily,xscale=4,yscale=2]
%node at (0,0) X;
beginscope[tdplot_main_coords,samples=61,smooth,variable=x]
draw[name path=boundary] plot[domain=-ymax:ymax] (-xmax,x,f(-xmax,x))
-- plot[domain=-xmax:xmax] (x,ymax,f(x,ymax)
-- plot[domain=ymax:-ymax] (xmax,x,f(xmax,x))
-- plot[domain=xmax:-xmax] (x,-ymax,f(x,-ymax));
tikzsetdeclare function=ytop(x)=0.35-0.2*(x/xmax);
draw[name path=top] plot[domain=-xmax:xmax] (x,ytop(x),f(x,ytop(x)));
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=back,
intersection segments=
of=top and boundary,
sequence=B2--A2[reverse]
];
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=front,
intersection segments=
of=top and boundary,
sequence=B3--B0--A1--A2
];
shadedraw[thick,top color=green!20,bottom color=green!40,opacity=0.6]
plot[variable=x,domain=-2:2,samples=81] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
8
down vote
accepted
In principle it is very simple: draw a parametric curve on the manifold and fill it.
documentclassarticle
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
tikzsetdeclare function=%
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
begintikzpicture
beginaxis[view=-2045,axis lines=none,colormap/cool]
addplot3 [surf,shader=interp,draw=black,domain=-1.2:1.2,domain y=-1.5:1.5,opacity=0.6] x^2-y^2;
addplot3 [domain=-2:2,samples=81,smooth,fill=green,fill opacity=0.1] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endaxis
endtikzpicture
enddocument
begintikzpicture
beginaxis[samples=41]
addplot[domain=-2:2] fx(x);
addplot[blue,domain=-2:2] fy(x);
endaxis
endtikzpicture
UPDATE: Tried to accommodate the requests in your comment. Please note also that the boundaries of the triangle are not pixelated on the pdf, the pixelation comes from the conversion to png.
ADDENDUM: Transparent plot with tikz-3dplot
. Note, however, that the top contour is guessed. You can not easily adjust the view angles here without doing some math before.
documentclass[tikz,border=3.14mm]standalone
usepackagetikz-3dplot
usetikzlibraryshadings
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
tikzsetdeclare function=%
f(x,y)=x*x-y*y;
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
usetikzlibrarybackgrounds,calc,positioning
begindocument
pgfmathsetmacroxmax1
pgfmathsetmacroymax1.5
foreach X in 190
tdplotsetmaincoords130X
begintikzpicture[font=sffamily,xscale=4,yscale=2]
%node at (0,0) X;
beginscope[tdplot_main_coords,samples=61,smooth,variable=x]
draw[name path=boundary] plot[domain=-ymax:ymax] (-xmax,x,f(-xmax,x))
-- plot[domain=-xmax:xmax] (x,ymax,f(x,ymax)
-- plot[domain=ymax:-ymax] (xmax,x,f(xmax,x))
-- plot[domain=xmax:-xmax] (x,-ymax,f(x,-ymax));
tikzsetdeclare function=ytop(x)=0.35-0.2*(x/xmax);
draw[name path=top] plot[domain=-xmax:xmax] (x,ytop(x),f(x,ytop(x)));
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=back,
intersection segments=
of=top and boundary,
sequence=B2--A2[reverse]
];
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=front,
intersection segments=
of=top and boundary,
sequence=B3--B0--A1--A2
];
shadedraw[thick,top color=green!20,bottom color=green!40,opacity=0.6]
plot[variable=x,domain=-2:2,samples=81] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
8
down vote
accepted
up vote
8
down vote
accepted
In principle it is very simple: draw a parametric curve on the manifold and fill it.
documentclassarticle
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
tikzsetdeclare function=%
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
begintikzpicture
beginaxis[view=-2045,axis lines=none,colormap/cool]
addplot3 [surf,shader=interp,draw=black,domain=-1.2:1.2,domain y=-1.5:1.5,opacity=0.6] x^2-y^2;
addplot3 [domain=-2:2,samples=81,smooth,fill=green,fill opacity=0.1] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endaxis
endtikzpicture
enddocument
begintikzpicture
beginaxis[samples=41]
addplot[domain=-2:2] fx(x);
addplot[blue,domain=-2:2] fy(x);
endaxis
endtikzpicture
UPDATE: Tried to accommodate the requests in your comment. Please note also that the boundaries of the triangle are not pixelated on the pdf, the pixelation comes from the conversion to png.
ADDENDUM: Transparent plot with tikz-3dplot
. Note, however, that the top contour is guessed. You can not easily adjust the view angles here without doing some math before.
documentclass[tikz,border=3.14mm]standalone
usepackagetikz-3dplot
usetikzlibraryshadings
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
tikzsetdeclare function=%
f(x,y)=x*x-y*y;
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
usetikzlibrarybackgrounds,calc,positioning
begindocument
pgfmathsetmacroxmax1
pgfmathsetmacroymax1.5
foreach X in 190
tdplotsetmaincoords130X
begintikzpicture[font=sffamily,xscale=4,yscale=2]
%node at (0,0) X;
beginscope[tdplot_main_coords,samples=61,smooth,variable=x]
draw[name path=boundary] plot[domain=-ymax:ymax] (-xmax,x,f(-xmax,x))
-- plot[domain=-xmax:xmax] (x,ymax,f(x,ymax)
-- plot[domain=ymax:-ymax] (xmax,x,f(xmax,x))
-- plot[domain=xmax:-xmax] (x,-ymax,f(x,-ymax));
tikzsetdeclare function=ytop(x)=0.35-0.2*(x/xmax);
draw[name path=top] plot[domain=-xmax:xmax] (x,ytop(x),f(x,ytop(x)));
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=back,
intersection segments=
of=top and boundary,
sequence=B2--A2[reverse]
];
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=front,
intersection segments=
of=top and boundary,
sequence=B3--B0--A1--A2
];
shadedraw[thick,top color=green!20,bottom color=green!40,opacity=0.6]
plot[variable=x,domain=-2:2,samples=81] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endscope
endtikzpicture
enddocument
In principle it is very simple: draw a parametric curve on the manifold and fill it.
documentclassarticle
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
tikzsetdeclare function=%
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
begintikzpicture
beginaxis[view=-2045,axis lines=none,colormap/cool]
addplot3 [surf,shader=interp,draw=black,domain=-1.2:1.2,domain y=-1.5:1.5,opacity=0.6] x^2-y^2;
addplot3 [domain=-2:2,samples=81,smooth,fill=green,fill opacity=0.1] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endaxis
endtikzpicture
enddocument
begintikzpicture
beginaxis[samples=41]
addplot[domain=-2:2] fx(x);
addplot[blue,domain=-2:2] fy(x);
endaxis
endtikzpicture
UPDATE: Tried to accommodate the requests in your comment. Please note also that the boundaries of the triangle are not pixelated on the pdf, the pixelation comes from the conversion to png.
ADDENDUM: Transparent plot with tikz-3dplot
. Note, however, that the top contour is guessed. You can not easily adjust the view angles here without doing some math before.
documentclass[tikz,border=3.14mm]standalone
usepackagetikz-3dplot
usetikzlibraryshadings
usepackagepgfplots
pgfplotssetcompat=1.16
usepgfplotslibraryfillbetween
tikzsetdeclare function=%
f(x,y)=x*x-y*y;
fx(x)=ifthenelse(x<0,0.75*(x+1),0.75*(-x+1));
fy(y)=ifthenelse(y<0,0,ifthenelse(y>1,-2+y,-y));
usetikzlibrarybackgrounds,calc,positioning
begindocument
pgfmathsetmacroxmax1
pgfmathsetmacroymax1.5
foreach X in 190
tdplotsetmaincoords130X
begintikzpicture[font=sffamily,xscale=4,yscale=2]
%node at (0,0) X;
beginscope[tdplot_main_coords,samples=61,smooth,variable=x]
draw[name path=boundary] plot[domain=-ymax:ymax] (-xmax,x,f(-xmax,x))
-- plot[domain=-xmax:xmax] (x,ymax,f(x,ymax)
-- plot[domain=ymax:-ymax] (xmax,x,f(xmax,x))
-- plot[domain=xmax:-xmax] (x,-ymax,f(x,-ymax));
tikzsetdeclare function=ytop(x)=0.35-0.2*(x/xmax);
draw[name path=top] plot[domain=-xmax:xmax] (x,ytop(x),f(x,ytop(x)));
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=back,
intersection segments=
of=top and boundary,
sequence=B2--A2[reverse]
];
shade [%draw,blue,ultra thick,
top color=blue!80,bottom color=blue,opacity=0.3,
name path=front,
intersection segments=
of=top and boundary,
sequence=B3--B0--A1--A2
];
shadedraw[thick,top color=green!20,bottom color=green!40,opacity=0.6]
plot[variable=x,domain=-2:2,samples=81] (fx(x),fy(x),fx(x)^2-fy(x)^2);
endscope
endtikzpicture
enddocument
edited Aug 16 at 19:47
answered Aug 16 at 18:18
marmot
58.6k463126
58.6k463126
add a comment |Â
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%2f446325%2fa-hyperbolic-triangle-embedded-in-a-saddle-shaped-surface%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
Welcome to TeX.SX! It seems that you are asking for a mathematical function for the hyperbolic triangle. If this is the case then this is the wrong page to ask that kind of question. If you would have such a function you should already have an idea of how to draw it. We could then help to fine-tune the plots so they differ from each other.
â Stefan Pinnow
Aug 16 at 17:57
Welcome, you might want to have a look at tex.stackexchange.com/questions/108915/â¦
â BambOo
Aug 16 at 17:59