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.

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.xb.x + a.yb.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.