tikz-3dplot, geodesics and adressing endpoints in polar coordinates












6














I am trying to draw geodesics on a sphere. While many approaches, like for example this one, i am more interested in another way. If i specify two points, say qand p on the Sphere, i would like to join them by a geodesic, i.e. arc. Whether thats the longer or shorter arc, might be a problem for further stuff, i managed to do the following



documentclass[a4paper]{standalone}
usepackage{tikz,tikz-3dplot}
tikzstyle{point}=[inner sep=0pt, outer sep=0pt,%
minimum size=2pt,fill=black,shape=circle]
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}
begin{scope}[tdplot_main_coords]
%draw sphere
tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
{draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
{draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
{draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
% draw geodesics
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,red!50!black]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
tdplotdrawpolytopearc[thick,blue!50!black]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,green!50!black]{1}{}{}
%draw point
tdplotsetcoord{P}{1}{30}{60}
node[point,label={0:(p)}] at (P) {};

end{scope}
end{tikzpicture}
end{document}


which yields



an MWE not a beauty



and leads me to my two questions:



1) I would like to be able to specify both “spanning” points (the second and third of tdplotdefinepoints in polar coordinates. It would be enough, to have a function performing theta,phi into px,py,pz, similar to the function used for the point P. Or maybe one could also kind of extract these coordinates from a label; is either of that possible?



2) when drawing an arc, is there a possibility – similar to the usual draw to access the mid point? It would be enough to be able to place a node (with style) and label there, otherwhise a coordinate would of course do the job, too. Any ideas on how to get that?










share|improve this question
























  • Would you be interested in a solution that is entirely based on spherical coordinates? (IMHO it does not no make too much sense to use cartesian coordinates to parametrize points on the surface of a sphere.)
    – marmot
    Dec 30 '18 at 0:22










  • In most of my calculations its easier to have cartesian coordinates, since for geodesics (great arcs) you would have to calculate several modulo cases in spherical coordinates; tangent vectors are cartesian anyways. However, I would be interested in any solution :)
    – Ronny
    21 hours ago
















6














I am trying to draw geodesics on a sphere. While many approaches, like for example this one, i am more interested in another way. If i specify two points, say qand p on the Sphere, i would like to join them by a geodesic, i.e. arc. Whether thats the longer or shorter arc, might be a problem for further stuff, i managed to do the following



documentclass[a4paper]{standalone}
usepackage{tikz,tikz-3dplot}
tikzstyle{point}=[inner sep=0pt, outer sep=0pt,%
minimum size=2pt,fill=black,shape=circle]
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}
begin{scope}[tdplot_main_coords]
%draw sphere
tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
{draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
{draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
{draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
% draw geodesics
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,red!50!black]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
tdplotdrawpolytopearc[thick,blue!50!black]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,green!50!black]{1}{}{}
%draw point
tdplotsetcoord{P}{1}{30}{60}
node[point,label={0:(p)}] at (P) {};

end{scope}
end{tikzpicture}
end{document}


which yields



an MWE not a beauty



and leads me to my two questions:



1) I would like to be able to specify both “spanning” points (the second and third of tdplotdefinepoints in polar coordinates. It would be enough, to have a function performing theta,phi into px,py,pz, similar to the function used for the point P. Or maybe one could also kind of extract these coordinates from a label; is either of that possible?



2) when drawing an arc, is there a possibility – similar to the usual draw to access the mid point? It would be enough to be able to place a node (with style) and label there, otherwhise a coordinate would of course do the job, too. Any ideas on how to get that?










share|improve this question
























  • Would you be interested in a solution that is entirely based on spherical coordinates? (IMHO it does not no make too much sense to use cartesian coordinates to parametrize points on the surface of a sphere.)
    – marmot
    Dec 30 '18 at 0:22










  • In most of my calculations its easier to have cartesian coordinates, since for geodesics (great arcs) you would have to calculate several modulo cases in spherical coordinates; tangent vectors are cartesian anyways. However, I would be interested in any solution :)
    – Ronny
    21 hours ago














6












6








6







I am trying to draw geodesics on a sphere. While many approaches, like for example this one, i am more interested in another way. If i specify two points, say qand p on the Sphere, i would like to join them by a geodesic, i.e. arc. Whether thats the longer or shorter arc, might be a problem for further stuff, i managed to do the following



