getPosition method for performance

Hello,

Now that there’s StaticTransform available and it’s supposed to be more computationally efficient than Transform for what is does, could we add a getPosition method (taking as argument a Frame) to SpacecraftState, Orbit and the like? The default implementation could be via getPVCoordinates, but the classes that can should use the faster option with the StaticTransform. What do you think?

Cheers,
Romain.

Good idea!

@luc, I had just started taking a closer look at the code when I realized that you have already begun this (and perhaps even finished) on branch develop, three months ago :rofl:
I guess now you can link it to the issue I opened

Hey everyone,

should we, for consistency, add the same method for the velocity ? I often find myself having to extract the PVCoordinates just to use the position and velocity and having this shortcut could improve code readibility.

Cheers,
Vincent

It is not possible. In order to compute velocity in any frame, you need position in order to compute properly velocity composition. Just think about a perfectly geostationary satellite. In Earth frame, its velocity is 0, in inertial frame its velocity is the composition of Earth rotation rate and distance to Earth center, i.e. it depends on position.

1 Like