Implemented perpendicular dot product in Vector2.

This commit is contained in:
Robert Rouhani 2013-01-16 17:46:05 -08:00
Родитель 7a0634814e
Коммит 20c219bda1
1 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -839,6 +839,32 @@ namespace OpenTK
#endregion #endregion
#region PerpDot
/// <summary>
/// Calculate the perpendicular dot (scalar) product of two vectors
/// </summary>
/// <param name="left">First operand</param>
/// <param name="right">Second operand</param>
/// <returns>The perpendicular dot product of the two inputs</returns>
public static float PerpDot(Vector2 left, Vector2 right)
{
return left.X * right.Y - left.Y * right.X;
}
/// <summary>
/// Calculate the perpendicular dot (scalar) product of two vectors
/// </summary>
/// <param name="left">First operand</param>
/// <param name="right">Second operand</param>
/// <param name="result">The perpendicular dot product of the two inputs</param>
public static void PerpDot(ref Vector2 left, ref Vector2 right, out float result)
{
result = left.X * right.Y - left.Y * right.X;
}
#endregion
#region Lerp #region Lerp
/// <summary> /// <summary>