# How obtain the distance from a vector to the center of the path between two vectors

**URL:** <https://forums.unrealengine.com/t/how-obtain-the-distance-from-a-vector-to-the-center-of-the-path-between-two-vectors/482684>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 30, 2021, 4:26am UTC](https://forums.unrealengine.com/t/how-obtain-the-distance-from-a-vector-to-the-center-of-the-path-between-two-vectors/482684 "2021-04-30T04:26:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![R3zu3\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@R3zu3\_1](https://forums.unrealengine.com/u/R3zu3_1)\
**Post date:** [April 30, 2021, 4:26am UTC](https://forums.unrealengine.com/t/how-obtain-the-distance-from-a-vector-to-the-center-of-the-path-between-two-vectors/482684/1 "2021-04-30T04:26:53Z")

</div>

As the title says. In a 3D space i want to obtain the distance (Blue lines) between a vector **C** to the center of the trace between a vector **A** and another **B**. Thanks !!

![337546-trace.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/5/0c54dc4672cf87bbd110349d9894362664fc36ab.png)

---

<div class="post-metadata">

**Author:** ![GEODVS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GEODVS](https://forums.unrealengine.com/u/GEODVS)\
**Post date:** [April 30, 2021, 7:08am UTC](https://forums.unrealengine.com/t/how-obtain-the-distance-from-a-vector-to-the-center-of-the-path-between-two-vectors/482684/2 "2021-04-30T07:08:05Z")

</div>

Hi,

Here’s how I worked it out…

So long as you’ve set up your line trace correctly.  
Hope it helps…

 ![337548-ue-vectors-0.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/5/065644436241ba734cf0338840fb557f31b425aa.jpeg)

 ![337549-ue-vectors-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/1/2/e1268e68ed74f88a1bb8402581681fddce02b976.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 30, 2021, 7:09am UTC](https://forums.unrealengine.com/t/how-obtain-the-distance-from-a-vector-to-the-center-of-the-path-between-two-vectors/482684/3 "2021-04-30T07:09:27Z")

</div>

![337575-screenshot-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/b/a7b88d4bc2bd44dbd1e88fffa9eb76ad7e869af4.png)

This, me thinks.
