Error in predefined function tan

Issue #135 resolved
Rajesh ASHANI created an issue

tan function considering values (theta) in radian even angle has define in degree in internal unit definition.

For example, <P N="theta_dist" V="30" D="the distribution angle of length Lc(Lc_aa)" UT="Angle" UC="Internal" /> <P N="MCL_parapet" V="-(Mc_parapetLc_parapet)/(Lc_parapet+2tan(theta_dist)*Lc_bb)" />

here tan consider values of theta_dist in radian whereas in the definition of Internal Unit Angle has defined in DEGREE.

if i define this parameter this way then its working fine. <P N="MCL_parapet" V="-(Mc_parapetLc_parapet)/(Lc_parapet+2tan(PItheta_dist/180)Lc_bb)" />

Comments (1)

  1. Ali Koc

    All trigonometry functions radians -- this is by design. These functions are low lovel -- Unit conversions happen at higher level.

    For example, if you make a variable called Angle and you want this variable to be entered in degrees and kept in degrees internally, you need to make the conversion to convert it to radians as you send it to tan function. Ex. tan(Angle * PI / 180). Otherwise, you can set the UI unit to degrees so that user can enter it in degrees but internally it will be kept as radians, in which case no conversion necessary as you use the trigonometric functions.

  2. Log in to comment