# 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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.