LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

find the x and y coordinates closest to zero on a circle

Solved!
Go to solution

Hi, I have a program that has created a 2D array that generates a circle. I need to find the index of the array that is closest to 0,0 (X,Y).

In the picture attached, I can see manually that the ellement I am looking for is 17 but I need labview to calculate the answer for me. Can anyone help?

0 Kudos
Message 1 of 5
(2,550 Views)
Solution
Accepted by topic author beam7

Fairly straightforward

Capture1.PNG

Use X[] and Y[] as Real and Imaginary Rho is distance to origin.   find the minimum


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(2,535 Views)
Solution
Accepted by topic author beam7

Hi beam,

 

calculate the distance between your points and origin (0, 0). Find the minimum of all distances…

 

See this simple math on your array data:

check.png

Best regards,
GerdW


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

Thanks

0 Kudos
Message 4 of 5
(2,522 Views)

Thanks GerdW

0 Kudos
Message 5 of 5
(2,519 Views)