# How to vSize a vector?

**URL:** <https://forums.unrealengine.com/t/how-to-vsize-a-vector/131062>\
**Category:** UDK Content Creation and Design\
**Tags:** unreal-engine\
**Created:** [September 13, 2019, 7:47am UTC](https://forums.unrealengine.com/t/how-to-vsize-a-vector/131062 "2019-09-13T07:47:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neongho](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Neongho](https://forums.unrealengine.com/u/Neongho)\
**Post date:** [September 13, 2019, 7:47am UTC](https://forums.unrealengine.com/t/how-to-vsize-a-vector/131062/1 "2019-09-13T07:47:55Z")

</div>

How to get a float variable out of 2 vectors, which represents the distance between these 2.  
Instead of VSize(v1 - v2) and you get a float which is the maths behind of the function?

---

<div class="post-metadata">

**Author:** ![Nathaniel3W](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nathaniel3W](https://forums.unrealengine.com/u/Nathaniel3W)\
**Post date:** [September 13, 2019, 11:58am UTC](https://forums.unrealengine.com/t/how-to-vsize-a-vector/131062/2 "2019-09-13T11:58:19Z")

</div>

I think this is it:

```auto

xsquared = (v1.X - v2.X) ** 2;
ysquared = (v1.Y - v2.Y) ** 2;
zsquared = (v1.Z - v2.Z) ** 2;
distance = sqrt(xsquared + ysquared + zsquared);

```

---

<div class="post-metadata">

**Author:** ![Neongho](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Neongho](https://forums.unrealengine.com/u/Neongho)\
**Post date:** [September 13, 2019, 3:58pm UTC](https://forums.unrealengine.com/t/how-to-vsize-a-vector/131062/3 "2019-09-13T15:58:01Z")

</div>

You are awsome ^^ thanks
