02-05-2010 01:12 PM
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.
Solved! Go to Solution.
02-05-2010 01:41 PM - edited 02-05-2010 01:44 PM
Portugese"I wonder, please, how do I calculate the distances x2-x1 and y2-y1 between two cursors,
in the same waveformgraph?
02-05-2010 05:22 PM
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 ?
02-05-2010 05:32 PM
02-05-2010 06:26 PM
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
02-07-2010 12:53 PM - edited 02-07-2010 01:01 PM
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)
02-07-2010 01:04 PM