Vector3::dot

From RAGE Multiplayer Wiki
Revision as of 06:53, 31 May 2019 by Micaww (talk | contribs) (Created page with "This function is used to calculate the dot product of two vectors. The dot product is a number calculated by multiplying the magnitudes of both vectors together, then multipl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function is used to calculate the dot product of two vectors.

The dot product is a number calculated by multiplying the magnitudes of both vectors together, then multiplying that number by cosine of the angle between them.

For normalized vectors, the dot product will be:

   -1 - If the vectors point in the exact opposite direction
   0 - If the vectors are perpendicular
   1 - If the vectors point the same direction

Syntax

vector.dot(Vector3 otherVec);

Required Arguments

  • otherVec: Vector3: The other vector.

Returns

  • number The dot product.

See Also