SAMSON Forum
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • SAMSON Connect
    • Get SAMSON

    Conversion from radian to degree does not work

    Apps
    3
    4
    2917
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Khoa last edited by

      SBQuantity::radian radianValue(1.5);
      SBQuantity::degree degreeValue = radianValue;
      double val = degreeValue.getValue();
      

      I've got val equal to 1.5 !!!
      Perhaps it is a bug ?

      1 Reply Last reply Reply Quote 0
      • DmitriyMarin
        DmitriyMarin last edited by

        Actually, SBQuantity::radian, SBQuantity::degree, and SBQuantity::steradian are internally the same - they are SBQuantity::dimensionless. Therefore, there is no possibility to do a conversion like that, you need to convert radians into degrees yourself.

        Dmitriy,
        The SAMSON Team, https://s-c.io

        1 Reply Last reply Reply Quote 0
        • Stephane
          Stephane last edited by

          Note that there are two ratios provided with the SDK: SBConstant::DegToRag and SBConstant::RadToDeg.

          1 Reply Last reply Reply Quote 1
          • K
            Khoa last edited by Khoa

            Thanks.
            It helps.

            SBQuantity::radian radianValue(1.5);
            SBQuantity::degree degreeValue = radianValue * SBConstant::RadToDeg;
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post