How to change from 'Radian' to 'Degree'?

#1

Hi there,

I have a question about Units.

I don’t know how to change from ‘Radian’ to ‘Degree’.

Do i have to modify some code like (180/pi)?

Thank you,

Best regards,

#2

Hi Dwan Lee,

I usually use a linear combination measure to do this:

AnyKinMeasureLinComb Rotations_in_degrees = {  
  AnyKinRotational rot = {     
    Type = RotAxesAngles;
    AnyRefFrame &<Insert name0> = <Insert object reference (or full object definition)>;
    //AnyRefFrame &<Insert name0> = <Insert object reference (or full object definition)>;
  }; 
  Coef = {{1,0,0}, {0,1,0},{0,0,1}}*180/pi;
  OutDim = 3;
};

This particular example gives all 3 rotations as output, but you could easily do it just for one or two if you rather.

Or you can also use expressions if you want:

AnyVar KneeAngle_degree = KneeAngle_Radian*(180/pi)

Best Regards,
Christine

1 Like
#3

Hi Christine,

Thank you for your answer. You gave me what i want to do :slight_smile:

Hugely thanks,
Dwan