LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Euclidean Distance

Hello all,

 Here i attached a program to find the eculidian distance. Is am i doing the right way?Distance.png

0 Kudos
Message 1 of 3
(2,387 Views)

distance.pngThere are many ways to do this here's one I find clean.  If you make the point cluster a ttpedef it is helpful (no coersion dots) also this typdef can be converted to a 3d coordinate and should still work.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 3
(2,377 Views)

They are the same. Since you have an array of clusters you won't be able to get rid of that loop, though. Whether you unbundle and add or convert the cluster to an array and add the array elements - that's really up to you. Doesn't make much of a difference either way.

 

By the way, watch for coercion dots. Your cluster has SGL elements, but your constants are DBL, so you get automatic upconversion to DBL. This may or may not be what you want.

Message 3 of 3
(2,373 Views)