Перейти к содержанию

Vector3::dot

Материал из RAGE MP Wiki Archive
Версия от 06:53, 31 мая 2019; imported>Micaww (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...")
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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