Great Circle Intersection point with a straight line
-
I am trying to find an algorithm, or actual code if available, to find the intersection point of a Great Circle line and a straight line. Even though this is on a sphere, the earth, I want to consider the straight line as basically tunneling through the earth and not following the curvature of the earth. Basically I want to find the point where a Great Circle line passes some "line in the sand". I have searched for an algorithm for this but have not been able to find anything. Please help me Obi Wan Kenobe, you're my only hope. Kalvin
-
I am trying to find an algorithm, or actual code if available, to find the intersection point of a Great Circle line and a straight line. Even though this is on a sphere, the earth, I want to consider the straight line as basically tunneling through the earth and not following the curvature of the earth. Basically I want to find the point where a Great Circle line passes some "line in the sand". I have searched for an algorithm for this but have not been able to find anything. Please help me Obi Wan Kenobe, you're my only hope. Kalvin
Hi, there is no algorithm involved, just a little algebra, with a system of two equations (line and sphere) to solve. What do you know about the line? What is your coordinate system? If you can't solve it in three dimensions, try the similar question in two dimensions first. :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
Hi, there is no algorithm involved, just a little algebra, with a system of two equations (line and sphere) to solve. What do you know about the line? What is your coordinate system? If you can't solve it in three dimensions, try the similar question in two dimensions first. :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
Thank you for the reply. When it comes to math I am at a disadvantage. My lines are defined by lat/lon values for the end points of both lines. I know the equation for a straight line is y=mx+b. I can plug in lat/lon for y and x since lat/lon are in decimal degrees. I have not been able to find an equation for the Great Circle line, not one I understand anyway.
-
Thank you for the reply. When it comes to math I am at a disadvantage. My lines are defined by lat/lon values for the end points of both lines. I know the equation for a straight line is y=mx+b. I can plug in lat/lon for y and x since lat/lon are in decimal degrees. I have not been able to find an equation for the Great Circle line, not one I understand anyway.
Why don't you follow Luc suggestion and try first in two dimensions?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles] -
Why don't you follow Luc suggestion and try first in two dimensions?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]That's a great idea. Since the great circle is on a sphere, could I use an arc in 2D for this? Any idea what the equation of a Great Circle line is? I really appreciate the help. I have been looking at this for days and am getting nowhere. All the equations I find have to do with finding the distance or heading for a Great Circle line. I don't need either one of those. Kalvin
-
That's a great idea. Since the great circle is on a sphere, could I use an arc in 2D for this? Any idea what the equation of a Great Circle line is? I really appreciate the help. I have been looking at this for days and am getting nowhere. All the equations I find have to do with finding the distance or heading for a Great Circle line. I don't need either one of those. Kalvin
Well, I think that we have too few details of your problem. For instance do you mean a 3D generic line? Moreover, what Great Circle? Have you considered that a sphere has infinite (with power two, if I'm not wrong) Great Circles? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles] -
Well, I think that we have too few details of your problem. For instance do you mean a 3D generic line? Moreover, what Great Circle? Have you considered that a sphere has infinite (with power two, if I'm not wrong) Great Circles? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]I couldn't pass this by without a comment. Two points on a sphere (except the endpoints of a diameter) can have one and only one great circle pass through them. The two points and the center of the sphere define a plane, and this plane intersects the sphere in one great circle. What you are referring to, I think, is that two points in space can have an infinite number of circles pass through them, bounded, of course. The smallest circle is the one whose diameter is the line defined by the two points. The infinity starts there, a different circle for every increase in size, and these circles are just tangent to the two points. The additional infinities are the rotation of any of the circles around the line thus forming a torus. The interesting point is that these two sets of infinities are a distinct set of circles than those created by changing the end points of the same line, (a lower bound for the smallest circle and all such circles are distinct from the initial set, even if the same diameter, because the center is at a different place). Same thing for a different line (two different points not on the same line). As to the initial question, I do have the equations to solve this, but this bring up analytical geometry and vector methods. I could elaborate if anyone is interested. Dave Augustine
-
I couldn't pass this by without a comment. Two points on a sphere (except the endpoints of a diameter) can have one and only one great circle pass through them. The two points and the center of the sphere define a plane, and this plane intersects the sphere in one great circle. What you are referring to, I think, is that two points in space can have an infinite number of circles pass through them, bounded, of course. The smallest circle is the one whose diameter is the line defined by the two points. The infinity starts there, a different circle for every increase in size, and these circles are just tangent to the two points. The additional infinities are the rotation of any of the circles around the line thus forming a torus. The interesting point is that these two sets of infinities are a distinct set of circles than those created by changing the end points of the same line, (a lower bound for the smallest circle and all such circles are distinct from the initial set, even if the same diameter, because the center is at a different place). Same thing for a different line (two different points not on the same line). As to the initial question, I do have the equations to solve this, but this bring up analytical geometry and vector methods. I could elaborate if anyone is interested. Dave Augustine
Member 4194593 wrote:
I couldn't pass this by without a comment. Two points on a sphere (except the endpoints of a diameter) can have one and only one great circle pass through them. The two points and the center of the sphere define a plane, and this plane intersects the sphere in one great circle.
Sphere has infinite power two Great Circles, if you fix two points, it is strighforward that you end up with no degrees of freedom, i.e. one Great Circle. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Member 4194593 wrote:
I couldn't pass this by without a comment. Two points on a sphere (except the endpoints of a diameter) can have one and only one great circle pass through them. The two points and the center of the sphere define a plane, and this plane intersects the sphere in one great circle.
Sphere has infinite power two Great Circles, if you fix two points, it is strighforward that you end up with no degrees of freedom, i.e. one Great Circle. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeIf you read the authors second post, it was stated that both lines were defined by lat/lon values, thus only one great circle. Dave Augustine.
-
If you read the authors second post, it was stated that both lines were defined by lat/lon values, thus only one great circle. Dave Augustine.
Member 4194593 wrote:
both lines
:confused:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke