Function lupnt::ScaleStateForCoordinateScale

Function Documentation

inline Vec6 lupnt::ScaleStateForCoordinateScale(const Vec6 &rv, CoordinateScale from, CoordinateScale to)

Rescale a Cartesian position+velocity state from one CoordinateScale to another, rescaling the position (via ScalePositionForCoordinateScale) and leaving the velocity unchanged (velocities are invariant under IAU coordinate scale changes because length and coordinate time scale by the same factor).

Called by GetBodyPosVel(..., units, scale) in lupnt/data/kernels.cc to convert a TDB-scale ephemeris state into the requested CoordinateScale before unit conversion.

Parameters:
  • rv – Position+velocity state in from scale [m, m/s]

  • from – Source coordinate scale

  • to – Target coordinate scale

Throws:

std::invalid_argument – if the scales are not related by a constant factor

Returns:

State with position rescaled to to [m, m/s]