documentclass[a4paper]{standalone}
usepackage{tikz,tikz-3dplot}
tikzstyle{point}=[inner sep=0pt, outer sep=0pt,%
minimum size=2pt,fill=black,shape=circle]
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}
begin{scope}[tdplot_main_coords]
%draw sphere
tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
{draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
{draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
{draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
% draw geodesics
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,red!50!black]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
tdplotdrawpolytopearc[thick,blue!50!black]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,green!50!black]{1}{}{}
%draw point
tdplotsetcoord{P}{1}{30}{60}
node[point,label={0:(p)}] at (P) {};

end{scope}
end{tikzpicture}
end{document}


which yields



an MWE not a beauty



and leads me to my two questions:



1) I would like to be able to specify both “spanning” points (the second and third of tdplotdefinepoints in polar coordinates. It would be enough, to have a function performing theta,phi into px,py,pz, similar to the function used for the point P. Or maybe one could also kind of extract these coordinates from a label; is either of that possible?



2) when drawing an arc, is there a possibility – similar to the usual draw to access the mid point? It would be enough to be able to place a node (with style) and label there, otherwhise a coordinate would of course do the job, too. Any ideas on how to get that?










share|improve this question















I am trying to draw geodesics on a sphere. While many approaches, like for example this one, i am more interested in another way. If i specify two points, say qand p on the Sphere, i would like to join them by a geodesic, i.e. arc. Whether thats the longer or shorter arc, might be a problem for further stuff, i managed to do the following



documentclass[a4paper]{standalone}
usepackage{tikz,tikz-3dplot}
tikzstyle{point}=[inner sep=0pt, outer sep=0pt,%
minimum size=2pt,fill=black,shape=circle]
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}
begin{scope}[tdplot_main_coords]
%draw sphere
tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
{draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
{draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
{draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
% draw geodesics
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,red!50!black]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
tdplotdrawpolytopearc[thick,blue!50!black]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,green!50!black]{1}{}{}
%draw point
tdplotsetcoord{P}{1}{30}{60}
node[point,label={0:(p)}] at (P) {};

end{scope}
end{tikzpicture}
end{document}


which yields



an MWE not a beauty



and leads me to my two questions:



1) I would like to be able to specify both “spanning” points (the second and third of tdplotdefinepoints in polar coordinates. It would be enough, to have a function performing theta,phi into px,py,pz, similar to the function used for the point P. Or maybe one could also kind of extract these coordinates from a label; is either of that possible?



2) when drawing an arc, is there a possibility – similar to the usual draw to access the mid point? It would be enough to be able to place a node (with style) and label there, otherwhise a coordinate would of course do the job, too. Any ideas on how to get that?







tikz-pgf 3d tikz-3dplot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:36









Community

1




1










asked Nov 9 '14 at 19:12









Ronny

3,88511941




3,88511941












  • Would you be interested in a solution that is entirely based on spherical coordinates? (IMHO it does not no make too much sense to use cartesian coordinates to parametrize points on the surface of a sphere.)
    – marmot
    Dec 30 '18 at 0:22










  • In most of my calculations its easier to have cartesian coordinates, since for geodesics (great arcs) you would have to calculate several modulo cases in spherical coordinates; tangent vectors are cartesian anyways. However, I would be interested in any solution :)
    – Ronny
    21 hours ago


















  • Would you be interested in a solution that is entirely based on spherical coordinates? (IMHO it does not no make too much sense to use cartesian coordinates to parametrize points on the surface of a sphere.)
    – marmot
    Dec 30 '18 at 0:22










  • In most of my calculations its easier to have cartesian coordinates, since for geodesics (great arcs) you would have to calculate several modulo cases in spherical coordinates; tangent vectors are cartesian anyways. However, I would be interested in any solution :)
    – Ronny
    21 hours ago
















Would you be interested in a solution that is entirely based on spherical coordinates? (IMHO it does not no make too much sense to use cartesian coordinates to parametrize points on the surface of a sphere.)
– marmot
Dec 30 '18 at 0:22




Would you be interested in a solution that is entirely based on spherical coordinates? (IMHO it does not no make too much sense to use cartesian coordinates to parametrize points on the surface of a sphere.)
– marmot
Dec 30 '18 at 0:22












In most of my calculations its easier to have cartesian coordinates, since for geodesics (great arcs) you would have to calculate several modulo cases in spherical coordinates; tangent vectors are cartesian anyways. However, I would be interested in any solution :)
– Ronny
21 hours ago




In most of my calculations its easier to have cartesian coordinates, since for geodesics (great arcs) you would have to calculate several modulo cases in spherical coordinates; tangent vectors are cartesian anyways. However, I would be interested in any solution :)
– Ronny
21 hours ago










1 Answer
1






active

oldest

votes


















0














This is at best 50% of an answer because I simply do not understand the first request. tdplotsetcoord{P}{1}{30}{60} does define a point in 3d. Could you please rephrase the first request?



The second point is straightforward. decorations.markings allows you to mark a point at any position of the path, of course including the middle. The style add coordinate={<name> at <pos>} does that in the following MWE.



