LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding angle between two center points (vision)

Hi all,

   1.  i found a centre points two circles (x1,y1) and (x2,y2) . .. so i need to find the angle between these two points ,. i have used atan((y2-y1)/(x2-x1)) it is rad then i converted into deg.. 

   2 . the calculated degree -87 i am getting negative degree.. 

 

but in Vision assitand i am able to get 270 degree .. everything is perfect .. 

 

please help me to get solution for this . 

0 Kudos
Message 1 of 6
(3,136 Views)

Hi saran,

 

you know you can add 360° to your ~-90° to get your desired ~270°?

 

Simple math, eh!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,125 Views)

Yes I did that .. is it possible to without doing 360 - 90

0 Kudos
Message 3 of 6
(3,122 Views)

Hi saran,

 

as atan is only defined in interval (-pi/2, +pi/2) you will always get results in range -90…90°.

 

Basic math knowledge, don't you think?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,115 Views)

0 Kudos
Message 5 of 6
(3,113 Views)

Hi saran,

 

you aren't familiar with popular knowledge databases like Wikipedia?

 

Reading the LabVIEW help is also a great source of wisdom… Wow, it also links to an example VI in the example finder!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(3,111 Views)