3
$\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$ Jun 3, 2020 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, 2020 at 13:23
  • $\begingroup$ something like it, yes $\endgroup$ Jun 3, 2020 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, 2020 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$ Jun 3, 2020 at 15:24

1 Answer 1

4
$\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
  • 1
    $\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$ Jun 3, 2020 at 15:43
  • 1
    $\begingroup$ Sure! shall try it out. Thank you for your time. $\endgroup$ Jun 3, 2020 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.