Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Definition of a line between two points on a sphere

  1. Mar 28, 2010 #1
    I have two points on a sphere (x1,y1,z1) and (x2,y2,z2).
    Now I want to plot a straight line over the surface of the sphere between these point.

    The radius and the center of the sphere are also known.

    What should be the equation of this line?
     
  2. jcsd
  3. Mar 28, 2010 #2

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Welcome to PF!

    Hi TravelGirl! Welcome to PF! :smile:

    If you know the Cartesian coordinates of the centre of the sphere, then just define the circle with that centre that goes through those two points. :wink:
     
  4. Mar 29, 2010 #3
    Thanks Tim for your welcoming words.

    I do have the Cartesian coordinates of the two points on a sphere.
    Only I do not want to define a circle, but a line between these two points alon the surface of the sphere.

    How do I do this?
     
  5. Mar 29, 2010 #4

    Office_Shredder

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    The shortest path between two points on a sphere is along the great circle on the sphere passing through them, which is what tiny-tim described
     
  6. Mar 29, 2010 #5
    Yes, I do know the great circle equation. But this gives me only the length of the line between these two points.

    What equation/parameters do I use when I want to plot the line between these points?
    (sorry if I don;t understand it)
     
  7. Mar 29, 2010 #6

    haushofer

    User Avatar
    Science Advisor

    You could solve the geodesic equation on a sphere, but the outcome will be that the geodesic is a great circle, so we save you some time :P
     
  8. Mar 29, 2010 #7

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    That is the equation you're looking for …

    as Office_Shredder :smile: and haushofer :smile: say, the great circle equation is the straight line over the surface of the sphere between those two points. :smile:
    I don't understand what you mean :redface:

    why doesn't your great circle equation gives you the whole circle? :confused:
     
  9. Mar 29, 2010 #8
    I am sorry that I made you confused.

    But I need to plot a line between these two points.

    So I need some sort of parametric equations:
    x=
    y=
    z=

    I know that the great circle distance formula can give me the length between these two points, measured along the surface.

    Can you maybe help me on these parametrix equations?
     
  10. Mar 29, 2010 #9

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    I'm not talking about a distance formula, I'm talking about the equation of the circle.

    Do you know the equation for a circle of a given radius with a given centre?
     
  11. Mar 29, 2010 #10
    Yes, this should be something like:

    x=x0 +r*sin(theta)*cos(rho)
    y=y0 +r*sin(theta)*sin(rho)
    z=z0 +r*cos(theta)

    But this is just a general circle, how do I make one which goes through my two points?
    And describes the line between my two points and not the whole circle.
     
  12. Mar 29, 2010 #11

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Well, you know what r is, so for example you can choose θ = 0 to be the direction from the centre to A, and you can choose θ = π/2 to be the perpendicular direction in the plane of A B and the centre.
     
  13. Mar 29, 2010 #12
    I am starting to feel really dum, but appriciate your help very much.

    Because by using constants, you get just one coordinate out of the parametric equation. So I must have understand your answer incorrectly.

    How do I determine the perpendicular direction in the plane of A B and the centre?
    And how do I get a range of numbers in my parametric equation?
     
  14. Mar 29, 2010 #13

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Show us what you have so far.
     
  15. Apr 6, 2010 #14
    As it's been a few days since the last post in this thread, I hope it's okay if I suggest a couple of methods. I found the first http://mathforum.org/library/drmath/view/52070.html". It's simpler than the one I thought of, but doesn't work when the points are at opposite poles. I'm just a learner myself, so don't take these as definitive answers. There may be neater or better ways of solving it; all comments welcome.

    Look away now, if you prefer not to see such a full working out.


    (1) If P and Q are position vectors from the centre of a sphere (of radius R) to two points on its surface, provided the points aren't directly opposite each other, you could write a parametric equation for a geodesic (that is: great circle segment, the shortest distance along the surface of the sphere) from point P to point Q like this

    [tex]\textbf{R}(t)=R\frac{\textbf{P}+t\left ( \textbf{Q}-\textbf{P} \right )}{\left \| \textbf{P}+t\left ( \textbf{Q}-\textbf{P} \right ) \right \|}[/tex]

    where [itex]t \in [0,1][/itex] (that is: t runs from 0 to 1, inclusive), so that [itex]\textbf{R}(0) = \textbf{P}[/itex], and [itex]\textbf{R}(1) = \textbf{Q}[/itex].

    The expression [itex]\textbf{P}+t\left ( \textbf{Q}-\textbf{P} \right)[/itex] is a parametric equation for a line segment from P to Q in Euclidean 3-space, which goes under the surface of the sphere; that's to say, a representative position vector standing for each point on the line segment. The denominator is the magnitude of that position vector. Dividing a vector by its magnitude gives a unit vector in the same direction. If we multiply this unit vector by R, the radius of sphere, we get the required position vector for a point on the surface of the sphere.

    This method fails when points P and Q are on opposite sides of the sphere. Then the line connecting them goes through the centre of the circle, and there are infinitely many possible geodesics between them. To get around this, you could offset P slightly in the direction you want the geodesic to go. Or maybe someone knows a more elegant way?


    (2) Alternatively, you could describe the great circle segment in terms of a unit vector in the direction of P and another unit vector at right angles to P in the plane containing P, Q and the centre of the sphere. If P and Q are not exactly opposite each other, define unit vectors thus:

    [tex]\textbf{e}_1=\frac{\textbf{P}}{\left \| \textbf{P} \right \|}=\frac{\textbf{P}}{R}[/tex]

    [tex]\textbf{e}_2=\frac{(\textbf{P}\times \textbf{Q})\times \textbf{P}}{\left \| (\textbf{P}\times \textbf{Q})\times \textbf{P} \right \|}[/tex]

    [tex]\textbf{e}_3=\frac{\textbf{P}\times \textbf{Q}}{\left \| \textbf{P}\times \textbf{Q} \right \|} = \frac{\textbf{P}\times \textbf{Q}}{R^2 \sin ( \textbf{P},\textbf{Q} )}[/tex]

    where [itex] \sin ( \textbf{P},\textbf{Q} )[/itex] is the sine of the angle from P to Q. The last of these is a unit vector normal to the plane in which the great circle lies. If P and Q are opposite each other, you can choose an arbitrary unit normal vector [itex]\textbf{e}_3[/itex], depending on which of the infinitely many great semicircles you want to describe from P to Q (the only condition is that it must be at right angles to P or Q, in other words [itex]\textbf{P} \cdot \textbf{e}_3=0[/itex]), then define the [itex] \textbf{e}_2[/itex] in terms of the others:

    [tex]\textbf{e}_2=\textbf{e}_3 \times \textbf{e}_1[/tex]

    In either case,

    [tex]\textbf{R}(\theta)=R\left [ \left ( \cos \theta \right ) \textbf{e}_1 + \left ( \sin \theta \right ) \textbf{e}_2 \right ],[/tex]

    where [itex]\theta[/itex] runs from 0 to the angle between P and Q, which we can get from the definition of the dot product:

    [tex]\theta \in \left [ 0,\arccos \left ( \frac{\textbf{P} \cdot \textbf{Q}}{R^2} \right ) \right ].[/tex]

    When P and Q are opposite, the direction is determined by the normal vector to the plane of rotation, [itex]\textbf{e}_3[/itex].
     
    Last edited by a moderator: Apr 25, 2017
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook