# Is Vector3.Dot faster than Vector3.Angle?

Hi, I'm currently reading stuff about the purpose of dot product, and from all I can tell, its main use is to determine wether two vectors are parallel or perpendicular, which is nice, but then on the other hand you also have Vector3.Angle returning the angle between two vectors, and it would be quite easy to determine from there if they are perpendicular too.

Also looking at the doc, to calculate the dot product, Unity uses the cosine of the angle, which feels a bit redundant.

So I'm wondering, if people actually use dot product for that purpose at all, is it for performance reasons? Or is there something more clever that you can do with dot products, that apparently no one seems keen to share in any tutorial video on dot products.

**Answer** by balfire
·
Apr 25, 2018 at 07:32 PM

No. Unity does not use the cosine to calculate dot product. If you look around the internet you can find decompiled unity source files. There you can see that dot product is calculated as follows: dot(a,b) = a.x*b.x + a.y*b.y + a.z*b.z.

I myself use Dot when i need to find the cosine between two vectors. In fact, Angle is defined through the use of Dot.

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.