# Relative position of two vectors

**URL:** <https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747>\
**Category:** Revit\
**Tags:** geometry, dynamo, vector\
**Created:** [June 17, 2022, 1:38pm UTC](https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747 "2022-06-17T13:38:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.ostroluckyDFFER](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@adam.ostroluckyDFFER](https://forum.dynamobim.com/u/adam.ostroluckyDFFER)\
**Post date:** [June 17, 2022, 1:39pm UTC](https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747/1 "2022-06-17T13:39:00Z")

</div>

Hello everyone,  
I am working on tramway forces calculation in Dynamo. I need to find out if vector v2 is on the left or the right side of vector v1 (positive/negative forces). I can get the angle of the vector planes but in Revit/Dynamo it does not state which way the angle is measured. If it is positive or negative. I can not do angles over 180° either.  
I have tried comparing the vector coordinates however I was not successful. Do you guys have any suggestions?  
Thanks for your time

 ![same situation in Revit](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/0/70238f7b3f30fe783462052999264732a73b4779.png)

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [June 17, 2022, 2:14pm UTC](https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747/2 "2022-06-17T14:14:19Z")

</div>

Hi @adam.ostroluckyDFFER ,

Without having an external measurement of both vectors there is no way to tell if an angle should be negative or positive.

So what about using the node Angle.AboutAxis twice?  
You would have to compare your vectors against the X-axis, revolving around the Z-axis, to find an rotation value of 0 to 360. Now you can simply subtract one from the other to get the angle difference between the two, positive or negative.

---

<div class="post-metadata">

**Author:** ![adam.ostroluckyDFFER](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@adam.ostroluckyDFFER](https://forum.dynamobim.com/u/adam.ostroluckyDFFER)\
**Post date:** [June 20, 2022, 8:24am UTC](https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747/3 "2022-06-20T08:24:46Z")

</div>

Thank you Daan,  
seems like a legit solution. I will try it and post the outcome here. Thanks

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [June 20, 2022, 8:33am UTC](https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747/4 "2022-06-20T08:33:06Z")

</div>

@adam.ostroluckyDFFER ,

just a draft…

 ![2022-06-20_10h32_18](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/2/e2152b92edaaf1c5f707d794843e5d6af40ccccd.png)

---

<div class="post-metadata">

**Author:** ![adam.ostroluckyDFFER](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@adam.ostroluckyDFFER](https://forum.dynamobim.com/u/adam.ostroluckyDFFER)\
**Post date:** [June 20, 2022, 8:39am UTC](https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747/5 "2022-06-20T08:39:04Z")

</div>

Hi @Draxl_Andreas ,  
that is the issue actually. The value is the same.

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [June 20, 2022, 9:04am UTC](https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747/6 "2022-06-20T09:04:28Z")

</div>

![2022-06-20_11h03_42](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/0/80aa700202420918d836bacd35deda6ea9e92cdf.png)

@adam.ostroluckyDFFER

---

<div class="post-metadata">

**Author:** ![adam.ostroluckyDFFER](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@adam.ostroluckyDFFER](https://forum.dynamobim.com/u/adam.ostroluckyDFFER)\
**Post date:** [June 20, 2022, 10:44am UTC](https://forum.dynamobim.com/t/relative-position-of-two-vectors/77747/7 "2022-06-20T10:44:14Z")

</div>

Here is the outcome that I needed

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/9/f9c99445eefbaa55138063202f3666bfcbd93731.png)

I have used Vector.AngleAboutAxis to compare the two vectors with each other. 0-180 is Left, and 180-360 is Right.  
Thank you for your help @Daan
