# Angle between 3 points

**URL:** <https://forum.babylonjs.com/t/angle-between-3-points/23069>\
**Category:** Questions\
**Created:** [August 13, 2021, 10:08pm UTC](https://forum.babylonjs.com/t/angle-between-3-points/23069 "2021-08-13T22:08:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CornelioD](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/corneliod/32/15799_2.png) [@CornelioD](https://forum.babylonjs.com/u/CornelioD)\
**Post date:** [August 13, 2021, 10:08pm UTC](https://forum.babylonjs.com/t/angle-between-3-points/23069/1 "2021-08-13T22:08:06Z")

</div>

Hi, do you know about a function to calculate the angle between 3 3D points?  
Here my attempt: [https://playground.babylonjs.com/#VV9QTA#5](https://playground.babylonjs.com/#VV9QTA#5)  
Cant wrap my head about how to correctly calculate it…  
Thanks

---

<div class="post-metadata">

**Author:** ![syntheticmagus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syntheticmagus/32/395_2.png) [@syntheticmagus](https://forum.babylonjs.com/u/syntheticmagus)\
**Post date:** [August 14, 2021, 12:10am UTC](https://forum.babylonjs.com/t/angle-between-3-points/23069/2 "2021-08-14T00:10:17Z")

</div>

Hi CornelioD,

Babylon does have [some built-in helper functions](https://doc.babylonjs.com/typedoc/classes/babylon.vector3#getanglebetweenvectors) that can aid with this, but probably the easiest thing to do is calculate the direction vectors and [find the angle between](https://en.wikipedia.org/wiki/Angle#Dot_product_and_generalisations) those, as that simplifies the vector arithmetic.

[Angle between 3 points | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#VV9QTA#6)

I glanced over what you were doing before; it looks like you were doing pretty much the same thing manually, and it was pretty close to the right formula. Looks like you just forgot to take the arccosine of the normalized dot product; with that added, I think the thing you had before works too.

Hope this helps, and best of luck!

---

<div class="post-metadata">

**Author:** ![CornelioD](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/corneliod/32/15799_2.png) [@CornelioD](https://forum.babylonjs.com/u/CornelioD)\
**Post date:** [August 14, 2021, 7:26am UTC](https://forum.babylonjs.com/t/angle-between-3-points/23069/3 "2021-08-14T07:26:32Z")

</div>

Thanks you very much!
