I have read the article about multiple returns a number of times. But I cannot figure out how to apply it when the values that I am trying to get out are not be destructed into simple scalars, but rather object properties. (I can use C# V7 if needed).
Also the out keyword is not allowed when with parameters that are object properties. So how can I do this example:
Tools.orientation(ent.esr, out e.heading, out e.pitch, out e.roll);
//...
public static void orientation(EntityStateRepository esr, out double heading, out double pitch, out double roll)
{
TaitBryan topoEuler = topoToGeoc.eulerTrans(esr.worldOrienation);
heading = MathHelper.RadiansToDegrees(topoEuler.psi);
pitch = MathHelper.RadiansToDegrees(topoEuler.theta);
roll = MathHelper.RadiansToDegrees(topoEuler.phi);
}