I have a simple problem and it seems that I can’t reach a proper solution for it. I need to find and also graphically represent the intersection curve between two surfaces: a sphere of radius R and a paraboloid.
These two figures are represented with the help of the vectors x1,x2,x3 which are written in terms of the spherical coordinates (r,\theta,\phi). Their equations are given by eqs1 and eqs2, respectively, in the code.
The figures are drawn with the help of the function SphericalPlot3D
Now, my idea was to find the solution for the equation
expressed in terms of (\theta,\phi), then just add that solution to the Show[] function. However, doing a SphericalPlot for that line term which I’ve obtained, doesn’t solve the problem. That intersection should be en ellipse only.
How can I solve the problem and get an ellipse right where the intersection of the two surfaces should be?
(I found some examples, but those were for cartesian coordinates, and I have to work with the components x1,x2,x3 expressed in spherical ones.)
Thank you in advance!
Here is the code that I’ve written so far:
x1[r_, theta_, fi_] := r*Cos[theta];
x2[r_, theta_, fi_] := r*Sin[theta]*Cos[fi];
x3[r_, theta_, fi_] := r*Sin[theta]*Sin[fi];
(*Constants*)
A1 = 1;
A2 = 3;
A3 = 6;
R = 4;
(*Surface 1 (paraboloid)*)
eqs1[r_, theta_, fi_] :=
A1*x1[r, theta, fi]^2 + A2*x2[r, theta, fi]^2 + A3*x3[r, theta, fi];
s1 = Solve[eqs1[r, \[Theta], \[Phi]] == R^2, r][[2]];
surface1 = r /. s1;
plot1 = SphericalPlot3D[{surface1}, {\[Theta], 0, \[Pi]}, {\[Phi], 0,
2 \[Pi]}, PlotStyle -> {Blue, Opacity[0.3]}];
(*Surface 2 (sphere)*)
eqs2[r_, theta_, fi_] :=
x1[r, theta, fi]^2 + x2[r, theta, fi]^2 + x3[r, theta, fi]^2;
surface2 = r /. s2;
plot2 = SphericalPlot3D[{surface2}, {\[Theta], 0, \[Pi]}, {\[Phi], 0,
2 \[Pi]}, PlotStyle -> {Red}];
Show[plot2, plot1]
(*my attempt to find the curve*)
pts = Solve[eqs1[r, \[Theta], \[Phi]] == eqs2[r, \[Theta], \[Phi]],
r][[2]];
line = r /. pts;
SphericalPlot3D[line, {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]},
PlotStyle -> {Red}]