annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

Euclidean Distance?

Risolto!
Vai alla soluzione

I know that to measure distance between a set of points the equation is SQRT((x2-x1)^2+(y2-y1)^2)

 

I want to double the length of a line a-b for a new line a-c. How do I solve for c? Is there something in vi.lib?

=====================
LabVIEW 2012


0 Kudos
Messaggio 1 di 9
6.379Visualizzazioni

This stuff was a looonnng time ago for me, but assuming a is common, wouldn't c just be 2b-a (calculated on a per x and y basis), without needing the squares and roots? 

 

Michael

 

0 Kudos
Messaggio 2 di 9
6.375Visualizzazioni

That might work but I think it falls apart with angled lines.

 

Capture.PNG

=====================
LabVIEW 2012


0 Kudos
Messaggio 3 di 9
6.368Visualizzazioni

Easiset would be to use complex representation for the points:

 

 

Messaggio 4 di 9
6.351Visualizzazioni

So you have two points. A and B. They make a line segment AB and have length ||AB|| =  sqrt ( (b_x - a_x) ^ 2 + (b_y - a_y ) ^ 2 ).

 

You want to make a second point C such that ||AC|| = 2 ||AB||.

 

Then you say some nonesense about angled lines. Solving for C seems pretty easy to me.

 

Just compute C = 2 * ( B - A ) + A. Where B and A are points (i.e. clusters with an X numeric and Y numeric).distance.png


Also, there is a function in IMAQ called IMAQ Point Distances which find N - 1 distances between a list of length N points.

0 Kudos
Messaggio 5 di 9
6.342Visualizzazioni

You did not really specify what datatype "points" are. (in my book I always use complex in 2D :))

 

The solution by majoris is basically the same as mine, except for the datatype. For the special case of "doubling", we can go even simpler. 😄

 

 

Messaggio 6 di 9
6.333Visualizzazioni
Soluzione
Accettato da autore argomento SteveChandler

DoubleLength.png

Messaggio 7 di 9
6.328Visualizzazioni

@majoris wrote:

So you have two points. A and B. They make a line segment AB and have length ||AB|| =  sqrt ( (b_x - a_x) ^ 2 + (b_y - a_y ) ^ 2 ).

  

Then you say some nonesense about angled lines. Solving for C seems pretty easy to me.

 



Well maybe it is nonsense. Other than that thanks for your answer.

 

Who to give the accepted solution to? Darins was the smallest and simplest. In fact it is so simple that I regret asking Smiley Felice

 

=====================
LabVIEW 2012


0 Kudos
Messaggio 8 di 9
6.309Visualizzazioni

> That might work but I think it falls apart with angled lines.

 

Now why would you post something that proves my point?  🙂  (Sqrt of 200 is 14.142...)

 

0 Kudos
Messaggio 9 di 9
6.283Visualizzazioni