QAtan2 result is always one



  • @gx=ps[0]-(0.5ps[2])-(0.5ps[1]);
    gy=(0.866ps[2])-(0.866ps[1]);
    theta=qAtan2(gy,gx);
    angle[tool]=((theta)*180/3.14);@

    The code above is working perfectly
    But below code is not working .

    below code is in the if statement while above is another statement

    @spe=qAtan2(ps_max[0],urt);@

    I have checked ps_max[0].....value always get changed and also value of urt is changed too.
    BUT spe is always equal to 1. Why?

    both declaration of spe and theta are same. BUT why result of spe doesnt changing?

    qxoz: code tags added



  • Hi,

    you should post all code.



  • over 1000 rows of code i have kk



  • No all code; only the part where you use qAtan2.

    Anyway i suggest to use qDebug to print Input/Output parameters of qAtan2


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.