Dear all,

This is a knowledge sharing post.

I wanted to connect the 3 dots with lines in such a way that when i move either of the dots or all dots together the lines stays connected with the dots i.e the lines width are increased as per the dots X&Y positions and so does the rotation in Z. (this is trigonometry). Where can this be useful.. surely sports, maybe news

I know that such a thing is possible thru scripting, but scripting is not my forte so i started looking for doing the same thru VL. And here is the solution for ppl like me who don' know scripting BUT would like to achieve the same thru the powerful VL.

The whole equation is based on 3 formulas of trigonometry.

1. Distance formula (between the 2 dots)

2. Middle/centre point formula (between the 2 dots)

3. Rotation angle formula (of the line )

**1. Distance Formula** (this will be the width of the line (quad))

X2-X1 ----> multiply with the same output

------> Add the 2 output -----> |square root| ----> Line1 (quad) Width

Y2-Y1 ----> multiply with the same output

**2. Middle Point Formula**

X2+X1 ----> Divide by 2 ----> Position X of the Line1 GROUP

Y2+Y1 ----> Divide by 2 ----> Position Y of the Line1 GROUP

**3. Rotation Angle Formula**

X2-X1

-----> Divide the 2 outputs-----> multiply -1 --->|Inverse Tangent| ---> Line1 Z rotation

Y2-Y1

Follow this for the other 2 lines also and once done, when u move any dot(s) at any position the lines will remain connected (increase, rotate and position themself)

**Points to note:**

**1. All primitives should be inside individual GROUPS**

**2. All primitives should have pivots at centre**

**3. All individual GROUPS should be at same pivots and X,Y&Z positions should 0,0,0**

If someone has a better solution then please do share.

Thank you

------------------------------

Gaurav

------------------------------