Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QAtan2 result is always one
Forum Updated to NodeBB v4.3 + New Features

QAtan2 result is always one

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    ganaa
    wrote on last edited by
    #1

    @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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      you should post all code.

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        ganaa
        wrote on last edited by
        #3

        over 1000 rows of code i have kk

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

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

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

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved