Function lupnt::ScalePositionForCoordinateScale

Function Documentation

inline Vec3 lupnt::ScalePositionForCoordinateScale(const Vec3 &r, CoordinateScale from, CoordinateScale to)

Rescale a Cartesian position vector from one CoordinateScale to another.

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

Parameters:
  • r – Position vector in from scale [m]

  • from – Source coordinate scale

  • to – Target coordinate scale

Throws:

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

Returns:

Position vector rescaled to to [m]