- #1

- 9

- 0

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?

- Thread starter TravelGirl
- Start date

- #1

- 9

- 0

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

tiny-tim

Science Advisor

Homework Helper

- 25,832

- 251

Hi TravelGirl! Welcome to PF!

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.

- #3

- 9

- 0

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?

- #4

Office_Shredder

Staff Emeritus

Science Advisor

Gold Member

- 4,160

- 321

- #5

- 9

- 0

What equation/parameters do I use when I want to plot the line between these points?

(sorry if I don;t understand it)

- #6

haushofer

Science Advisor

- 2,471

- 857

- #7

tiny-tim

Science Advisor

Homework Helper

- 25,832

- 251

ThatYes, I do know the great circle equation.

as

I don't understand what you mean …But this gives me only the length of the line between these two points.

why

- #8

- 9

- 0

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?

- #9

tiny-tim

Science Advisor

Homework Helper

- 25,832

- 251

I'm not talking about a distance formula, I'm talking about the equation… I know that the great circle distance formula …

Do you know the equation for a circle of a given radius with a given centre?

- #10

- 9

- 0

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.

- #11

tiny-tim

Science Advisor

Homework Helper

- 25,832

- 251

- #12

- 9

- 0

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?

- #13

tiny-tim

Science Advisor

Homework Helper

- 25,832

- 251

Show us what you have so far.

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

- 1,384

- 2

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].

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

(1) If

[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:

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

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

[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

[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:

- Last Post

- Replies
- 7

- Views
- 4K

- Replies
- 2

- Views
- 2K

- Last Post

- Replies
- 5

- Views
- 3K

- Replies
- 3

- Views
- 3K

- Replies
- 13

- Views
- 5K

- Last Post

- Replies
- 27

- Views
- 6K

- Last Post

- Replies
- 5

- Views
- 3K

- Last Post

- Replies
- 12

- Views
- 1K

- Replies
- 10

- Views
- 4K

- Last Post

- Replies
- 3

- Views
- 3K