Added George's patch which fixes some region strings, and adds PerpendicularLeft.

This commit is contained in:
the_fiddler 2008-04-06 15:43:35 +00:00
parent b5959e0db5
commit 0e85f2208d
2 changed files with 38 additions and 7 deletions

View file

@ -147,12 +147,12 @@ namespace OpenTK.Math
#endregion
#region public Vector2 Perpendicular
#region public Vector2 PerpendicularRight
/// <summary>
/// Gets the perpendicular vector.
/// Gets the perpendicular vector on the right side of this vector.
/// </summary>
public Vector2 Perpendicular
public Vector2 PerpendicularRight
{
get
{
@ -160,7 +160,22 @@ namespace OpenTK.Math
}
}
#endregion
#endregion
#region public Vector2 PerpendicularLeft
/// <summary>
/// Gets the perpendicular vector on the left side of this vector.
/// </summary>
public Vector2 PerpendicularLeft
{
get
{
return new Vector2(-Y, X);
}
}
#endregion
#region public void Normalize()

View file

@ -157,7 +157,7 @@ namespace OpenTK.Math
#endregion
#region public Vector3 Normalize()
#region public void Normalize()
/// <summary>
/// Scales the Vector3 to unit length.
@ -172,7 +172,7 @@ namespace OpenTK.Math
#endregion
#region public Vector3 NormalizeFast()
#region public void NormalizeFast()
/// <summary>
/// Scales the Vector3 to approximately unit length.
@ -187,7 +187,7 @@ namespace OpenTK.Math
#endregion
#region public Vector3 Scale(float sx, float sy, float sz)
#region public void Scale(float sx, float sy, float sz)
/// <summary>
/// Scales the current Vector3 by the given amounts.
@ -780,6 +780,22 @@ namespace OpenTK.Math
#endregion
#region CalculateAngle
/// <summary>
/// Calculates the angle (in radians) between two vectors.
/// </summary>
/// <param name="first">The first vector.</param>
/// <param name="second">The second vector.</param>
/// <returns>Angle (in radians) between the vectors.</returns>
/// <remarks>Note that the returned angle is never bigger than the constant Pi.</remarks>
public static float CalculateAngle(Vector3 first, Vector3 second)
{
return (float)System.Math.Acos((Vector3.Dot(first, second)) / (first.Length * second.Length));
}
#endregion
#endregion
#region public override string ToString()