From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calcular as distancias x2-x1 e y2-y1 entre dois cursores

Solved!
Go to solution

Gostaria de saber, por gentileza, como faço para calcular as distancias x2-x1 e y2-y1 entre dois cursores,

em um mesmo waveformgraph ?

 

Obrigado,

Juscelino. 

0 Kudos
Message 1 of 7
(3,512 Views)
Solution
Accepted by topic author Juscelino

path.png

Portugese"I wonder, please, how do I calculate the distances x2-x1 and y2-y1 between two cursors,

in the same waveformgraph?

Message Edited by Jeff Bohrer on 02-05-2010 01:44 PM

"Should be" isn't "Is" -Jay
Message 2 of 7
(3,506 Views)

Obrigado pela boa vontade, mas estou entendendo que não é este meu objetivo.

 

Eu tenho um waveformgraph, no qual tenho 2 cursores, e gostaria de calcular a diferença entre a posição x de um cursor e a posição x do segundo cursor.

 

And the same to y.

 

How can I do it ?

0 Kudos
Message 3 of 7
(3,485 Views)
 Not resolved yet.
0 Kudos
Message 4 of 7
(3,474 Views)

Thanks for the good will, but I understand that this is not my goal.

 

I have a waveform graph in which I have 2 cursors, and would like to calculate the difference between the x position of a cursor and the x position of the second cursor.

 

Grab a property node for the control

 

read property, Cursor.Positions[]

solve for the distance by the previous implementation

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 7
(3,462 Views)

The question is a bit ambiguous because there are the two distances (x2-x1, y2-y1) and there is the single 2D distance between the two points.

 

 

Apparently, the problem is not solved yet as this thread seem to imply with the marked solution, because the same question got raised again here.

 

We get the cursor coordinates most easily as xy-clusters so there are two possible answers:

 

 

 

(1) To get the two distances x2-x1 and y2-y1 we would do the following as outlined in the other thread:

 

 

Is is more economical code-wise to take the difference on the cluster and unbundle later. 

 

 

(2) To get the geometric distance between the two points, we would cast the difference to complex and take the absolute value. (This is significantly less code than Jeff's solution above. :))

 

 

 

See attached VI for a very simple example (LabVIEW 8.0) 

Message Edited by altenbach on 02-07-2010 11:01 AM
Download All
Message 6 of 7
(3,405 Views)

Sorry, some labels got messed up above.

 

 

0 Kudos
Message 7 of 7
(3,400 Views)