NTW local orbital frame

Hi everyone,

I believe there is a discrepancy between the definition of the NTW frame in the Javadoc and the actual code. According to the former, TNW and NTW have their directions shuffled/inverted:

XTNW = YNTW
YTNW = -XNTW
ZTNW = ZNTW

However the implementation does not seem to match that:

TNW {

    /** {@inheritDoc} */
    public Rotation rotationFromInertial(final PVCoordinates pv) {
        return new Rotation(pv.getVelocity(), pv.getMomentum(),
                            Vector3D.PLUS_I, Vector3D.PLUS_K);
    }

NTW {

    /** {@inheritDoc} */
    public Rotation rotationFromInertial(final PVCoordinates pv) {
        final Vector3D m = pv.getMomentum();
        return new Rotation(new Vector3D(-m.getY(), m.getX(), 0), m,
                            Vector3D.PLUS_I, Vector3D.PLUS_J);
    }

In particular, the second axis of NTW is not in the velocity’s direction. Or am I not understanding something?
Quick numerical checks via the Python wrapper seem to confirm the results are not consistent.

Cheers,
Romain.

Hi @Serrof,

You are right. I also think it is a bug. Thank you for finding it.
NTW code seems to be a copy/paste of EQW which is just above in the LOFType.java file…
Could you please open an issue on the forge ?

Maxime

Done (issue 909)

Thank you Romain