documentclass[a4paper]{standalone}
usepackage{tikz,tikz-3dplot}
usetikzlibrary{decorations.markings}
tikzset{point/.style={inner sep=0pt, outer sep=0pt,%
minimum size=2pt,fill=black,shape=circle},
add coordinate/.style args={#1 at #2}{postaction={decorate,
decoration={markings,mark=at position #2 with {coordinate (#1);}}}}}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}
begin{scope}[tdplot_main_coords]
%draw sphere
tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
{draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
{draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
{draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
% draw geodesics
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,red!50!black,add coordinate={M1 at 0.5}]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
tdplotdrawpolytopearc[thick,blue!50!black,add coordinate={M2 at 0.5}]{1}{}{}
tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
tdplotdrawpolytopearc[thick,green!50!black,add coordinate={M3 at 0.5}]{1}{}{}
%draw point
tdplotsetcoord{P}{1}{30}{60}
node[point,label={0:(p)}] at (P) {};
node[point,label={90:{$M_1$}}] at (M1){};
node[point,label={-90:{$M_2$}}] at (M2){};
node[point,label={0:{$M_3$}}] at (M3){};
end{scope}
end{tikzpicture}
end{document}


enter image description here






share|improve this answer





















    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
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f211334%2ftikz-3dplot-geodesics-and-adressing-endpoints-in-polar-coordinates%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This is at best 50% of an answer because I simply do not understand the first request. tdplotsetcoord{P}{1}{30}{60} does define a point in 3d. Could you please rephrase the first request?



    The second point is straightforward. decorations.markings allows you to mark a point at any position of the path, of course including the middle. The style add coordinate={<name> at <pos>} does that in the following MWE.



    documentclass[a4paper]{standalone}
    usepackage{tikz,tikz-3dplot}
    usetikzlibrary{decorations.markings}
    tikzset{point/.style={inner sep=0pt, outer sep=0pt,%
    minimum size=2pt,fill=black,shape=circle},
    add coordinate/.style args={#1 at #2}{postaction={decorate,
    decoration={markings,mark=at position #2 with {coordinate (#1);}}}}}
    begin{document}
    tdplotsetmaincoords{70}{110}
    begin{tikzpicture}
    begin{scope}[tdplot_main_coords]
    %draw sphere
    tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
    {draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
    {draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
    {draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
    % draw geodesics
    tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
    tdplotdrawpolytopearc[thick,red!50!black,add coordinate={M1 at 0.5}]{1}{}{}
    tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
    tdplotdrawpolytopearc[thick,blue!50!black,add coordinate={M2 at 0.5}]{1}{}{}
    tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
    tdplotdrawpolytopearc[thick,green!50!black,add coordinate={M3 at 0.5}]{1}{}{}
    %draw point
    tdplotsetcoord{P}{1}{30}{60}
    node[point,label={0:(p)}] at (P) {};
    node[point,label={90:{$M_1$}}] at (M1){};
    node[point,label={-90:{$M_2$}}] at (M2){};
    node[point,label={0:{$M_3$}}] at (M3){};
    end{scope}
    end{tikzpicture}
    end{document}


    enter image description here






    share|improve this answer


























      0














      This is at best 50% of an answer because I simply do not understand the first request. tdplotsetcoord{P}{1}{30}{60} does define a point in 3d. Could you please rephrase the first request?



      The second point is straightforward. decorations.markings allows you to mark a point at any position of the path, of course including the middle. The style add coordinate={<name> at <pos>} does that in the following MWE.



      documentclass[a4paper]{standalone}
      usepackage{tikz,tikz-3dplot}
      usetikzlibrary{decorations.markings}
      tikzset{point/.style={inner sep=0pt, outer sep=0pt,%
      minimum size=2pt,fill=black,shape=circle},
      add coordinate/.style args={#1 at #2}{postaction={decorate,
      decoration={markings,mark=at position #2 with {coordinate (#1);}}}}}
      begin{document}
      tdplotsetmaincoords{70}{110}
      begin{tikzpicture}
      begin{scope}[tdplot_main_coords]
      %draw sphere
      tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
      {draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
      {draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
      {draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
      % draw geodesics
      tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
      tdplotdrawpolytopearc[thick,red!50!black,add coordinate={M1 at 0.5}]{1}{}{}
      tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
      tdplotdrawpolytopearc[thick,blue!50!black,add coordinate={M2 at 0.5}]{1}{}{}
      tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
      tdplotdrawpolytopearc[thick,green!50!black,add coordinate={M3 at 0.5}]{1}{}{}
      %draw point
      tdplotsetcoord{P}{1}{30}{60}
      node[point,label={0:(p)}] at (P) {};
      node[point,label={90:{$M_1$}}] at (M1){};
      node[point,label={-90:{$M_2$}}] at (M2){};
      node[point,label={0:{$M_3$}}] at (M3){};
      end{scope}
      end{tikzpicture}
      end{document}


      enter image description here






      share|improve this answer
























        0












        0








        0






        This is at best 50% of an answer because I simply do not understand the first request. tdplotsetcoord{P}{1}{30}{60} does define a point in 3d. Could you please rephrase the first request?



        The second point is straightforward. decorations.markings allows you to mark a point at any position of the path, of course including the middle. The style add coordinate={<name> at <pos>} does that in the following MWE.



        documentclass[a4paper]{standalone}
        usepackage{tikz,tikz-3dplot}
        usetikzlibrary{decorations.markings}
        tikzset{point/.style={inner sep=0pt, outer sep=0pt,%
        minimum size=2pt,fill=black,shape=circle},
        add coordinate/.style args={#1 at #2}{postaction={decorate,
        decoration={markings,mark=at position #2 with {coordinate (#1);}}}}}
        begin{document}
        tdplotsetmaincoords{70}{110}
        begin{tikzpicture}
        begin{scope}[tdplot_main_coords]
        %draw sphere
        tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
        {draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
        {draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
        {draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
        % draw geodesics
        tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
        tdplotdrawpolytopearc[thick,red!50!black,add coordinate={M1 at 0.5}]{1}{}{}
        tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
        tdplotdrawpolytopearc[thick,blue!50!black,add coordinate={M2 at 0.5}]{1}{}{}
        tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
        tdplotdrawpolytopearc[thick,green!50!black,add coordinate={M3 at 0.5}]{1}{}{}
        %draw point
        tdplotsetcoord{P}{1}{30}{60}
        node[point,label={0:(p)}] at (P) {};
        node[point,label={90:{$M_1$}}] at (M1){};
        node[point,label={-90:{$M_2$}}] at (M2){};
        node[point,label={0:{$M_3$}}] at (M3){};
        end{scope}
        end{tikzpicture}
        end{document}


        enter image description here






        share|improve this answer












        This is at best 50% of an answer because I simply do not understand the first request. tdplotsetcoord{P}{1}{30}{60} does define a point in 3d. Could you please rephrase the first request?



        The second point is straightforward. decorations.markings allows you to mark a point at any position of the path, of course including the middle. The style add coordinate={<name> at <pos>} does that in the following MWE.



        documentclass[a4paper]{standalone}
        usepackage{tikz,tikz-3dplot}
        usetikzlibrary{decorations.markings}
        tikzset{point/.style={inner sep=0pt, outer sep=0pt,%
        minimum size=2pt,fill=black,shape=circle},
        add coordinate/.style args={#1 at #2}{postaction={decorate,
        decoration={markings,mark=at position #2 with {coordinate (#1);}}}}}
        begin{document}
        tdplotsetmaincoords{70}{110}
        begin{tikzpicture}
        begin{scope}[tdplot_main_coords]
        %draw sphere
        tdplotsphericalsurfaceplot{72}{36}{1}{black!75!white}{blue!20!white}%
        {draw[color=black,thick,->] (1,0,0) -- (1.5,0,0) node[anchor=north east]{$x$};}%
        {draw[color=black,thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};}%
        {draw[color=black,thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};}%
        % draw geodesics
        tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0,0.7071,0.7071)
        tdplotdrawpolytopearc[thick,red!50!black,add coordinate={M1 at 0.5}]{1}{}{}
        tdplotdefinepoints(0,0,0)(0.7071,-0.7071,0)(0.7071,0.7071,0)
        tdplotdrawpolytopearc[thick,blue!50!black,add coordinate={M2 at 0.5}]{1}{}{}
        tdplotdefinepoints(0,0,0)(0.7071,0.7071,0)(0,0.7071,0.7071)
        tdplotdrawpolytopearc[thick,green!50!black,add coordinate={M3 at 0.5}]{1}{}{}
        %draw point
        tdplotsetcoord{P}{1}{30}{60}
        node[point,label={0:(p)}] at (P) {};
        node[point,label={90:{$M_1$}}] at (M1){};
        node[point,label={-90:{$M_2$}}] at (M2){};
        node[point,label={0:{$M_3$}}] at (M3){};
        end{scope}
        end{tikzpicture}
        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 11 mins ago









        marmot

        88.7k4102190




        88.7k4102190






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f211334%2ftikz-3dplot-geodesics-and-adressing-endpoints-in-polar-coordinates%23new-answer', 'question_page');
            }
            );

            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







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks