KSP-KOS/KOS

Orbitable giving incorrect vectors for kerbin prograde, retrograde, srfretrograde etc...

Accolade1212 opened this issue · 2 comments

In the process of calculating ejection angle and noticed the incorrect vectors.

set vpro to VECDRAW({RETURN BODY:POSITION.}, {RETURN 900000000*BODY:srfretrograde:vector.}, GREEN, "PROGRADE",1,1,.1,1).

BODY:srfretrograde:vector, gives the actual prograde which is tangent to orbit direction.

BODY:PROGRADE:VECTOR gives the vector for BODY:SRFPROGRADE:VECTOR

Good catch that does indeed look like a bug or at least clarification required in the documentation. The cause looks like the directions PROGRADE and SRFPROGRADE are based on the current velocity vector of the thing in the SHIP-RAW frame which means if you are not in the same SOI as the thing they will not be correct.

The fix I would recommend for this is to use thing:ORBIT:VELOCITY:ORBIT:NORMALIZED is the intended way for one to get the parent relative velocity of a given thing as apposed to the thing:VELOCITY:ORBIT which is what it looks like thing:PROGRADE is based on.

That works. Thanks.