How to plot two surfaces and the intersection curve?
I want to draw the intersection line (curve line) of two functions x^2+y^2+z^2=4
(Zmin= 0
) and x^2+y^2=2y
in the same coordinate system as follows.
I have read pst-3dplot
and pst-solides3d
but I can only draw the following.
MWE
documentclass[12pt,pstricks,border=15pt]{standalone}
usepackage{pst-3dplot,pst-solides3d}
begin{document}
begin{pspicture}(-5,-5)(5,5)
pstThreeDCoor
psImplicitSurface[XMinMax=-2.0 2.0 0.15,YMinMax=-2.0 2.0 0.15,ZMinMax= 0 2.25 0.15,algebraic,ImplFunction=x^2+y^2+z^2-4]%
end{pspicture}
end{document}
Question
How to plot two surfaces and the intersection curve?
pstricks pst-solides3d pst-3dplot
add a comment |
I want to draw the intersection line (curve line) of two functions x^2+y^2+z^2=4
(Zmin= 0
) and x^2+y^2=2y
in the same coordinate system as follows.
I have read pst-3dplot
and pst-solides3d
but I can only draw the following.
MWE
documentclass[12pt,pstricks,border=15pt]{standalone}
usepackage{pst-3dplot,pst-solides3d}
begin{document}
begin{pspicture}(-5,-5)(5,5)
pstThreeDCoor
psImplicitSurface[XMinMax=-2.0 2.0 0.15,YMinMax=-2.0 2.0 0.15,ZMinMax= 0 2.25 0.15,algebraic,ImplFunction=x^2+y^2+z^2-4]%
end{pspicture}
end{document}
Question
How to plot two surfaces and the intersection curve?
pstricks pst-solides3d pst-3dplot
add a comment |
I want to draw the intersection line (curve line) of two functions x^2+y^2+z^2=4
(Zmin= 0
) and x^2+y^2=2y
in the same coordinate system as follows.
I have read pst-3dplot
and pst-solides3d
but I can only draw the following.
MWE
documentclass[12pt,pstricks,border=15pt]{standalone}
usepackage{pst-3dplot,pst-solides3d}
begin{document}
begin{pspicture}(-5,-5)(5,5)
pstThreeDCoor
psImplicitSurface[XMinMax=-2.0 2.0 0.15,YMinMax=-2.0 2.0 0.15,ZMinMax= 0 2.25 0.15,algebraic,ImplFunction=x^2+y^2+z^2-4]%
end{pspicture}
end{document}
Question
How to plot two surfaces and the intersection curve?
pstricks pst-solides3d pst-3dplot
I want to draw the intersection line (curve line) of two functions x^2+y^2+z^2=4
(Zmin= 0
) and x^2+y^2=2y
in the same coordinate system as follows.
I have read pst-3dplot
and pst-solides3d
but I can only draw the following.
MWE
documentclass[12pt,pstricks,border=15pt]{standalone}
usepackage{pst-3dplot,pst-solides3d}
begin{document}
begin{pspicture}(-5,-5)(5,5)
pstThreeDCoor
psImplicitSurface[XMinMax=-2.0 2.0 0.15,YMinMax=-2.0 2.0 0.15,ZMinMax= 0 2.25 0.15,algebraic,ImplFunction=x^2+y^2+z^2-4]%
end{pspicture}
end{document}
Question
How to plot two surfaces and the intersection curve?
pstricks pst-solides3d pst-3dplot
pstricks pst-solides3d pst-3dplot
edited yesterday
God Must Be Crazy
5,81711039
5,81711039
asked yesterday
chishimotojichishimotoji
926317
926317
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
What about:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
psset{solidmemory,opacity=0.75}
axesIIID(0,0,0)(3,3,3)
psSolid[%
object=cylindrecreux,
r=1,
h=2,
ngrid=36 36,
fillcolor=red,
incolor=orange,
action=none,
name=A1](0,1,0)%
psSolid[%
object=calottesphere,
r=2,
ngrid=36 36,
action=none,
name=B1]
psSolid[object=fusion,
base=A1 B1,
action=draw**]
composeSolid
% Equation of "Window of Viviani"
defFunction[algebraic]{g}(t)%
{sin(t)}%
{cos(t)+1}%
{2*sin(1/2*t)}
psSolid[%
object=courbe,
range=0 6.28,
fillcolor=yellow,
linewidth=0,
function=g,
name=C1,
opacity=0.9,
r=0.0125]
end{pspicture}
end{document}
Your answer is best selection to show, not to print! That is my thinking.
– chishimotoji
5 hours ago
add a comment |
A quick TikZ version for comparison.
documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz,tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{120}
begin{tikzpicture}[tdplot_main_coords,scale=3,declare function={
myz(x)=sqrt((1-sin(x))/2);
mytheta(x)=atan(cot(tdplotmaintheta)/(cos(tdplotmainphi)*cos(x)
-sin(tdplotmainphi)*sin(x)));}]
draw[-latex] (-2,0,0) -- (2,0,0) node[pos=1.05]{$x$};
draw[-latex] (0,0,0) coordinate(O) -- (0,2,0) node[pos=1.1]{$y$};
draw[-latex] (0,0,0) -- (0,0,2) node[pos=1.1]{$z$};
begin{scope}
clip plot[variable=x,domain=tdplotmainphi-180:90,smooth]
({cos(x)},{sin(x)},0)--
plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})--
plot[variable=x,domain=90:tdplotmainphi,smooth] ({cos(x)},{sin(x)},0) -- ++ (0,0,2) --
({cos(tdplotmainphi-180)},{sin(tdplotmainphi-180)},2) -- cycle;
draw[ball color=gray,opacity=0.3,tdplot_screen_coords] (O) circle (1);
end{scope}
draw[top color=gray,bottom color=gray!30,middle color=gray!20,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)});
shade[top color=gray!50,bottom color=gray!50!black,middle color=gray,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})
--plot[variable=x,domain=-64:90,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0);
draw[dashed] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0) --
({0.5*cos(-64)},{0.5+0.5*sin(-64)},{myz(-64)});
end{tikzpicture}
end{document}
4
+1 Beautiful picture!
– chishimotoji
yesterday
1
@GodMustBeCrazy I imagined it was just a matter of time :-). We still need the dotted part. However spectacular everything.
– Sebastiano
23 hours ago
1
+1 for spending your space, time, energy for drawing this that has become realistic.
– God Must Be Crazy
22 hours ago
1
Your answer is best selection to print on the paper!
– chishimotoji
5 hours ago
add a comment |
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}[solidmemory](-4,-2)(6,6)
psset{viewpoint=30 10 20 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[
object=calottesphere,r=2,ngrid=16 18,opacity=0.4,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0]
end{pspicture}
end{document}
documentclass{article}
usepackage{pst-solides3d}
usepackage[a4paper,showframe]{geometry}
begin{document}
begin{center}
begin{pspicture}[solidmemory](-5,-2)(6,6)
psset{viewpoint=30 80 25 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[object=calottesphere,r=2,ngrid=64 72,action=none,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0,name=sp]
psSolid[object=cylindrecreux,h=2.5,r=1,fillcolor=white,action=none,
ngrid=30 72,incolor=green!50,name=py](0,1,0)
psSolid[object=fusion,base=sp py,opacity=0.8,grid,action=draw**]
defFunction[algebraic]{g}(t){sin(t)}{cos(t)+1}{2*sin(1/2*t)}
psset{object=courbe,fillcolor=red,linecolor=red,
linewidth=0.1,function=g,r=0,action=draw**}
psSolid[range=0 1.9]psSolid[range=2.6 3.9]psSolid[range=5 TwoPi]
end{pspicture}
end{center}
end{document}
and printed on A4:
Why don't we plot of function directly x^2+y^2+z^2=4? :-)
– chishimotoji
yesterday
Where is the sense of plotting a sphere with a function? It is already internally defined.
– Herbert
yesterday
Where are the previous questions? :-)). What do you think if we print it on the A4 paper? Truly, marmot's answer is best selection to print!
– chishimotoji
5 hours ago
no, TikZ cannot really handle 3d sufaces. And if you want to print in grayscales then use gray as color. Where is the problem??
– Herbert
5 hours ago
Can you illustrate it if it is printed on the A4 paper?(necessary). I do not your picture can be printed on the A4 paper clearly. P/S: I try to find on PSTricks site but there are no any examples about several things at least for me.
– chishimotoji
4 hours ago
|
show 4 more comments
Hemisphere as a parameterized surface:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
axesIIID(0,0,0)(3,3,3)
defFunction[algebraic]{hemisphere}(u,v)
{2*cos(u)*sin(v)}{2*sin(u)*sin(v)}{2*cos(v)}
psSolid[object=surfaceparametree,
base=0 2 pi mul 0 pi 2 div,
fillcolor=red,
opacity=0.7,
function=hemisphere,
linewidth=0.5pslinewidth,
ngrid=36 36]%
end{pspicture}
end{document}
add a comment |
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f468797%2fhow-to-plot-two-surfaces-and-the-intersection-curve%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
What about:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
psset{solidmemory,opacity=0.75}
axesIIID(0,0,0)(3,3,3)
psSolid[%
object=cylindrecreux,
r=1,
h=2,
ngrid=36 36,
fillcolor=red,
incolor=orange,
action=none,
name=A1](0,1,0)%
psSolid[%
object=calottesphere,
r=2,
ngrid=36 36,
action=none,
name=B1]
psSolid[object=fusion,
base=A1 B1,
action=draw**]
composeSolid
% Equation of "Window of Viviani"
defFunction[algebraic]{g}(t)%
{sin(t)}%
{cos(t)+1}%
{2*sin(1/2*t)}
psSolid[%
object=courbe,
range=0 6.28,
fillcolor=yellow,
linewidth=0,
function=g,
name=C1,
opacity=0.9,
r=0.0125]
end{pspicture}
end{document}
Your answer is best selection to show, not to print! That is my thinking.
– chishimotoji
5 hours ago
add a comment |
What about:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
psset{solidmemory,opacity=0.75}
axesIIID(0,0,0)(3,3,3)
psSolid[%
object=cylindrecreux,
r=1,
h=2,
ngrid=36 36,
fillcolor=red,
incolor=orange,
action=none,
name=A1](0,1,0)%
psSolid[%
object=calottesphere,
r=2,
ngrid=36 36,
action=none,
name=B1]
psSolid[object=fusion,
base=A1 B1,
action=draw**]
composeSolid
% Equation of "Window of Viviani"
defFunction[algebraic]{g}(t)%
{sin(t)}%
{cos(t)+1}%
{2*sin(1/2*t)}
psSolid[%
object=courbe,
range=0 6.28,
fillcolor=yellow,
linewidth=0,
function=g,
name=C1,
opacity=0.9,
r=0.0125]
end{pspicture}
end{document}
Your answer is best selection to show, not to print! That is my thinking.
– chishimotoji
5 hours ago
add a comment |
What about:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
psset{solidmemory,opacity=0.75}
axesIIID(0,0,0)(3,3,3)
psSolid[%
object=cylindrecreux,
r=1,
h=2,
ngrid=36 36,
fillcolor=red,
incolor=orange,
action=none,
name=A1](0,1,0)%
psSolid[%
object=calottesphere,
r=2,
ngrid=36 36,
action=none,
name=B1]
psSolid[object=fusion,
base=A1 B1,
action=draw**]
composeSolid
% Equation of "Window of Viviani"
defFunction[algebraic]{g}(t)%
{sin(t)}%
{cos(t)+1}%
{2*sin(1/2*t)}
psSolid[%
object=courbe,
range=0 6.28,
fillcolor=yellow,
linewidth=0,
function=g,
name=C1,
opacity=0.9,
r=0.0125]
end{pspicture}
end{document}
What about:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
psset{solidmemory,opacity=0.75}
axesIIID(0,0,0)(3,3,3)
psSolid[%
object=cylindrecreux,
r=1,
h=2,
ngrid=36 36,
fillcolor=red,
incolor=orange,
action=none,
name=A1](0,1,0)%
psSolid[%
object=calottesphere,
r=2,
ngrid=36 36,
action=none,
name=B1]
psSolid[object=fusion,
base=A1 B1,
action=draw**]
composeSolid
% Equation of "Window of Viviani"
defFunction[algebraic]{g}(t)%
{sin(t)}%
{cos(t)+1}%
{2*sin(1/2*t)}
psSolid[%
object=courbe,
range=0 6.28,
fillcolor=yellow,
linewidth=0,
function=g,
name=C1,
opacity=0.9,
r=0.0125]
end{pspicture}
end{document}
edited yesterday
answered yesterday
Jürgen GJürgen G
1,060214
1,060214
Your answer is best selection to show, not to print! That is my thinking.
– chishimotoji
5 hours ago
add a comment |
Your answer is best selection to show, not to print! That is my thinking.
– chishimotoji
5 hours ago
Your answer is best selection to show, not to print! That is my thinking.
– chishimotoji
5 hours ago
Your answer is best selection to show, not to print! That is my thinking.
– chishimotoji
5 hours ago
add a comment |
A quick TikZ version for comparison.
documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz,tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{120}
begin{tikzpicture}[tdplot_main_coords,scale=3,declare function={
myz(x)=sqrt((1-sin(x))/2);
mytheta(x)=atan(cot(tdplotmaintheta)/(cos(tdplotmainphi)*cos(x)
-sin(tdplotmainphi)*sin(x)));}]
draw[-latex] (-2,0,0) -- (2,0,0) node[pos=1.05]{$x$};
draw[-latex] (0,0,0) coordinate(O) -- (0,2,0) node[pos=1.1]{$y$};
draw[-latex] (0,0,0) -- (0,0,2) node[pos=1.1]{$z$};
begin{scope}
clip plot[variable=x,domain=tdplotmainphi-180:90,smooth]
({cos(x)},{sin(x)},0)--
plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})--
plot[variable=x,domain=90:tdplotmainphi,smooth] ({cos(x)},{sin(x)},0) -- ++ (0,0,2) --
({cos(tdplotmainphi-180)},{sin(tdplotmainphi-180)},2) -- cycle;
draw[ball color=gray,opacity=0.3,tdplot_screen_coords] (O) circle (1);
end{scope}
draw[top color=gray,bottom color=gray!30,middle color=gray!20,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)});
shade[top color=gray!50,bottom color=gray!50!black,middle color=gray,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})
--plot[variable=x,domain=-64:90,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0);
draw[dashed] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0) --
({0.5*cos(-64)},{0.5+0.5*sin(-64)},{myz(-64)});
end{tikzpicture}
end{document}
4
+1 Beautiful picture!
– chishimotoji
yesterday
1
@GodMustBeCrazy I imagined it was just a matter of time :-). We still need the dotted part. However spectacular everything.
– Sebastiano
23 hours ago
1
+1 for spending your space, time, energy for drawing this that has become realistic.
– God Must Be Crazy
22 hours ago
1
Your answer is best selection to print on the paper!
– chishimotoji
5 hours ago
add a comment |
A quick TikZ version for comparison.
documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz,tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{120}
begin{tikzpicture}[tdplot_main_coords,scale=3,declare function={
myz(x)=sqrt((1-sin(x))/2);
mytheta(x)=atan(cot(tdplotmaintheta)/(cos(tdplotmainphi)*cos(x)
-sin(tdplotmainphi)*sin(x)));}]
draw[-latex] (-2,0,0) -- (2,0,0) node[pos=1.05]{$x$};
draw[-latex] (0,0,0) coordinate(O) -- (0,2,0) node[pos=1.1]{$y$};
draw[-latex] (0,0,0) -- (0,0,2) node[pos=1.1]{$z$};
begin{scope}
clip plot[variable=x,domain=tdplotmainphi-180:90,smooth]
({cos(x)},{sin(x)},0)--
plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})--
plot[variable=x,domain=90:tdplotmainphi,smooth] ({cos(x)},{sin(x)},0) -- ++ (0,0,2) --
({cos(tdplotmainphi-180)},{sin(tdplotmainphi-180)},2) -- cycle;
draw[ball color=gray,opacity=0.3,tdplot_screen_coords] (O) circle (1);
end{scope}
draw[top color=gray,bottom color=gray!30,middle color=gray!20,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)});
shade[top color=gray!50,bottom color=gray!50!black,middle color=gray,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})
--plot[variable=x,domain=-64:90,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0);
draw[dashed] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0) --
({0.5*cos(-64)},{0.5+0.5*sin(-64)},{myz(-64)});
end{tikzpicture}
end{document}
4
+1 Beautiful picture!
– chishimotoji
yesterday
1
@GodMustBeCrazy I imagined it was just a matter of time :-). We still need the dotted part. However spectacular everything.
– Sebastiano
23 hours ago
1
+1 for spending your space, time, energy for drawing this that has become realistic.
– God Must Be Crazy
22 hours ago
1
Your answer is best selection to print on the paper!
– chishimotoji
5 hours ago
add a comment |
A quick TikZ version for comparison.
documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz,tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{120}
begin{tikzpicture}[tdplot_main_coords,scale=3,declare function={
myz(x)=sqrt((1-sin(x))/2);
mytheta(x)=atan(cot(tdplotmaintheta)/(cos(tdplotmainphi)*cos(x)
-sin(tdplotmainphi)*sin(x)));}]
draw[-latex] (-2,0,0) -- (2,0,0) node[pos=1.05]{$x$};
draw[-latex] (0,0,0) coordinate(O) -- (0,2,0) node[pos=1.1]{$y$};
draw[-latex] (0,0,0) -- (0,0,2) node[pos=1.1]{$z$};
begin{scope}
clip plot[variable=x,domain=tdplotmainphi-180:90,smooth]
({cos(x)},{sin(x)},0)--
plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})--
plot[variable=x,domain=90:tdplotmainphi,smooth] ({cos(x)},{sin(x)},0) -- ++ (0,0,2) --
({cos(tdplotmainphi-180)},{sin(tdplotmainphi-180)},2) -- cycle;
draw[ball color=gray,opacity=0.3,tdplot_screen_coords] (O) circle (1);
end{scope}
draw[top color=gray,bottom color=gray!30,middle color=gray!20,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)});
shade[top color=gray!50,bottom color=gray!50!black,middle color=gray,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})
--plot[variable=x,domain=-64:90,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0);
draw[dashed] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0) --
({0.5*cos(-64)},{0.5+0.5*sin(-64)},{myz(-64)});
end{tikzpicture}
end{document}
A quick TikZ version for comparison.
documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz,tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{120}
begin{tikzpicture}[tdplot_main_coords,scale=3,declare function={
myz(x)=sqrt((1-sin(x))/2);
mytheta(x)=atan(cot(tdplotmaintheta)/(cos(tdplotmainphi)*cos(x)
-sin(tdplotmainphi)*sin(x)));}]
draw[-latex] (-2,0,0) -- (2,0,0) node[pos=1.05]{$x$};
draw[-latex] (0,0,0) coordinate(O) -- (0,2,0) node[pos=1.1]{$y$};
draw[-latex] (0,0,0) -- (0,0,2) node[pos=1.1]{$z$};
begin{scope}
clip plot[variable=x,domain=tdplotmainphi-180:90,smooth]
({cos(x)},{sin(x)},0)--
plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})--
plot[variable=x,domain=90:tdplotmainphi,smooth] ({cos(x)},{sin(x)},0) -- ++ (0,0,2) --
({cos(tdplotmainphi-180)},{sin(tdplotmainphi-180)},2) -- cycle;
draw[ball color=gray,opacity=0.3,tdplot_screen_coords] (O) circle (1);
end{scope}
draw[top color=gray,bottom color=gray!30,middle color=gray!20,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:450,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)});
shade[top color=gray!50,bottom color=gray!50!black,middle color=gray,shading angle=90,
fill opacity=0.3] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},{myz(x)})
--plot[variable=x,domain=-64:90,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0);
draw[dashed] plot[variable=x,domain=90:-64,smooth,samples=101]
({0.5*cos(x)},{0.5+0.5*sin(x)},0) --
({0.5*cos(-64)},{0.5+0.5*sin(-64)},{myz(-64)});
end{tikzpicture}
end{document}
edited 23 hours ago
answered yesterday
marmotmarmot
89.2k4102193
89.2k4102193
4
+1 Beautiful picture!
– chishimotoji
yesterday
1
@GodMustBeCrazy I imagined it was just a matter of time :-). We still need the dotted part. However spectacular everything.
– Sebastiano
23 hours ago
1
+1 for spending your space, time, energy for drawing this that has become realistic.
– God Must Be Crazy
22 hours ago
1
Your answer is best selection to print on the paper!
– chishimotoji
5 hours ago
add a comment |
4
+1 Beautiful picture!
– chishimotoji
yesterday
1
@GodMustBeCrazy I imagined it was just a matter of time :-). We still need the dotted part. However spectacular everything.
– Sebastiano
23 hours ago
1
+1 for spending your space, time, energy for drawing this that has become realistic.
– God Must Be Crazy
22 hours ago
1
Your answer is best selection to print on the paper!
– chishimotoji
5 hours ago
4
4
+1 Beautiful picture!
– chishimotoji
yesterday
+1 Beautiful picture!
– chishimotoji
yesterday
1
1
@GodMustBeCrazy I imagined it was just a matter of time :-). We still need the dotted part. However spectacular everything.
– Sebastiano
23 hours ago
@GodMustBeCrazy I imagined it was just a matter of time :-). We still need the dotted part. However spectacular everything.
– Sebastiano
23 hours ago
1
1
+1 for spending your space, time, energy for drawing this that has become realistic.
– God Must Be Crazy
22 hours ago
+1 for spending your space, time, energy for drawing this that has become realistic.
– God Must Be Crazy
22 hours ago
1
1
Your answer is best selection to print on the paper!
– chishimotoji
5 hours ago
Your answer is best selection to print on the paper!
– chishimotoji
5 hours ago
add a comment |
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}[solidmemory](-4,-2)(6,6)
psset{viewpoint=30 10 20 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[
object=calottesphere,r=2,ngrid=16 18,opacity=0.4,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0]
end{pspicture}
end{document}
documentclass{article}
usepackage{pst-solides3d}
usepackage[a4paper,showframe]{geometry}
begin{document}
begin{center}
begin{pspicture}[solidmemory](-5,-2)(6,6)
psset{viewpoint=30 80 25 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[object=calottesphere,r=2,ngrid=64 72,action=none,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0,name=sp]
psSolid[object=cylindrecreux,h=2.5,r=1,fillcolor=white,action=none,
ngrid=30 72,incolor=green!50,name=py](0,1,0)
psSolid[object=fusion,base=sp py,opacity=0.8,grid,action=draw**]
defFunction[algebraic]{g}(t){sin(t)}{cos(t)+1}{2*sin(1/2*t)}
psset{object=courbe,fillcolor=red,linecolor=red,
linewidth=0.1,function=g,r=0,action=draw**}
psSolid[range=0 1.9]psSolid[range=2.6 3.9]psSolid[range=5 TwoPi]
end{pspicture}
end{center}
end{document}
and printed on A4:
Why don't we plot of function directly x^2+y^2+z^2=4? :-)
– chishimotoji
yesterday
Where is the sense of plotting a sphere with a function? It is already internally defined.
– Herbert
yesterday
Where are the previous questions? :-)). What do you think if we print it on the A4 paper? Truly, marmot's answer is best selection to print!
– chishimotoji
5 hours ago
no, TikZ cannot really handle 3d sufaces. And if you want to print in grayscales then use gray as color. Where is the problem??
– Herbert
5 hours ago
Can you illustrate it if it is printed on the A4 paper?(necessary). I do not your picture can be printed on the A4 paper clearly. P/S: I try to find on PSTricks site but there are no any examples about several things at least for me.
– chishimotoji
4 hours ago
|
show 4 more comments
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}[solidmemory](-4,-2)(6,6)
psset{viewpoint=30 10 20 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[
object=calottesphere,r=2,ngrid=16 18,opacity=0.4,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0]
end{pspicture}
end{document}
documentclass{article}
usepackage{pst-solides3d}
usepackage[a4paper,showframe]{geometry}
begin{document}
begin{center}
begin{pspicture}[solidmemory](-5,-2)(6,6)
psset{viewpoint=30 80 25 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[object=calottesphere,r=2,ngrid=64 72,action=none,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0,name=sp]
psSolid[object=cylindrecreux,h=2.5,r=1,fillcolor=white,action=none,
ngrid=30 72,incolor=green!50,name=py](0,1,0)
psSolid[object=fusion,base=sp py,opacity=0.8,grid,action=draw**]
defFunction[algebraic]{g}(t){sin(t)}{cos(t)+1}{2*sin(1/2*t)}
psset{object=courbe,fillcolor=red,linecolor=red,
linewidth=0.1,function=g,r=0,action=draw**}
psSolid[range=0 1.9]psSolid[range=2.6 3.9]psSolid[range=5 TwoPi]
end{pspicture}
end{center}
end{document}
and printed on A4:
Why don't we plot of function directly x^2+y^2+z^2=4? :-)
– chishimotoji
yesterday
Where is the sense of plotting a sphere with a function? It is already internally defined.
– Herbert
yesterday
Where are the previous questions? :-)). What do you think if we print it on the A4 paper? Truly, marmot's answer is best selection to print!
– chishimotoji
5 hours ago
no, TikZ cannot really handle 3d sufaces. And if you want to print in grayscales then use gray as color. Where is the problem??
– Herbert
5 hours ago
Can you illustrate it if it is printed on the A4 paper?(necessary). I do not your picture can be printed on the A4 paper clearly. P/S: I try to find on PSTricks site but there are no any examples about several things at least for me.
– chishimotoji
4 hours ago
|
show 4 more comments
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}[solidmemory](-4,-2)(6,6)
psset{viewpoint=30 10 20 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[
object=calottesphere,r=2,ngrid=16 18,opacity=0.4,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0]
end{pspicture}
end{document}
documentclass{article}
usepackage{pst-solides3d}
usepackage[a4paper,showframe]{geometry}
begin{document}
begin{center}
begin{pspicture}[solidmemory](-5,-2)(6,6)
psset{viewpoint=30 80 25 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[object=calottesphere,r=2,ngrid=64 72,action=none,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0,name=sp]
psSolid[object=cylindrecreux,h=2.5,r=1,fillcolor=white,action=none,
ngrid=30 72,incolor=green!50,name=py](0,1,0)
psSolid[object=fusion,base=sp py,opacity=0.8,grid,action=draw**]
defFunction[algebraic]{g}(t){sin(t)}{cos(t)+1}{2*sin(1/2*t)}
psset{object=courbe,fillcolor=red,linecolor=red,
linewidth=0.1,function=g,r=0,action=draw**}
psSolid[range=0 1.9]psSolid[range=2.6 3.9]psSolid[range=5 TwoPi]
end{pspicture}
end{center}
end{document}
and printed on A4:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}[solidmemory](-4,-2)(6,6)
psset{viewpoint=30 10 20 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[
object=calottesphere,r=2,ngrid=16 18,opacity=0.4,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0]
end{pspicture}
end{document}
documentclass{article}
usepackage{pst-solides3d}
usepackage[a4paper,showframe]{geometry}
begin{document}
begin{center}
begin{pspicture}[solidmemory](-5,-2)(6,6)
psset{viewpoint=30 80 25 rtp2xyz,lightsrc=viewpoint}
psSolid[object=plan,
definition=normalpoint,args={0 0 0 [0 0 1]},
base=-2.5 2.5 -2.5 2.5,
planmarks,name=plane]
psset{plan=plane}
psProjection[object=cercle,args=0 1 1,range=0 360,
linecolor=red,linestyle=dashed]
axesIIID(0,0,0)(3,3,3)
psSolid[object=calottesphere,r=2,ngrid=64 72,action=none,
linewidth=0.01pt,fillcolor=blue!60,theta=90,phi=0,name=sp]
psSolid[object=cylindrecreux,h=2.5,r=1,fillcolor=white,action=none,
ngrid=30 72,incolor=green!50,name=py](0,1,0)
psSolid[object=fusion,base=sp py,opacity=0.8,grid,action=draw**]
defFunction[algebraic]{g}(t){sin(t)}{cos(t)+1}{2*sin(1/2*t)}
psset{object=courbe,fillcolor=red,linecolor=red,
linewidth=0.1,function=g,r=0,action=draw**}
psSolid[range=0 1.9]psSolid[range=2.6 3.9]psSolid[range=5 TwoPi]
end{pspicture}
end{center}
end{document}
and printed on A4:
edited 4 hours ago
answered yesterday
HerbertHerbert
270k24408717
270k24408717
Why don't we plot of function directly x^2+y^2+z^2=4? :-)
– chishimotoji
yesterday
Where is the sense of plotting a sphere with a function? It is already internally defined.
– Herbert
yesterday
Where are the previous questions? :-)). What do you think if we print it on the A4 paper? Truly, marmot's answer is best selection to print!
– chishimotoji
5 hours ago
no, TikZ cannot really handle 3d sufaces. And if you want to print in grayscales then use gray as color. Where is the problem??
– Herbert
5 hours ago
Can you illustrate it if it is printed on the A4 paper?(necessary). I do not your picture can be printed on the A4 paper clearly. P/S: I try to find on PSTricks site but there are no any examples about several things at least for me.
– chishimotoji
4 hours ago
|
show 4 more comments
Why don't we plot of function directly x^2+y^2+z^2=4? :-)
– chishimotoji
yesterday
Where is the sense of plotting a sphere with a function? It is already internally defined.
– Herbert
yesterday
Where are the previous questions? :-)). What do you think if we print it on the A4 paper? Truly, marmot's answer is best selection to print!
– chishimotoji
5 hours ago
no, TikZ cannot really handle 3d sufaces. And if you want to print in grayscales then use gray as color. Where is the problem??
– Herbert
5 hours ago
Can you illustrate it if it is printed on the A4 paper?(necessary). I do not your picture can be printed on the A4 paper clearly. P/S: I try to find on PSTricks site but there are no any examples about several things at least for me.
– chishimotoji
4 hours ago
Why don't we plot of function directly x^2+y^2+z^2=4? :-)
– chishimotoji
yesterday
Why don't we plot of function directly x^2+y^2+z^2=4? :-)
– chishimotoji
yesterday
Where is the sense of plotting a sphere with a function? It is already internally defined.
– Herbert
yesterday
Where is the sense of plotting a sphere with a function? It is already internally defined.
– Herbert
yesterday
Where are the previous questions? :-)). What do you think if we print it on the A4 paper? Truly, marmot's answer is best selection to print!
– chishimotoji
5 hours ago
Where are the previous questions? :-)). What do you think if we print it on the A4 paper? Truly, marmot's answer is best selection to print!
– chishimotoji
5 hours ago
no, TikZ cannot really handle 3d sufaces. And if you want to print in grayscales then use gray as color. Where is the problem??
– Herbert
5 hours ago
no, TikZ cannot really handle 3d sufaces. And if you want to print in grayscales then use gray as color. Where is the problem??
– Herbert
5 hours ago
Can you illustrate it if it is printed on the A4 paper?(necessary). I do not your picture can be printed on the A4 paper clearly. P/S: I try to find on PSTricks site but there are no any examples about several things at least for me.
– chishimotoji
4 hours ago
Can you illustrate it if it is printed on the A4 paper?(necessary). I do not your picture can be printed on the A4 paper clearly. P/S: I try to find on PSTricks site but there are no any examples about several things at least for me.
– chishimotoji
4 hours ago
|
show 4 more comments
Hemisphere as a parameterized surface:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
axesIIID(0,0,0)(3,3,3)
defFunction[algebraic]{hemisphere}(u,v)
{2*cos(u)*sin(v)}{2*sin(u)*sin(v)}{2*cos(v)}
psSolid[object=surfaceparametree,
base=0 2 pi mul 0 pi 2 div,
fillcolor=red,
opacity=0.7,
function=hemisphere,
linewidth=0.5pslinewidth,
ngrid=36 36]%
end{pspicture}
end{document}
add a comment |
Hemisphere as a parameterized surface:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
axesIIID(0,0,0)(3,3,3)
defFunction[algebraic]{hemisphere}(u,v)
{2*cos(u)*sin(v)}{2*sin(u)*sin(v)}{2*cos(v)}
psSolid[object=surfaceparametree,
base=0 2 pi mul 0 pi 2 div,
fillcolor=red,
opacity=0.7,
function=hemisphere,
linewidth=0.5pslinewidth,
ngrid=36 36]%
end{pspicture}
end{document}
add a comment |
Hemisphere as a parameterized surface:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
axesIIID(0,0,0)(3,3,3)
defFunction[algebraic]{hemisphere}(u,v)
{2*cos(u)*sin(v)}{2*sin(u)*sin(v)}{2*cos(v)}
psSolid[object=surfaceparametree,
base=0 2 pi mul 0 pi 2 div,
fillcolor=red,
opacity=0.7,
function=hemisphere,
linewidth=0.5pslinewidth,
ngrid=36 36]%
end{pspicture}
end{document}
Hemisphere as a parameterized surface:
documentclass{article}
usepackage{pst-solides3d}
begin{document}
begin{pspicture}(-4,-2)(6,6)
psset{viewpoint=30 40 40 rtp2xyz,lightsrc=viewpoint}
axesIIID(0,0,0)(3,3,3)
defFunction[algebraic]{hemisphere}(u,v)
{2*cos(u)*sin(v)}{2*sin(u)*sin(v)}{2*cos(v)}
psSolid[object=surfaceparametree,
base=0 2 pi mul 0 pi 2 div,
fillcolor=red,
opacity=0.7,
function=hemisphere,
linewidth=0.5pslinewidth,
ngrid=36 36]%
end{pspicture}
end{document}
answered yesterday
Jürgen GJürgen G
1,060214
1,060214
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f468797%2fhow-to-plot-two-surfaces-and-the-intersection-curve%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