1
$\begingroup$

I am new to Mathematica and I tried to make a superimposed plot of a curve on a half sphere and need help with some graphics.

This is the code line that i used to generate the following graphs

ParametricPlot3D[{{1 + Cos[t], Sin[t],2*Sin[t/2]}, {2 *Cos[t]*Sin[\[Phi]], 2*Sin[t]*Sin[\[Phi]],2*Cos[\[Phi]]}}, {t, 0, 2 \[Pi]},{\[Phi], 0, \[Pi]/2},PlotStyle -> {Directive[Green, Thickness[0.025]], Yellow},PlotRange -> All, PlotLegends -> {"Curve 1", "Sphere"},BoxRatios -> {2, 2, 1}, Axes -> False, Background -> Gray,Boxed -> False, Mesh -> 10] 

I obtained the following output

enter image description here

and with little change in the background this one

enter image description here

Question:

I want to know if the visual of the general curve can be improved and if one could put arrowheads along the Curve 1 in the anti-clockwise sense of rotation. What could be the procedure?

When I turn off the Mesh, the Curve 1 also vanishes. How could I keep the curve and put Mesh-> None on the surface at the same time?

$\endgroup$
5
  • 1
    $\begingroup$ It might be better if you plot your space curve and sphere in separate ParametricPlot3D[] calls, and then combine them with Show[]. You will of course have to manually add a legend with Legended[] afterwards if you do this. $\endgroup$
    – J. M.'s torpor
    Jun 3 '20 at 13:21
  • 1
    $\begingroup$ Thanks J.M. So, I should plot c1 and s1 and the two curves and then use Show[c1,s1], right? Then use Legended in the Show[c1,s1] command? $\endgroup$ Jun 3 '20 at 13:23
  • $\begingroup$ something like it, yes $\endgroup$
    – J. M.'s torpor
    Jun 3 '20 at 14:15
  • $\begingroup$ Thanks a lot! I did and have the desired output. Still not sure how to label my curve $\alpha(t)$. I shall try it and find out over the StackExchange. $\endgroup$ Jun 3 '20 at 15:21
  • $\begingroup$ You can write an answer to your own question showing what you've already done, and then I (or someone else) could offer tips. $\endgroup$
    – J. M.'s torpor
    Jun 3 '20 at 15:24
1
$\begingroup$

This is what i have been able to do so far.

   The curve <span class=$\alpha(t)$ over the surface of the upper-half $\mathcal{S}^2$.">

and here is the code

Clear[c1, s1]
c1 = ParametricPlot3D[{1 + Cos[t], Sin[t], 2*Sin[t/2]}, {t, 0, 
 2 \[Pi]}, 
PlotStyle -> {Directive[Red, Thickness[0.005]], 
  Arrowheads[{0, 0.05, 0.05, 0.05, 0}]}, PlotRange -> All, 
BoxRatios -> {2, 2, 1}, Boxed -> True, Axes -> True] /. Line -> Arrow;

s1 = ParametricPlot3D[{2 *Cos[t]*Sin[\[Phi]], 2*Sin[t]*Sin[\[Phi]], 
2*Cos[\[Phi]]}, {t, 0, 2 \[Pi]}, {\[Phi], 0, \[Pi]/2}, PlotStyle -> Directive[Yellow,Opacity[0.3], Specularity[White, 10]], PlotRange -> All, BoxRatios -> {2, 2, 1}, Axes -> False, Background -> White, Boxed -> False, Mesh -> None];
Show[{c1, s1}]
$\endgroup$
2
  • $\begingroup$ At this point, you could just do something like Legended[Show[{c1, s1}], SwatchLegend[{Red, Yellow}, {"Curve 1", "Sphere"}]] if you want to add the legend. $\endgroup$
    – J. M.'s torpor
    Jun 3 '20 at 15:43
  • $\begingroup$ Sure! shall try it out. Thank you for your time. $\endgroup$ Jun 3 '20 at 15:45

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .