calculating distance to base

caningo

Developer-in-training
Tutorial Publisher
Donator
Joined
Jul 4, 2008
Messages
127
Reaction score
0
Points
0
Location
Clovis
Hello guys,

Given an orbit around a certain celestial body, in this case the moon, I would like to know how to calculate the horizontal distance from an orbit to a surface base located at a certain latitude. A picture can explain better.

My specific problem is trying to minimize the distance A shown in the picture. AFAIK this can be accomplished by a) rotating the line of nodes or b) decreasing/increasing the orbital inclination.

So how in the world do I calculate this distance A? I have figured out 4 dependencies so far: orbit inclination, base latitude, base longitude, and longitude of ascending node... Now to get them all together. :idk:

Any help is appreciated.

:hail::probe:!!
 

Attachments

  • example.jpg
    example.jpg
    8.9 KB · Views: 52

statickid

CatDog from Deimos
Donator
Joined
Nov 23, 2008
Messages
1,683
Reaction score
4
Points
38
are you taking into account altitude? I'm not exactly sure why would want to calculate that as it is a curved line and not the most direct path to the base.

however, notice that you are merely trying to figure out the distance between two locations on the same latitude. all you have to do is figure out the distance between ONE degree of longitude at that latitude. i mean calculate the distance around the body "horizontally" as you are calling it, and then divide it by 360, then multiply it by the difference of longitude between your point a and point b
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
Here is some reading at first: [ame="http://en.wikipedia.org/wiki/Spherical_trigonometry"]Spherical trigonometry - Wikipedia, the free encyclopedia[/ame]

From the law of right-angled spherical triangles:

Sin(base latitude) / Sin(inclination) = Sin(x) / Sin(90-inclination)

The angular distance in would be A = longitude of ascending node + x - base longitude.

PS. I didn't test the formula, so, I hope I didn't make any mistakes.

EDIT: Here is the best book of spherical trigonometry that I have seen: http://www.gutenberg.org/etext/19770

---------- Post added at 23:41 ---------- Previous post was at 23:21 ----------

My specific problem is trying to minimize the distance A shown in the picture. AFAIK this can be accomplished by a) rotating the line of nodes or b) decreasing/increasing the orbital inclination.
The optimal point for orbit alignment is 90 degrees before intercepting the latitude line of the base. This is explained in page 4 of manual of BaseSyncMFD.
 
Last edited:

caningo

Developer-in-training
Tutorial Publisher
Donator
Joined
Jul 4, 2008
Messages
127
Reaction score
0
Points
0
Location
Clovis
Jarmo,

I will look further into the reading you have suggested and hopefully that should answer some of my other questions.

Thanks for pointing me in the right direction. :cheers::tiphat:
 
Last edited:

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
My approach would be to get a vector from the reference body centre to the vessel (use oapiGetRelativePos) and a vector from the reference body centre to the base (use oapiGetPlanetCurrentRotation and some trigonometry to convert the base spherical coordinates to cartesian). Normalise the vectors and find the angle between them by finding the arc-cosine of the dot product. You can then calculate the distance around the surface of the sphere from the angle and the radius of the body.
 
Last edited:
Top