Jump to content

Getting Absolute Longitude (in same reference system as LAN)


Recommended Posts

Hey guys,

I\'m currently working on a plane alignment module for MechJeb,

and my problem is that i can\'t get the absolute longitude in which the game calculates the LAN.

which is essential for precise burns especially in polar orbits.

if anyone has an idea on how to solve this, it would be a huge help ;)

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

That isn\'t quite correct. It works perfectly at zero inclination, but fails otherwise due to mixing of angle mixing. What you really want is effectively the current sidereal time, as that is the coordinate system that LAN is measured against.

A more complete answer would be:

Local Sidereal Time = Current Orbital Longitude = LAN + Arctan[ tan( tA + APe ) * cos(i) ]

Where:

tA = True Anomaly

APe = Argument of Periapsis

i = Inclination

Of course, in KSP you have a lot easier ways to do this, as you always have the local latitude relative to the celestial body\'s surface, and the celestial body\'s surface relative position to the stars, so you can just do:

Local Sidereal Longitude = surface longitude + vessel.orbit.referenceBody.rotationAngle

Hope that helps with your orbital maneuvers!

Link to comment
Share on other sites

If you want to get coordinates relative to the 'universe', you can also use the Planetarium.up, Planetarium.right and Planetarium.forward unit vectors as a baseline. They define the coordinate system for the universal rotation.

Cheers

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...