/* Uses the scalar orientation value to convert from chip frame to body frame  */
void inv_convert_to_body(unsigned short orientation, const long *input, long *output)
/* Uses the scalar orientation value to convert from chip frame to body frame  */
void inv_convert_to_body(unsigned short orientation, const long *input, long *output)
{
    output[0] = input[orientation      & 0x03] * SIGNSET(orientation & 0x004);
    output[1] = input[(orientation>>3) & 0x03] * SIGNSET(orientation & 0x020);
    output[2] = input[(orientation>>6) & 0x03] * SIGNSET(orientation & 0x100);
}