Jump to content

Relative Inclination And time to AN/DN?


Recommended Posts

I'm working on adding a couple of methods to KRPC to enable automated rendezvous and now need to get the data required to match planes.   

To me, this seems like I want the relative inclination and the mean anomaly or true anomaly of the AN/DN?

I, as I always do on these sorts of questions, took a look at the mechjeb orbit extensions (which ought to all be added to the stock orbit class!) but before I go once again implementing half of that file all over again for myself, I thought I should ask if there was a simple way to get just what I need to enable a user to match planes out of KSP?

Link to comment
Share on other sites

The second one DOES look promising for finding the angle between the planes!   Thank you!   I'll try it out, though I'm still looking for how to find the longitude or mean anomaly or time of the intersection.

Link to comment
Share on other sites

Following the chain of extension methods in KER or MJ can get a little confusing.

For finding the time to the relative nodes this should work: https://github.com/DMagic1/KSP_BasicOrbit/blob/master/Source/BasicOrbit/Modules/TargetModules/RelInclination.cs#L60-L76

There is probably some related method to find other values about the relative nodes, but I'm not sure exactly what those are.

Link to comment
Share on other sites

And found it, I think -   I'm going to link in the code here for those that come after.  I converted them to radians and shifted the AN and DN properties to +-pi so they'd be in the same number space as the anomaly properties.  Thank you so much for the help everyone!

 

//AN

			var degrees =  FinePrint.Utilities.OrbitUtilities.AngleOfAscendingNode(InternalOrbit, target.Orbit.InternalOrbit);
            if (degrees > 180) degrees -= 360;
            return Math.PI * degrees / 180; 
       
//DN
            var degrees = FinePrint.Utilities.OrbitUtilities.AngleOfDescendingNode(InternalOrbit, target.Orbit.InternalOrbit);
            if (degrees > 180) degrees -= 360;
            return Math.PI * degrees / 180;

//Inclination
            var degrees = FinePrint.Utilities.OrbitUtilities.GetRelativeInclination(InternalOrbit, target.Orbit.InternalOrbit);
            return Math.PI * degrees / 180;

 

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